Skip to main content

Create Survey Event Webhook

API Overview

  • Function: Real-time push notifications for survey creation, editing, and deletion events to a specified URL. See Survey Event Push for details. Monitors a specific user ID and pushes notifications when their surveys are created, edited, or deleted.
  • Request Method: POST
  • Request URL: /api/users/{user_id}/webhooks?appid={appid}&access_token={access_token}

Request Parameters

Parameter NameTypeRequiredLocationDescriptionExample
user_idintegerYesuriUser ID or Team ID60000000001, User ID can be found on the Profile page, Team ID can be found on the Team Management page
urlstringYesbodyURL for data push, note that this address must accept POST requestshttps://wesurvey.com
is_activeboolYesbodyEnable status (true: enabled, false: disabled)true

Response Parameters

Parameter NameTypeDescription
idintegerAuto-increment ID
urlstringURL
is_activeboolEnable status
created_atdatetimeCreation time
updated_atdatetimeModification time

Response Examples

  • Successful Request
{
"code": "OK",
"error": {
"type": ""
},
"data": {
"id": 42,
"user_id": 1411902221,
"object": "User_60000000001",
"url": "https://wesurvey.com/",
"secret": "",
"is_active": true,
"options": "{\"listenedResources\":[\"survey\"]}",
"created_at": "2022-06-21 16:02:33",
"updated_at": "2022-06-21 16:02:33"
},
"request_id": "e4b27037-d876-427d-95c7-d5a737dd1677"
}
  • Failed Request
{
"code": "InvalidArgument",
"error": {
"type": "invalid_argument_url",
},
"data": {},
"request_id": "ddec96d2-165e-4f3e-8a64-2057db116983"
}

Error Codes

error.type Error CodeDescription
permission_deniedNo creation permission
invalid_argument_urlInvalid URL
invalid_argumentParameter validation failed
resource_exhaustedCreation limit exceeded
create_errorFailed to create webhook