Register for webhook events

POST /Webhooks/Register

This call registers you to webhook events.

Request URL

https:// .../Webhooks/Register

Sample request in cURL - POST /Webhooks/Register

In the request below, you can see that the event registered shows like this, eventName=RailUpdated

curl --location --request POST 'https://arixapisandbox.crbnj.net/Webhooks/Register' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ew0KICAiYWxnIjogIlJTMjU2IiwNCiAgImtpZCI6ICJ6WDU3TXE2NXRxNTJEQ0YwRGpQMVdObE9BTlUiLA0KICAidHlwIjogIkpXVCIsDQogICJ4NXQiOiAielg1N01xNjV0cTUyRENGMERqUDFXTmxPQU5VIg0KfQ.ew0KICAibmJmIjogMTYwMzg4NzIzMCwNCiAgImV4cCI6IDE2MDM4OTA4MzAsDQogICJpc3MiOiAiaHR0cHM6Ly9vYXV0aHRlc3QuY3JibmoubmV0IiwNCiAgImF1ZCI6IFsNCiAgICAiaHR0cHM6Ly9vYXV0aHRlc3QuY3JibmoubmV0L3Jlc291cmNlcyIsDQogICAgImNyYmFwaSINCiAgXSwNCiAgImNsaWVudF9pZCI6ICJBcml4VGVzdFVzZXIiLA0KICAicm9sZSI6IFsNCiAgICAiQXV0aGVudGljYXRlZCBVc2VycyIsDQogICAgIlRoaXMgT3JnYW5pemF0aW9uIiwNCiAgICAiRGVueUFjY2VzcyIsDQogICAgIkFyaXhNUExVc2VyR3JvdXAiLA0KICAgICJTZXJ2aWNlIGFzc2VydGVkIGlkZW50aXR5IiwNCiAgICAiTWVkaXVtIE1hbmRhdG9yeSBMZXZlbCINCiAgXSwNCiAgInNjb3BlIjogWw0KICAgICJjcmJhcGkiDQogIF0NCn0.dyPaJbByJ_wcII35jjhiRq2GuBwMj_-kwOYgxVYmbZxTdi6H7Qh45ARCl-Eq-aL6pab0Bo4Xb3dATHqkMQlhwGtaMctCEj9eJUL3-xzB9ugA_MpbYuOUPuyV8gmOfrKsN2rfrBQt3j7zXzqZhGk5R9kT2fauoGiwUIK2LtzFhUBbJOIGz8V8lqh6p-MGdizs4PBZ3CWt6natZ1X0bOII4r6PFCx0S9LXH078I8_z12VU7941pga2TM5nVJG203OpnRl71WgaFFtwYZb50yhjBJatmCzOyBLSXgkDIYfUqTzIQooV4_izuVi3vwx8qZDps4tjfw7RPcgGRofbEICTVQ' \
--header 'Cookie: ss-opt=temp; ss-id=ENAgtwSchnShvvpW1Is5; ss-pid=syRLWrXbKewzZ9pQGHS0' \
--form 'eventName=RailUpdated' \
--form 'callbackURL=https://webhook.site/d200d27d-baf2-4046-a7e5-5ba877c0af20
'

Sample response in JSON - POST /Webhooks/Register

In the image of the response below from the Arix test collection in Postman, the registration number of the new registered event shows.

  • #1 shows the eventName, RailUpdated.
  • #2 shows the callbackURL which receives the webhook
  • #3 shows the registration ID number that was added

Required parameters

Parameter name

Description

EventName
string

The name of the event to subscribe to.

callbackURL
string

The URL to receive the webhook report.

Testing webhook registration

To test registering webhooks you can use the webhook.site and the Arix test collection for Postman. Follow these instructions to test the webhooks.

To register your URL to receive webhook events:

  1. Go to https://webhook.site.
  2. Click New on the top menu.
    The site returns Your unique URL.
  3. Copy to clipboard your unique URL.

Note: If you already have other webhooks registered, the browser might automatically direct you to the URL you've used.

  1. From the Postman menu, Webhooks Register, click the tab, Params.
  2. In the KEY field, enter eventName and callbackURL.
    For information on event names, click View webhook events available
  3. In the VALUE fields, enter the event name to register, and the URL you copied.
  4. Click Send.

The response is the RegistrationId of the event. You can find the registration ID with the call,
GET /Webhooks/GetRegistrations.

Repeat the process for each event that you want to register for.

Note: You can only register for events that you are not currently registered for. If you try to register for an event you are already registered for, or change the callback URL for an event you are already registered for, you will receive an error message in the response body notifying you that you are already registered for the requested event.


Did this page help you?