ForoElectro.Net MQTT API
Publish a MQTT message API:
URL:
https://www.foroelectro.net/arduino/api/<ApiKey>/mqtt/publish
http://www.foroelectro.net/arduino/api/<ApiKey>/mqtt/publish
Parameters:
All parameters can be passed in any method (GET, POST, etc).
- message - Message to send.
- client - Optional. Client name. ForoElectroNetAPI by default
- topic - Optional. Topic suffix (remember that your ApiKey is the topic prefix)
- f - Optional. Output format. If you add f=json response will be JSON; in any other case output will be plain text.
Return:
Text mode:
- 1 - Everything has worked properly.
- 0|<error> - Error. Short description after a '|' symbol.
JSON mode:
{- "result": 1 when everything has worked properly. 0 when any error
- "error": Only exists when result is 0; error short description.
Review a MQTT messages API:
URL:
https://www.foroelectro.net/arduino/api/<ApiKey>/mqtt/get
http://www.foroelectro.net/arduino/api/<ApiKey>/mqtt/get
Parameters:
All parameters can be passed in any method (GET, POST, etc).
- wait - Optional. Timeot in seconds if there're no new messages.
- last - Optional. Numeric Id of already read message.
Return:
Output format is always JSON:
{- "result": 1 when everything has worked properly. 0 when any error
- "error": Only exists when result is 0; error short description.
-
"data": Only when result is 1; messages array: [
- {
-
- "utime": Message's UNIX timestamp.
- "payload": Message.
- "topic": Message's complete topic.
- }
Before using MQTT API:
First you have to create an Application. You will need 2 fields: Name and email. After this you get an ApiKey.
How to get an ApiKey?
To create your ApiKey 2 fields are required: Name and email.
You can use API with your ApiKey or login in this site using also your email to view your data.
Yoiu can create as much applications as youn want with same email, each one will have its own ApiKey.
You can change email or Application, your ApiKey will not change.