Create or Replace webhooks
POST https://chatapps.8x8.com/api/v1/accounts/:accountId/webhooks
Sending a POST request on this endpoint allows to add a new webhook for an account or modify the configuration of an existing one .
Webhooks can be given an account-wide and/or a type-wide scope using the * character
For example: if a webhook is created with subAccount=* , this webhook will receive events across all the subaccounts of an account.
Request
Path Parameters
Possible values: >= 32 characters and <= 36 characters, Value must match regular expression ^[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}$
You must replace {accountId} with the accountid that you want to use.
Body array
- Array [
- Sets the subaccount scope of the webhook.
- Use
*to receive events across all subAccounts. - Use the
subAccountIdto receive events for a specific subaccount. - Encode
user:passwordin base64 (e.g.dXNlcjpwYXNzd29yZA==) - Set this field to
Basic dXNlcjpwYXNzd29yZA== - Sets the type of webhook to be added/updated.
- Possible values are:
-
CADRfor delivery receipts -
MSGfor inbound messages -
CABMfor Messaging Apps Business Management Updates
-
- When not provided, webhooks will be added/updated for only CADR and MSG.
- ]
Onion_Marketing
The url to use for the webhook (8x8 platform will send events to this URL).
http://example.com
A static value sent as the HTTP Authorization header with every webhook request. Use this for static credentials such as API keys or pre-shared tokens.
Example — Basic Authorization:
For OAuth 2.0 Client Credentials flow, leave this field empty and use the
oauthproperty instead.
Bearer 9QQhlsEb8VY
Use this flag to enable or disable a Webhook.
true
false
This parameter is not mandatory.
Possible values: [CADR, MSG, CABM]
oauth object
OAuth 2.0 Client Credentials configuration for webhook authentication. When configured, the platform will obtain an access token from the specified token endpoint and include it in the webhook request.
The token endpoint URL used to obtain the OAuth access token.
https://auth.example.com/oauth/token
The client ID for OAuth authentication.
my-client-id
The client secret for OAuth authentication.
my-client-secret
Specifies where the client credentials are sent: header (HTTP Basic Auth) or body (form body).
Possible values: [header, body]
header
Optional space-separated list of OAuth scopes to request.
read write
The webhook was created or updated successfully
Bad request error response
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1002,
"message":"Invalid MSISDN format (not E.164 international number)",
"errorId":"b4478860-b76c-e811-814e-022a35cc1c71",
"timestamp":"2018-08-04T09:25:40.9235752+00:00"
}
Request was not authenticated response
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1200,
"message":"Request was not authenticated properly",
"errorId":"db9dced4-3534-4d86-9d18-6b448af0d621",
"timestamp":"2018-08-02T09:42:38.8988997+00:00"
}
Internal server error
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":2000,
"message":"Internal server error",
"errorId":"db9dced4-3534-4d86-9d18-6b448af0d621",
"timestamp":"2018-07-02T09:42:38.8988997+00:00"
}
Source: https://developer.8x8.com/connect/reference/add-webhooks-1 · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments