createWebhookForPhoneNumberWithHttpInfo method

Future<Response> createWebhookForPhoneNumberWithHttpInfo(
  1. String phoneNumberId,
  2. CreateWebhookOptions createWebhookOptions
)

Attach a WebHook URL to a phone number

Get notified whenever a phone number receives an SMS via a WebHook URL.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> createWebhookForPhoneNumberWithHttpInfo(String phoneNumberId, CreateWebhookOptions createWebhookOptions,) async {
  // ignore: prefer_const_declarations
  final path = r'/phone/numbers/{phoneNumberId}/webhooks'
    .replaceAll('{phoneNumberId}', phoneNumberId);

  // ignore: prefer_final_locals
  Object? postBody = createWebhookOptions;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}