Bind¶
- Summary: The bind API is used to facilitate binding between exchanges and queues of different devices. When a device obtains read access to another device it can bind its queue to that device’s exchange using the
bindAPI. The binding can be done either to its regular queue or to its priority queue depending on the user’s preference.
Request¶
Endpoint: Either of
https://localhost/entity/bindhttps://localhost/owner/bind
Method:
POSTSecurity Scheme: Either of
Required Headers:
Header Name Description to Name of the device to bind to topic Topic of the message, e.g. temperature,logs,errors, etc.message-type Either of public,protected,privateordiagnostics
Responses¶
200 OK- The bind was successful
400 Bad RequestIf any of the required headers are missing from the request:
{ "error": "inputs missing from headers" }
If
message-typeis provided but is not valid:{ "error": "message-type is invalid" }
If the requested
validityis out of range:{ "error": "validity must be in number of hours" }
If the requested
permissionis not valid:{ "error": "invalid permission" }
403 Forbidden:If the owner calls the API but the
fromheader is missing:{ "error": "from value missing in header" }
When the
fromheader is present but not valid:{ "error": "from is not a valid entity" }
When the owner calling the API is not the owner of the
fromdevice:{ "error": "you are not the owner of the 'from' entity" }
If the message-type is
privatebut the givenidis not the owner of``to`` is not a valid entity:{ "error": "'to' is not a valid entity" }
If device is not autonomous or there is no such ACL entry:
{ "error": "unauthorized" }
If the requested topic is invalid:
{ "error": "invalid topic" }