Creating Webhook with subscope

Sandy T.
Sandy T. ✭✭
edited 05/19/23 in API & Developers

Hi,

I am trying to create a webhook via payload with the request body like the one below, which is an example from the API document, it failed and returned a HTTP status code 400.

{
  "callbackUrl": "https://www.myApp.com/webhooks",
 "enabled": true,
 "events": [
  "*.*"
 ],
 "name": "Webhook for Sheet Creation",
 "version": 1,
 "scopeObjectId": 3285357287499652,
 "scope": "sheet",
 "subscope": [
  {
   "columnIds": [
    7960873114331012,
    8731310160793142
   ]
  }
 ]
}

Response body:

{
    "errorCode": 1008,
    "message": "Unable to parse request. The following error occurred: Field \"subscope\" was of unexpected type.",
    "refId": "kicl2j"
}

Then, I tried to remove the square brackets inside subscope, i.e.:

{
  "callbackUrl": "https://www.myApp.com/webhooks",
 "enabled": true,
 "events": [
  "*.*"
 ],
 "name": "Webhook for Sheet Creation",
 "version": 1,
 "scopeObjectId": 3285357287499652,
 "scope": "sheet",
 "subscope": {
  "columnIds": [
   7960873114331012,
   8731310160793142
  ]
 }
}

It also failed and returned a HTTP status code 400.

Response body:

{
    "errorCode": 1032,
    "message": "The attribute(s) webhook.enabled are not allowed for this operation.",
    "refId": "9o8wuo"
}


Does anyone have any clues?

Does the column type matters? The column types I used include "PICKLIST" and "CONTACT_LIST".

Best Answer

Answers