createWebhookWithHttpInfo method

Future<Response> createWebhookWithHttpInfo(
  1. String inboxId,
  2. CreateWebhookOptions createWebhookOptions
)

Attach a WebHook URL to an inbox

Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> createWebhookWithHttpInfo(String inboxId, CreateWebhookOptions createWebhookOptions,) async {
  // ignore: prefer_const_declarations
  final path = r'/inboxes/{inboxId}/webhooks'
    .replaceAll('{inboxId}', inboxId);

  // 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,
  );
}