WebhookService
1. Import the service from our library:
import {WebhookService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getAllWebhookEndpoints` will return the paginated list of webhook endpoints.
async getAllWebhookEndpoints() {
return await WebhookService.getAllWebhookEndpoints();
}
In case of required `params`, just add them inside the brackets.
async getASpecificWebhookEndpoint(webhookId) {
return await WebhookService.getASpecificWebhookEndpoint(webhookId);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
1. Declare it(or declare them, it is possible to add multiple params)
const headers = headers: {Authorization: `Bearer ${yourToken}`}
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
Constructors
Constructor
new WebhookService():
WebhookService
Returns
WebhookService
Methods
createWebhookEndpoint()
staticcreateWebhookEndpoint(params,config?):Promise<SCWebhookEndpointType>
Parameters
| Parameter | Type |
|---|---|
params | WebhookParamType |
config? | AxiosRequestConfig |
Returns
Promise<SCWebhookEndpointType>
deleteWebhookEndpoint()
staticdeleteWebhookEndpoint(id,config?):Promise<any>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise<any>
expireWebhookSigningSecret()
staticexpireWebhookSigningSecret(id,config?):Promise<SCWebhookEndpointType>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise<SCWebhookEndpointType>
getAllWebhookEndpointAttempts()
staticgetAllWebhookEndpointAttempts(id,config?):Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>
getAllWebhookEndpoints()
staticgetAllWebhookEndpoints(config?):Promise<SCPaginatedResponse<SCWebhookEndpointType>>
Parameters
| Parameter | Type |
|---|---|
config? | AxiosRequestConfig |
Returns
Promise<SCPaginatedResponse<SCWebhookEndpointType>>
getAllWebhookEvents()
staticgetAllWebhookEvents(config?):Promise<any>
Parameters
| Parameter | Type |
|---|---|
config? | AxiosRequestConfig |
Returns
Promise<any>
getASpecificWebhookEndpoint()
staticgetASpecificWebhookEndpoint(id,config?):Promise<SCWebhookEndpointType>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise<SCWebhookEndpointType>
resendMultipleWebhookEndpointEvent()
staticresendMultipleWebhookEndpointEvent(id,event,config?):Promise<any>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
event | number[] |
config? | AxiosRequestConfig |
Returns
Promise<any>
resendWebhookEndpointEvent()
staticresendWebhookEndpointEvent(id,event,config?):Promise<any>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
event | number |
config? | AxiosRequestConfig |
Returns
Promise<any>
revealWebhookSigningSecret()
staticrevealWebhookSigningSecret(id,config?):Promise<SCWebhookEndpointSecretType>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise<SCWebhookEndpointSecretType>
updateASingleWebhookEndpointField()
staticupdateASingleWebhookEndpointField(id,params,config?):Promise<SCWebhookEndpointType>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
params | WebhookParamType |
config? | AxiosRequestConfig |
Returns
Promise<SCWebhookEndpointType>
updateASpecificWebhookEndpoint()
staticupdateASpecificWebhookEndpoint(id,params,config?):Promise<SCWebhookEndpointType>
Parameters
| Parameter | Type |
|---|---|
id | string | number |
params | WebhookParamType |
config? | AxiosRequestConfig |
Returns
Promise<SCWebhookEndpointType>