Contents |
URL
https://api.geoloqi.com/1/message/broadcast
Description
Send a message to all users within a specific region. You can only broadcast messages to users who have opted in to one of your layers. Messages will be delivered to users using the cheapest method available. If users have the iPhone app, messages will be delivered via Apple Push Notification, otherwise, they will receive an SMS.
Also see: message/count_broadcast.
Supported Request Methods
POST
Parameters
- layer_idThe layer ID to which your users have subscribed
- latitudeThe latitude of the center of the region you are broadcasting to
- longitudeThe longitude of the center of the region you are broadcasting to
- radiusThe radius of the region you are broadcasting to, given in meters
- textThe text of the message you would like to send. Must be 140 characters or less
Response
Success
If the message was queued successfully, you will get a response like the following, including the number of messages that were sent via push notification versus SMS.
HTTP/1.1 200 OK { "result":"ok", "total":35, "push":30, "sms":5 }
To count the number of people who will receive your broadcast before sending it, send the same post input to the message/count_broadcast method.
Errors
If there was a problem with the request, you will get a response with information about the error. This may look something like the following.
HTTP/1.1 403 Forbidden { "error":"access_denied", "error_description":"Access denied to this layer" }