Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 785 Bytes

publish.md

File metadata and controls

43 lines (27 loc) · 785 Bytes

PUBLISH API

To publish data to the middleware, devices can use the API with the following parameters in the body.

  • apikey is required. This apikey is obtained during the registration of an entity. (its not user apikey eg. guest)

URL : https://localhost:10443/api/1.0.0/publish

Method : POST

Auth required : YES

Curl example

curl --insecure -i -X POST https://localhost:10443/api/1.0.0/publish \
-H 'apikey: 219bf59341e24fe2901f52b0f8fbbff6' \
-d '{"body": "turn ON streetlight"}'

Success Response

Code : 200 OK

Content example

Publish message OK

Error Response

Condition : If apikey is wrong.

Code : 403 FORBIDDEN

Content :

{
"message": "Invalid authentication credentials"
}