Device to Cloud Getting Started Integrate your application via HTTP webhook
Introduction
This chapter describes how you can integrate your application using an HTTP webhook with D2C, so that it can be used as an endpoint for the uplink message routing.
If your application’s HTTP webhook is not readily available for initial testing with D2C, this Get Started guide will help you temporarily use a test API endpoint at webhook.site .
The following three steps will guide you through your first integration of an HTTP webhook as a D2C application:
Create simple webhook at webhook.site
In case you don’t have a webhook URL of your own application available, you can create a test webhook endpoint by simply opening the website https://webhook.site .
https://webhook.site

To copy the webhook URL, simply click on it (e.g., https://webhook.site/831255b2-7e62-4608-90d6-58d7a9292e1C in the example above), and it will be copied to your clipboard.
Register your webhook as application in D2C
To allow D2C to send uplink messages from devices to your application using a webhook, you need to create a WebHook Application in D2C.
Go to the Applications tab in D2C, click the Add application button, and choose the WebHook option. This will open a dialog where you can set up your WebHook Application.
D2C application tab

Add webhook application dialog

After clicking the Add application button in the dialog, the Application object and a corresponding default Device Group with the same name is created in D2C. Next, close the confirmation window and refresh the Applications tab in your browser. You will see both at the top of the list of objects in the Applications tab (see figure below).
Newly created application with its default Device Group

Verify your webhook
To check if D2C can send messages to your previously created Webhook Application, you need a Device object. Simply assign this Device object to the default Device Group which has been automatically created for the Application before.
To assign the Device to the Device Group go to the Applications tab and select the Edit devices function in the context menu of the Application’s’ Device Group (see figure below).
Device group context menu

Edit device assignment of a device group

{
"m2m:sgn": {
"sur": "d2c-wbv/68ac89661b8ac79b38673a6b",
"vrq": true,
"cr": "CAdmin"
}
}
| Element name | Type | Description |
|---|---|---|
| m2m:sgn | oneM2M type | Signal or subscription notification |
| sur | string | Subscription resource name |
| vrq | boolean | Verification request. If set to true it shall be checked if the application is still reachable. If the application URL is not reachable, times out or returns a HTTP response code other than OK (2xx), and the subscription is NOT created. |
| cr | string. | oneM2M id of the signal originator |
If everything is set up correctly, you should see the oneM2M Signal in the webhook.site page that you have kept open during this tutorial (see figure below).
Webhook site after receiving the oneM2M subscription notification
