Expo

A RESTful API for interacting with Expo.

Base URL

https://flock-api.pollygot.com/v1/expo/...?apiKey=YOUR_API_KEY

Config

Every Expo request requires the following config:

// POST 
// Content-Type: application/json
{
  "config": { 
    // No config required!
  },
  "payload": { 
    // Function specific payload
  }
}

Send single Push Notification

To send a single Push Notification, ensure that the "to" inside "payload" is a single string.

// POST https://flock-api.pollygot.com/v1/expo/sms/send?apiKey=YOUR_API_KEY
// Content-Type: application/json
{
  "config": { 
    // Expo config
  },
  "payload": { 
    // Required
    "to": "ExponentPushToken[...]",          // {string} An Expo push token specifying the recipient of this message.

    // Optional
    "data": {},           // {object}? A JSON object delivered to your app.
    "title": "...",       // {string}? The title to display in the notification.
    "body": "...",        // {string}? The message to display in the notification
    "ttl": "...",         // {number}? Time to Live: the number of seconds for which the message may be kept around for redelivery if it hasn't been delivered yet.
    "expiration": "...",  // {number}? A timestamp since the UNIX epoch specifying when the message expires.
    "priority": "...",    // {'default' | 'normal' | 'high'}? The delivery priority of the message.

    // iOS-specific fields
    "badge": 0,           // {number}? Number to display in the badge on the app icon. Specify zero to clear the badge.
    "sound": "...",       // {'default' | null}? A sound to play when the recipient receives this notification.

    // Android-specific fields
    "channelId": "...",    // {string}? The message to display in the notification
  }
}

Send batch Push Notification

To send the same Push Notification to multiple users, ensure that the "to" inside "expo" is an array of strings.

// POST https://flock-api.pollygot.com/v1/nexmo/sms/send?apiKey=YOUR_API_KEY
// Content-Type: application/json
{
  "config": { 
    // Expo config
  },
  "payload": 
    { 
      "to": ["ExponentPushToken[...]", "ExponentPushToken[...]"], 
      "body": "Hello world!" 
    }
}