createWebhookEndpoint method
Future<TCreateWebhookEndpointResponse>
createWebhookEndpoint({
- required TCreateWebhookEndpointBody input,
Create a webhook endpoint for an organization.
Sign the provided TCreateWebhookEndpointBody with the client's stamp function and submit the request (POST /public/v1/submit/create_webhook_endpoint).
See also: stampCreateWebhookEndpoint.
Implementation
Future<TCreateWebhookEndpointResponse> createWebhookEndpoint({
required TCreateWebhookEndpointBody input,
}) async {
final body = packActivityBody(
bodyJson: input.toJson(),
fallbackOrganizationId: input.organizationId ??
config.organizationId ??
(throw Exception(
"Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
activityType: 'ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT',
);
return await request<Map<String, dynamic>, TCreateWebhookEndpointResponse>(
"/public/v1/submit/create_webhook_endpoint",
body,
(json) => TCreateWebhookEndpointResponse.fromJson(
transformActivityResponse(json, 'CreateWebhookEndpoint')));
}