POST api/WebHookSubscription/Subscribe

<strong>post/Subscribe</strong> <br /> Registers a new WebHook for a given device.

Request Information

URI Parameters

None.

Body Parameters

The WebHook to create. { "Id": "8c0b74eec7a740d886d215ee4b6d34b6", "WebHookUri": "[SERVER]/api/webhooks/incoming/custom", "Secret": "41273e1631d945a2b25836ebc5b591ca", "Description": null, "IsPaused": false, "Filters": [ "131" ], "Headers": {}, "Properties": {} } [Optional] IdstringSets a unique ID of the WebHook. This ID can be used to later refer to the WebHook in case it needs to be updated or deleted.The ID is by default in the form of a Guid and if the field is cleared it will be reset to a Guid.WebHookUristringSets the URI of the WebHook.SecretstringSets the secret used to sign the body of the WebHook request.[Optional] DescriptionstringSets a description of the WebHook.[Optional] IsPausedbooleanSets a value indicating whether the WebHook is paused.FiltersarrayThe room which this WebHook will be notified for its events. [Optional] HeadersarraySet of additional HTTP headers that will be sent with the WebHook request. [Optional] PropertiesarraySet of additional case-insensitive properties that will be sent with the WebHook request as part of the HTTP request entity body.

WebHook
NameDescriptionTypeAdditional information
Id

string

None.

WebHookUri

URI

Required

Secret

string

None.

Description

string

None.

IsPaused

boolean

None.

Filters

Collection of string

None.

Headers

Dictionary of string [key] and string [value]

None.

Properties

Dictionary of string [key] and Object [value]

None.

Request Formats

application/json, text/json, text/html

Sample:
{
  "Id": "sample string 1",
  "WebHookUri": "http://webapihelppage2.com",
  "Secret": "sample string 3",
  "Description": "sample string 4",
  "IsPaused": true,
  "Filters": [],
  "Headers": {},
  "Properties": {}
}

application/xml, text/xml

Sample:
<WebHook xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Microsoft.AspNet.WebHooks">
  <Description>sample string 4</Description>
  <Headers xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <Id>sample string 1</Id>
  <IsPaused>true</IsPaused>
  <Properties xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <Secret>sample string 3</Secret>
  <WebHookUri>http://webapihelppage2.com/</WebHookUri>
</WebHook>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'WebHook'.

Response Information

Resource Description

if successfully subscribed the method returns the created webhook else error

WebHook
NameDescriptionTypeAdditional information
Id

string

None.

WebHookUri

URI

Required

Secret

string

None.

Description

string

None.

IsPaused

boolean

None.

Filters

Collection of string

None.

Headers

Dictionary of string [key] and string [value]

None.

Properties

Dictionary of string [key] and Object [value]

None.

Response Formats

application/json, text/json, text/html

Sample:
{
  "Id": "sample string 1",
  "WebHookUri": "http://webapihelppage2.com",
  "Secret": "sample string 3",
  "Description": "sample string 4",
  "IsPaused": true,
  "Filters": [],
  "Headers": {},
  "Properties": {}
}

application/xml, text/xml

Sample:
<WebHook xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Microsoft.AspNet.WebHooks">
  <Description>sample string 4</Description>
  <Headers xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <Id>sample string 1</Id>
  <IsPaused>true</IsPaused>
  <Properties xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <Secret>sample string 3</Secret>
  <WebHookUri>http://webapihelppage2.com/</WebHookUri>
</WebHook>