send P2P

Description send P2P message

http://localhost:5000/freedata/messages

Parameters

  • destination - with/without SSID

  • body - plain text

Optional:

  • attachments - b64encode - {'name': 'test.gif','type': 'image/gif','data': 'base64encoded')}

Response

Example

curl -X post -H "Content-Type: application/json" -d'{"destination": "XX1XXX-6" ,"body": "Hello FreeDATA"}' http://localhost:5000/freedata/messages

{
   "destination":"XX1XXX-6",
   "body":"Hello FreeDATA"
}

curl -X post -H "Content-Type: application/json" -d'{"destination": "XX1XXX-6" ,"body": "Hello FreeDATA", "attachements": "R0lGODlhCgA....CwgAOw=="}' http://localhost:5000/freedata/messages

{
   "destination":"XX1XXX-6",
   "body":"Hello FreeDATA",
   "attachements": "R0lGODlhCgA....CwgAOw=="
}

Errors

This API uses the following error codes:

  • 400 Bad Request: The request was malformed or missing required parameters.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An unexpected error occurred on the server.
  • 503 Modem not running: Modem not running.
  • 503 Modem Busy: Modem Busy.