Hi, I’m investigating using the profile API to update profile webhook configurations, but I can’t quite figure out how to use the PATCH command /v1/:accountId/profiles/:profileId
.
I’m attempting to add missing webhook configs and update misconfigured ones. I’m fetching profiles with a call like this:
GET /v1/:accountId/profiles/:profileId?fields=id,actions,actions.id,actions.type,actions.anchor,actions.to,actions.body,headers,headers.x-auth-token
(We add our webhook auth in a header)
I’m then removing misconfigured actions
and adding new ones to the end of the list, omitting the id
field. The set of actions
is as before but with new/modified ones appended to the end. Doing a PATCH against
PATCH /v1/:accountId/profiles/:profileId?fields=actions,actions.type,actions.anchor,actions.to,actions.body,actions.headers,actions.headers.x-auth-token
This gives me a 400 Bad Request error with response:
{
"type": "CaligraphException",
"code": "caligraph_invalid_payload",
"message": "Invalid payload",
"status": "BAD_REQUEST",
"errors": [],
"httpStatusCode": 400
}
I’m unsure what’s wrong or how to use this API properly.
Do I need to include all existing actions when adding or modifying some?