POST api/v1/Facilities/{id}/RegisterDataHook
Registers a WebHook for Entity changes
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| id |
Unique identifier of the Facility/Building for which this webhook is being registered. |
globally unique identifier |
Required |
Body Parameters
The hook registration data
RegisterDataHookModel| Name | Description | Type | Additional information |
|---|---|---|---|
| EntityId |
The ID of the entity for which the web hook is to be registered. |
globally unique identifier |
None. |
| URL |
URL of the webhook that BluB0X will be calling on the service provider’s side. |
string |
None. |
| EntityMask |
A bitmask of which entities you want the hook called for when it is added, updated or deleted. |
ApiWebHookEntityMask |
None. |
| InitialToken |
The authorization token to be used on the first call of the webhook |
string |
None. |
Request Formats
application/json, text/json
Sample:
{
"EntityId": "85a3729c-a068-4274-8807-5f02fc88c450",
"URL": "sample string 2",
"EntityMask": 1,
"InitialToken": "sample string 3"
}
application/xml, text/xml
Sample:
<RegisterDataHookModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Models"> <EntityId>85a3729c-a068-4274-8807-5f02fc88c450</EntityId> <EntityMask>Occupancy</EntityMask> <InitialToken>sample string 3</InitialToken> <URL>sample string 2</URL> </RegisterDataHookModel>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
Result| Name | Description | Type | Additional information |
|---|---|---|---|
| ResultCode |
Represents the result code |
integer |
None. |
| Description |
Represents a description of the result code |
string |
None. |
Response Formats
application/json, text/json
Sample:
{
"ResultCode": 1,
"Description": "sample string 2"
}
application/xml, text/xml
Sample:
<Result xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/APIWebRole.Controllers"> <Description>sample string 2</Description> <HttpStatusCode>Continue</HttpStatusCode> <ResultCode>1</ResultCode> </Result>