Register Webhook URL endpoint

Updated on Jan 11, 2023

Introduction

This endpoint allows you to register and subscribe to a webhook in WP SMS. This endpoint can be useful if you want to receive updates or notifications through the webhook, or if you need to register the webhook for any other reason.

POST /wp-json/wpsms/v1/webhook

Authentication

Learn how to use the ‘Register Webhook URL’ endpoint in the WP SMS plugin to register and subscribe to a webhook.

WP SMS supports Application Password authentication, which is available in WordPress version 5.6 and higher.

To create an Application Password, go to your profile page in the WordPress admin and enter a name in the ‘New Application Password Name‘ input. Click the ‘Add New Application Password‘ button to generate and display the password, which you can use to authenticate requests to the REST API.

When using Basic Authentication with this Application Password, use your account username or email address as the username.

Parameters

  • webhook_url – The webook URL
  • type – Accepts new_subscriber and new_sms

Request

curl --location --request POST 'https://site.com/wp-json/wpsms/v1/webhook' \
--header 'Authorization: Basic ***' \
--form 'webhook_url="https://webhookurl.com"' \
--form 'type="new_sms"'