Skip to main content

Class: WebhookService

services/webhook.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

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

Parameters

NameType
paramsWebhookParamType
config?AxiosRequestConfig<any>

Returns

Promise<SCWebhookEndpointType>

Defined in

services/webhook/index.ts:194


deleteWebhookEndpoint

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/webhook/index.ts:214


expireWebhookSigningSecret

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCWebhookEndpointType>

Defined in

services/webhook/index.ts:223


getASpecificWebhookEndpoint

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCWebhookEndpointType>

Defined in

services/webhook/index.ts:197


getAllWebhookEndpointAttempts

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>

Defined in

services/webhook/index.ts:217


getAllWebhookEndpoints

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

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCWebhookEndpointType>>

Defined in

services/webhook/index.ts:188


getAllWebhookEvents

getAllWebhookEvents(config?): Promise<any>

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/webhook/index.ts:191


resendMultipleWebhookEndpointEvent

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

Parameters

NameType
idstring | number
eventnumber[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/webhook/index.ts:232


resendWebhookEndpointEvent

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

Parameters

NameType
idstring | number
eventnumber
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/webhook/index.ts:229


revealWebhookSigningSecret

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

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCWebhookEndpointSecretType>

Defined in

services/webhook/index.ts:226


updateASingleWebhookEndpointField

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

Parameters

NameType
idstring | number
paramsWebhookParamType
config?AxiosRequestConfig<any>

Returns

Promise<SCWebhookEndpointType>

Defined in

services/webhook/index.ts:207


updateASpecificWebhookEndpoint

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

Parameters

NameType
idstring | number
paramsWebhookParamType
config?AxiosRequestConfig<any>

Returns

Promise<SCWebhookEndpointType>

Defined in

services/webhook/index.ts:200