Introduction
WebHook Management and Usage allows you to configure web hook notifications to be sent to external systems when certain events occur within the system. The initial implementation of this feature allows both App and In app (SKUs) purchase notifications to be sent when a purchase happens. A second notification can be sent when a subscription plan is cancelled by a customer.
Managing your Web Hooks
Web Hook Configuration
The first step in using this feature is to setup a web hook configuration. These are setup initially to define attributes like end point, payload type and HTTP method. The web hook configurations will later be used to define specific actions with apps and/or SKUs. The same WebHook can be used for multiple apps or multiple skus or any combination.
- Once logged in, navigate to Accounts, then click on Web Hooks.
- Here you will see the current list of Web Hooks. Perform any of the following actions:
- If you have permission to create new Web Hooks, then you can click on the Add Web Hook button () to create a new web hook.
- If you have permission to edit web hooks, you can click on the edit icon () to edit the web hook.
- If you have permission to delete web hooks, you can click on the trash can icon () to delete the web hook.
Web Hook Data Fields
Regardless if you are editing an existing web hook or creating a new one, the data fields on the form are:
Data Field | Required? | Description |
---|---|---|
Name | Yes | Name of the Web Hook, use this to describe the web hook for selection when creating actions later. |
URI End Point | Yes | The URL end point that will be called when a notification occurs. |
HTTP Method to use | Yes | If the web hook notification should use a POST or PUT HTTP operation when calling the web hook. |
Content Payload Type | Yes | If the system should send key/value form data, XML or JSON for the notification payload. |
Active | Yes | If this Web Hook is active. If this is turned off, then web hook testing and any associated web hook action will not fully execute. |
Click on the Save button to persist the Web Hook information.
Designing your service
As noted by the web hook configuration, there are a few things to consider when designing your service.
-
Use of SSL or no SSL is indicated in the url. Choose either http or https as the protocol. Sending to self signed certificates will not work.
-
Choose either a post or put action called to your service
-
Choose the payload type, the web hook notification service can send XML, JSON or form data.
-
Background jobs created to send web hook notifications are expecting a HTTP status code of 200 to be returned when successfully processed. Any other status code will be considered an error and the background will fail. A new job will be scheduled to retry at a future time. A maximum of 20 retries will occur before the notification will be marked as a failure.
-
You DO NOT need to send any payload back to us, only set the HTTP response code.
Testing the Web Hook
You can test the web hook prior to assigning it to a web hook action by using the test feature described below.
- Click on the web hook name link to get the web hooks detail page.
- Click on the Test button.
A background job will be started to send the web hook notification. A simple ping payload will be sent:
If using JSON
{ :payload => {:type=>"ping", :epoch_timestamp=>1466526410}, :md5 => "abc13af23facvasdf123asdfasdvxz2" }
If using XML
<notification> <payload> <type>ping</type> <epoch_timestamp>1466526410</timestamp> </payload> <md5>abc13af23facvasdf123asdfasdvxz2</md5> </notification>
The first parameter payload will contain the notification payload. The second parameter md5 will contain an md5 hash of the notification payload. You may use this value to verify the payload before processing.
Your service only needs to return a HTTP success code (200) for response. Nothing is parsed or read from your server.
If the test job is successful, the web hook configuration will remain active. If it fails, it will be marked as inactive.
Current Web Hook Actions
The following Web Hook Actions are available at this time.
Comments
0 comments
Please sign in to leave a comment.