{"__v":1,"_id":"555fa194d7777119003ad000","category":{"__v":3,"_id":"555fa040d7777119003acffd","pages":["555fa194d7777119003ad000","555fa2e5d7777119003ad008","555fa3abd7777119003ad00d"],"project":"555f9bf814d68e0d00966587","version":"555f9bf814d68e0d0096658a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-22T21:31:44.995Z","from_sync":false,"order":1,"slug":"message","title":"Message"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"555f9bf814d68e0d00966587","user":"555f9a010758330d000d531a","version":{"__v":9,"_id":"555f9bf814d68e0d0096658a","project":"555f9bf814d68e0d00966587","createdAt":"2015-05-22T21:13:28.470Z","releaseDate":"2015-05-22T21:13:28.470Z","categories":["555f9bf814d68e0d0096658b","555f9e9ed7777119003acfee","555fa040d7777119003acffd","555fa344d7777119003ad00b","555fa3e6d7777119003ad00f","555fb694336c041700a9b86e","555fb779336c041700a9b86f","555fb86bd7777119003ad039","555fbf1a336c041700a9b87f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["5726460c87539a0e00062acd"],"next":{"pages":[],"description":""},"createdAt":"2015-05-22T21:37:24.909Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"data = {\n  'message': 'FIRE! FIRE! I\\'d love some help.', \n  'level': 5, \n  'secret': 'd2d1820d56b862a6f5b1a69a7af730fa',\n}\n\nresp = requests.post('https://api.pushjet.io/message', data=data).json()","language":"python"},{"code":"package main\n\nimport (\n\tpushjet \"github.com/geir54/goPushJet\" // 3rd party library\n)\n\nfunc main() {\n\terr := pushjet.SendMessage(\n    \"d2d1820d56b862a6f5b1a69a7af730fa\", \n    \"Test msg\", \n    \"FIRE! FIRE! I\\'d love some help.\", \n     5, \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}","language":"go"}]},"method":"post","results":{"codes":[{"name":"","code":"{\n\t'status': 'ok'\n}","language":"json","status":200},{"code":"{\n \t'error': {\n    'id': 6,\n   \t'message': 'Service not found',\n  }\n}","language":"json","status":404}]},"settings":"","auth":"required","params":[{"_id":"555fa194d7777119003ad005","ref":"","in":"body","required":true,"desc":"The service secret token","default":"d2d1820d56b862a6f5b1a69a7af730fa","type":"string","name":"secret"},{"_id":"555fa194d7777119003ad004","ref":"","in":"body","required":true,"desc":"The notification text","default":"Your server is on fire!!:::at:::#!","type":"string","name":"message"},{"_id":"555fa194d7777119003ad003","ref":"","in":"body","required":false,"desc":"A custom message title","default":"Big server #5","type":"string","name":"title"},{"_id":"555fa194d7777119003ad002","ref":"","in":"body","required":false,"desc":"The importance level from 1(low) to 5(high)","default":"3","type":"int","name":"level"},{"_id":"555fa194d7777119003ad001","ref":"","in":"body","required":false,"desc":"An optional link","default":"http://i.imgur.com/TerUkQY.gif","type":"string","name":"link"}],"url":"/message"},"isReference":false,"order":0,"body":"Used to send messages to all the devices that are subscribed to the service the message is sent from. Upon receiving reading confirmations from all the target devices the message will be deleted.","excerpt":"","slug":"send-a-message","type":"endpoint","title":"Send a message"}

postSend a message


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

secret:
required
stringd2d1820d56b862a6f5b1a69a7af730fa
The service secret token
message:
required
stringYour server is on fire!!@#!
The notification text
title:
stringBig server #5
A custom message title
level:
integer3
The importance level from 1(low) to 5(high)
link:
stringhttp://i.imgur.com/TerUkQY.gif
An optional link

Examples


Result Format


Documentation

Used to send messages to all the devices that are subscribed to the service the message is sent from. Upon receiving reading confirmations from all the target devices the message will be deleted.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}