Skip to main content

WebhookService

Webhook service can be used in the following way:
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()

static createWebhookEndpoint(params, config?): Promise<SCWebhookEndpointType>

Parameters

ParameterType
paramsWebhookParamType
config?AxiosRequestConfig

Returns

Promise<SCWebhookEndpointType>


deleteWebhookEndpoint()

static deleteWebhookEndpoint(id, config?): Promise<any>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


expireWebhookSigningSecret()

static expireWebhookSigningSecret(id, config?): Promise<SCWebhookEndpointType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCWebhookEndpointType>


getAllWebhookEndpointAttempts()

static getAllWebhookEndpointAttempts(id, config?): Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>


getAllWebhookEndpoints()

static getAllWebhookEndpoints(config?): Promise<SCPaginatedResponse<SCWebhookEndpointType>>

Parameters

ParameterType
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCWebhookEndpointType>>


getAllWebhookEvents()

static getAllWebhookEvents(config?): Promise<any>

Parameters

ParameterType
config?AxiosRequestConfig

Returns

Promise<any>


getASpecificWebhookEndpoint()

static getASpecificWebhookEndpoint(id, config?): Promise<SCWebhookEndpointType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCWebhookEndpointType>


resendMultipleWebhookEndpointEvent()

static resendMultipleWebhookEndpointEvent(id, event, config?): Promise<any>

Parameters

ParameterType
idstring | number
eventnumber[]
config?AxiosRequestConfig

Returns

Promise<any>


resendWebhookEndpointEvent()

static resendWebhookEndpointEvent(id, event, config?): Promise<any>

Parameters

ParameterType
idstring | number
eventnumber
config?AxiosRequestConfig

Returns

Promise<any>


revealWebhookSigningSecret()

static revealWebhookSigningSecret(id, config?): Promise<SCWebhookEndpointSecretType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCWebhookEndpointSecretType>


updateASingleWebhookEndpointField()

static updateASingleWebhookEndpointField(id, params, config?): Promise<SCWebhookEndpointType>

Parameters

ParameterType
idstring | number
paramsWebhookParamType
config?AxiosRequestConfig

Returns

Promise<SCWebhookEndpointType>


updateASpecificWebhookEndpoint()

static updateASpecificWebhookEndpoint(id, params, config?): Promise<SCWebhookEndpointType>

Parameters

ParameterType
idstring | number
paramsWebhookParamType
config?AxiosRequestConfig

Returns

Promise<SCWebhookEndpointType>