iBeacon REST Documentation

Last updated: Nov 12th, 2016

Getting Started

This documentation is about covering every feature of iBeacon services for developer in great detail. There are several iBeacon management REST API that lets you interact with Mesosfer Backend as a Service. Mesosfer provide several iBeacon implementations such as: Presence, Tagging, Retail, Microlocation, Smart Office, etc. For more information about Mesosfer and the other features, see Mesosfer Website.

Managing Beacon

You can manage iBeacon devices in Mesosfer Backend as a Service. As we know that iBeacon broadcast payload data such as: UUID, major and minor. Beside iBeacon data, Mesosfer also allows you to store dynamic object metadata. With this, you will be able to store the coordinates of the position, simple notification, etc.

Retrieve all Beacon

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/beacons

GET https://api.mesosfer.com/api/v2/beacons
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Retrieve all Beacon Body Response

{
  "results": [
    {
      "name": "CB-3",
      "createdAt": "2016-11-11T14:40:12.771Z",
      "major": 10,
      "minor": 20,
      "metadata": {},
      "objectId": "9nKZ5k8FJw",
      "updatedAt": "2016-11-11T14:40:12.771Z",
      "uuid": "CB10023F-A318-3394-4199-A8730C7C1AEC"
    },
    {
      "name": "CB-2",
      "createdAt": "2016-11-10T15:00:09.004Z",
      "major": 70,
      "minor": 20,
      "metadata": {},
      "objectId": "AWF1gAOgoo",
      "updatedAt": "2016-11-10T15:00:09.004Z",
      "uuid": "CB10023F-A318-3394-4199-A8730C7C1AEC"
    },
    {
      "name": "CB-1",
      "createdAt": "2016-11-10T14:52:29.609Z",
      "major": 69,
      "minor": 20,
      "metadata": {},
      "objectId": "YV2OAPmwFa",
      "updatedAt": "2016-11-10T14:52:53.598Z",
      "uuid": "CB10023F-A318-3394-4199-A8730C7C1AEC"
    }
  ]
}

Create a Beacon Example

curl -X POST -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"name":"Beacon-1", "uuid": "CB10023F-A318-3394-4199-A8730C7C1AEC", "major": 10, "minor": 20, "metadata":{"alertTitle":"Hi", "alertMessage":"Thanks for coming."}}' \
https://api.mesosfer.com/api/v2/beacons


POST https://api.mesosfer.com/api/v2/beacons
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
Content-Type Yes String application/json
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Contents
Name Required Type Description
name Yes String The name of beacon. Length must be between 1 and 50.
uuid Yes String The Unique ID of beacon. Length must be between 1 and 50.
major Yes Number The Major ID of beacon.
minor Yes Number The Minor ID of beacon.
location No Object The Coordniate of beacon that installed.
metadata No Object Custom data that can use for simple impelementation, such as greeting, notification, etc.
Create Beacon Body Response Example

{
  "result": {
    "createdAt": "2016-11-12T06:39:24.372Z",
    "objectId": "Oqe0hl39JW"
  }
}

Retrieve a Beacon

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/beacons/{objectId}

GET https://api.mesosfer.com/api/v2/beacons/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String Beacon objectId
Retrieve a Beacon Body Response

{
  "result": {
    "name": "Beacon-1",
    "createdAt": "2016-11-12T06:39:24.372Z",
    "major": 10,
    "metadata": {
      "alertMessage": "Thanks for coming.",
      "alertTitle": "Hi"
    },
    "minor": 20,
    "objectId": "Oqe0hl39JW",
    "updatedAt": "2016-11-12T06:40:11.140Z",
    "uuid": "CB10023F-A318-3394-4199-A8730C7C1AEC"
  }
}

Response
Name Description
objectId Generate automatically from system
name The name of beacon
uuid The unique ID of beacon
major The major ID of beacon
minor The minor ID of beacon
metadata Custom data that can use for simple impelementation, such as greeting, notification, etc
createdAt Object created in ISO Format
updatedAt Object updated in ISO Format
Update a Beacon

curl -X PUT -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"name":"Beacon-1", "uuid": "CB10023F-A318-3394-4199-A8730C7C1AEC", "major": 100, "minor": 200, "location":{"x":20.2, "y":30.2}, "metadata":{"alertTitle":"Hi", "alertMessage":"Bye.."}}' \
https://api.mesosfer.com/api/v2/beacons/{objectId}

PUT https://api.mesosfer.com/api/v2/beacons/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the beacon.
Update a Beacon Body Response

{
  "result": {
    "updatedAt": "2016-11-12T08:22:20.091Z"
  }
}

Delete a Beacon

curl -X DELETE -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
https://api.mesosfer.com/api/v2/beacons/{objectId}

DELETE https://api.mesosfer.com/api/v2/beacons/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the beacon.
Delete a Beacon Body Response

{
  "result": {}
}

Module Presence

Optimizing employees attendance in a company in an easy way. Getting a real time result of a presence and collect analysis of company’s productivity. Mesosfer provides metadata and SDK to implement module presence. This module is divided in two sub modules: notification and log. Notification is a trigger for push notification when end user pass the beacon. Available in short messages, image pop up, and video play. Log is a data storage for end user activity such as in/out the area.

Retrieve all Notification

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/notifications

GET https://api.mesosfer.com/api/v2/notifications
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Retrieve all Notification Body Response

{
  "results": [
    {
      "beaconId": {
        "__type": "Pointer",
        "className": "Beacon",
        "objectId": "YV2OAPmwFa"
      },
      "createdAt": "2016-11-11T02:07:35.142Z",
      "event": "EXIT",
      "message": {
        "alertTitle": "Thanks",
        "alertMessage": "Thanks for coming"
      },
      "description": "Goodbye",
      "objectId": "wNslRS4qtl",
      "isEnabled": true,
      "type": "TEXT",
      "updatedAt": "2016-11-11T14:33:24.827Z"
    },
    {
      "beaconId": {
        "__type": "Pointer",
        "className": "Beacon",
        "objectId": "AWF1gAOgoo"
      },
      "createdAt": "2016-11-10T14:59:13.403Z",
      "event": "ENTER",
      "message": {"url":"http://example.com/image.png"},
      "description": "Greeting",
      "objectId": "H0X8UG3Sl9",
      "isEnabled": true,
      "type": "IMAGE",
      "updatedAt": "2016-11-11T02:08:02.645Z"
    }
  ]
}

Create a Notification

curl -X POST -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"description":"Greeting", "beaconId": { "__type":"Pointer", "className":"Beacon", "objectId":"9nKZ5k8FJw" }, "event": "ENTER", "type":"IMAGE", "message": {"url": "http://example.com/image.png"}, "isEnabled":true }' \
https://api.mesosfer.com/api/v2/notifications


POST https://api.mesosfer.com/api/v2/notifications
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
Content-Type Yes String application/json
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Contents
Name Required Type Description
description Yes String The name of notification. Length must be between 1 and 50.
beaconId Yes Pointer Reference object id of beacon. Must be valid objectId that was inserted on bucket Beacon.
event Yes String Event trigger beacon : ENTER (entering radius beacon), EXIT (exiting radius beacon), IMMEDIATE (entering less than 1 meter radius beacon), NEAR (entering between 1 until 3 meters radius beacon), FAR (entering greater than 3 meters)
type Yes String Type of notification : IMAGE, VIDEO, and TEXT.
message Yes Object Notification detail, if you choose video or image at notification type, message data will be filled url file.
isEnabled Yes Boolean status active/inactive for this notification. If you want to disable this notification just switch false.
Create Notification Body Response Example

{
  "result": {
    "createdAt": "2016-11-12T09:37:22.574Z",
    "objectId": "1GWGfVcqh6"
  }
}

Retrieve a Notification

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/notifications/{objectId}

GET https://api.mesosfer.com/api/v2/notifications/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String Notification objectId
Retrieve a Notification Body Response

{
  "result": {
    "beaconId": {
      "__type": "Pointer",
      "className": "Beacon",
      "objectId": "9nKZ5k8FJw"
    },
    "createdAt": "2016-11-12T09:37:22.574Z",
    "event": "ENTER",
    "message": {
      "url": "http://example.com/image.png"
    },
    "description": "Greeting",
    "objectId": "1GWGfVcqh6",
    "isEnabled": true,
    "type": "IMAGE",
    "updatedAt": "2016-11-12T09:37:22.574Z"
  }
}

Update a Notification

curl -X PUT -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"name":"Greeting", "beaconId": { "__type":"Pointer", "className":"Beacon", "objectId":"9nKZ5k8FJw" }, "event": "EXIT", "type":"TEXT", "message": {"alertTitle": "Good Bye.", "alertMessage":"Thanks for coming."}, "isEnabled":true }' \
https://api.mesosfer.com/api/v2/notifications/{objectId}

PUT https://api.mesosfer.com/api/v2/notifications/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Notification.
Update a Notification Body Response

{
  "result": {
    "updatedAt": "2016-11-12T12:37:17.071Z"
  }
}

Delete a Notification

curl -X DELETE -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
https://api.mesosfer.com/api/v2/notifications/{objectId}

DELETE https://api.mesosfer.com/api/v2/notifications/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Notification.
Delete a Notification Body Response

{
  "result": {}
}

Retrieve Presence Logs

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-G \
--data-urlencode 'where={"moduleType":"PRESENCE"}' \
https://api.mesosfer.com/api/v2/logs

GET https://api.mesosfer.com/api/v2/logs
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Retrieve Presence Logs Body Response

{
  "results": [
    {
        "beaconId":{
            "__type":"Pointer",
            "className":"Beacon",
            "objectId":"sGwuqbrcwS"
        },
        "createdAt":"2016-12-28T07:07:54.942Z",
        "event":"EXIT",
        "installationId":{
            "__type":"Pointer",
            "className":"_Installation",
            "objectId":"CNtyvfajpv"
        },
        "objectId":"umACtFj52h",
        "updatedAt":"2016-12-28T07:07:54.942Z"
    },
    {
        "beaconId":{
            "__type":"Pointer",
            "className":"Beacon",
            "objectId":"sGwuqbrcwS"
        },
        "createdAt":"2016-12-28T07:07:14.723Z",
        "event":"ENTER",
        "installationId":{
            "__type":"Pointer",
            "className":"_Installation",
            "objectId":"CNtyvfajpv"
        },
        "objectId":"N3qIk0qk5G",
        "updatedAt":"2016-12-28T07:07:14.723Z"
    }
  ]
}

Module Storyline

The goal of an advertisement is to make our products known by others. High quality advertising mostly depends on content and methods. Users do not need to think about them. Mesosfer provide module that allow user to create scenario for smart advertising or loyalty customer based on iBeacon technology. Mesosfer can send notification. Notification is a trigger for push notification when end user pass the iBeacon devices. Available in short messages, image pop up, and video play and url site. Storyline divide by two parts : storyline header and storyline detail. Each storyline header you can create many scenario items in storyline detail such as when customer near, enter, or exit in your iBeacon hardware.

Retrieve Storyline Header

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/storylines

GET https://api.mesosfer.com/api/v2/storylines
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Retrieve Storyline Header Body Response

{
  "results": [
    {
      "createdAt": "2016-12-14T08:06:45.413Z",
      "isEnabled": false,
      "objectId": "AE18wWRrFn",
      "title": "Attendance",
      "updatedAt": "2016-12-21T02:29:03.684Z"
    }
  ]
}

Create Storyline Header

curl -X POST -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"title":"National Discovery Forum", "isEnabled":true}' \
https://api.mesosfer.com/api/v2/storylines

POST https://api.mesosfer.com/api/v2/storylines
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
Content-Type Yes String application/json
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Contents
Name Required Type Description
title Yes String The title of storyline. Length must be between 1 and 50.
isEnabled Yes Boolean status active/inactive for this storyline. If you want to disable this storyline just switch false.
Create Notification Body Response Example

{
  "result": {
    "createdAt": "2016-12-30T07:23:43.510Z",
    "objectId": "Iw4WSAYvxf"
  }
}

Retrieve a Storyline Header

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/storylines/{objectId}

GET https://api.mesosfer.com/api/v2/storylines/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String Storyline Header objectId
Retrieve a Storyline Header Body Response

{
    "result":{
        "createdAt":"2016-12-30T07:23:43.510Z",
        "isEnabled":true,
        "objectId":"Iw4WSAYvxf",
        "title":"National Discovery Forum",
        "updatedAt":"2016-12-30T07:23:43.510Z"
    }
}

Update Storyline Header

curl -X PUT -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"title":"National Discovery Forum III 2016", "isEnabled":true}' \
https://api.mesosfer.com/api/v2/storylines/{objectId}

PUT https://api.mesosfer.com/api/v2/storylines/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Storyline.
Update Storyline Header Body Response

{
  "result": {
    "updatedAt": "2016-12-30T07:33:17.200Z"
  }
}

Delete Storyline Header

curl -X DELETE -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
https://api.mesosfer.com/api/v2/storylines/{objectId}

DELETE https://api.mesosfer.com/api/v2/storylines/{objectId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Storyline Header.
Delete Storyline Header Body Response

{
  "result": {}
}

Retrieve Storyline Detail

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/storylines/{objectId}/detail

GET https://api.mesosfer.com/api/v2/storylines/{objectId}/detail
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Storyline Header.
Retrieve Storyline Detail Body Response

{
    "results":[{
        "alertMessage":"Open this image campaign now?",
        "alertTitle":"Image Campaign",
        "beacons":[
            "sGwuqbrcwS"
        ],
        "campaign":"IMAGE",
        "createdAt":"2016-12-24T02:50:00.298Z",
        "event":"IMMEDIATE",
        "objectId":"CF7KAKshs5",
        "showOn":[
            {
            "checked":false,
            "dayName":"Fri"
            },
            {
            "checked":false,
            "dayName":"Tue"
            },
            {
            "checked":false,
            "dayName":"Mon"
            },
            {
            "checked":false,
            "dayName":"Sun"
            },
            {
            "checked":false,
            "dayName":"Wed"
            },
            {
            "checked":false,
            "dayName":"Thu"
            },
            {
            "checked":true,
            "dayName":"Sat"
            }],
        "updatedAt":"2016-12-24T03:06:16.967Z",
        "urlImageAndroid":"https://mesosfer.com",
        "urlImageIOS":"https://cubeacon.com",
        "urlPage":"http://lenscoop.com",
        "urlVideo":"https://youtube.com"
    },
    {
        "alertMessage":"You are already checked in at 7.35 o'clock, such a great morning. We hope today will be a great day for you!",
        "alertTitle":"Check In",
        "beacons":[
            "sGwuqbrcwS"
        ],
        "campaign":"TEXT",
        "createdAt":"2016-12-17T06:40:39.909Z",
        "event":"ENTER",
        "objectId":"vyDZzx7ZVC",
        "showOn":[
            {
            "checked":true,
            "dayName":"Sun"
            },
            {
            "checked":true,
            "dayName":"Mon"
            },
            {
            "checked":true,
            "dayName":"Tue"
            },
            {
            "checked":true,
            "dayName":"Wed"
            },
            {
            "checked":true,
            "dayName":"Thu"
            },
            {
            "checked":true,
            "dayName":"Fri"
            },
            {
            "checked":true,
            "dayName":"Sat"
            }
        ],
        "updatedAt":"2016-12-21T05:29:29.374Z",
        "urlImageAndroid":"https://s-media-cache-ak0.pinimg.com/736x/c6/9b/de/c69bde5b055631a36693acf4c5c82f9a.jpg",
        "urlImageIOS":"https://s-media-cache-ak0.pinimg.com/736x/c6/9b/de/c69bde5b055631a36693acf4c5c82f9a.jpg",
        "urlPage":"https://s-media-cache-ak0.pinimg.com/736x/c6/9b/de/c69bde5b055631a36693acf4c5c82f9a.jpg",
        "urlVideo":"https://s-media-cache-ak0.pinimg.com/736x/c6/9b/de/c69bde5b055631a36693acf4c5c82f9a.jpg"
    }]
}

Create Storyline Detail

curl -X POST -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"beacons":["sGwuqbrcwS"],"campaign":"IMAGE","event":"ENTER","showOn":[{"checked":false,"dayName":"Fri"},{"checked":false,"dayName":"Tue"},{"checked":false,"dayName":"Mon"},{"checked":false,"dayName":"Sun"},{"checked":false,"dayName":"Wed"},{"checked":false,"dayName":"Thu"},{"checked":true,"dayName":"Sat"}],"urlImageAndroid":"https://mesosfer.com","urlImageIOS":"https://cubeacon.com","urlPage":"http://lenscoop.com","urlVideo":"https://youtube.com"}' \
https://api.mesosfer.com/api/v2/storylines/{objectId}/detail

POST https://api.mesosfer.com/api/v2/storylines/{objectId}/detail
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
Content-Type Yes String application/json
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Storyline Header.
Contents
Name Required Type Description
beacons Yes Array of String beacons that set for this scenario, it contains array of objectId beacons.
campaign Yes String campaign is type of notification that send to customer. type of campaign that allowed are TEXT, URL, IMAGE, and VIDEO.
event Yes String event is type of triggered beacon from smartphone. type of event that allowed are ENTER, EXIT, IMMEDIATE, NEAR, and FAR.
showOn Yes Array of Object showOn is daily schedule management, so user can set scenario will run weekend or weekdays.
urlImageAndroid No String urlImageAndroid is field that save string url image for android resolution.
urlImageIOS No String urlImageIOS is field that save string url image for ios resolution.
urlPage No String urlPage is field that save string url if user want to show url site.
urlVideo No String urlVideo is field that save string url if user want to send video as notification.
Create Storyline Detail Body Response Example

{
  "result": {
    "createdAt": "2016-12-30T15:24:07.327Z",
    "objectId": "xtr4QpNCi0"
  }
}

Retrieve a Storyline Detail

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
https://api.mesosfer.com/api/v2/storylines/{objectId}/detail/{detailId}

GET https://api.mesosfer.com/api/v2/storylines/{objectId}/detail/{detailId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String Storyline Header objectId
detailId Yes String Storyline Detail objectId
Retrieve a Storyline Detail Body Response

{
    "result":{
    "beacons":[
        "sGwuqbrcwS"
    ],
    "campaign":"IMAGE",
    "createdAt":"2016-12-30T15:24:07.327Z",
    "event":"ENTER",
    "objectId":"xtr4QpNCi0",
    "showOn":[
        {
        "checked":false,
        "dayName":"Fri"
        },
        {
        "checked":false,
        "dayName":"Tue"
        },
        {
        "checked":false,
        "dayName":"Mon"
        },
        {
        "checked":false,
        "dayName":"Sun"
        },
        {
        "checked":false,
        "dayName":"Wed"
        },
        {
        "checked":false,
        "dayName":"Thu"
        },
        {
        "checked":true,
        "dayName":"Sat"
        }
    ],
    "updatedAt":"2016-12-30T15:24:07.327Z",
    "urlImageAndroid":"https://mesosfer.com",
    "urlImageIOS":"https://cubeacon.com",
    "urlPage":"http://lenscoop.com",
    "urlVideo":"https://youtube.com"
    }
}

Update Storyline Detail

curl -X PUT -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
-d '{"beacons":["sGwuqbrcwS"],"campaign":"VIDEO","event":"EXIT","showOn":[{"checked":false,"dayName":"Fri"},{"checked":false,"dayName":"Tue"},{"checked":false,"dayName":"Mon"},{"checked":false,"dayName":"Sun"},{"checked":false,"dayName":"Wed"},{"checked":false,"dayName":"Thu"},{"checked":true,"dayName":"Sat"}],"urlImageAndroid":"https://mesosfer.com","urlImageIOS":"https://cubeacon.com","urlPage":"http://lenscoop.com","urlVideo":"https://youtube.com"}' \
https://api.mesosfer.com/api/v2/storylines/{objectId}/detail/{detailId}

PUT https://api.mesosfer.com/api/v2/storylines/{objectId}/detail/{detailId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Storyline.
detailId Yes String Storyline Detail objectId
Update Storyline Header Body Response

{
  "result": {
    "updatedAt": "2016-12-31T02:56:50.473Z"
  }
}

Delete Storyline Detail

curl -X DELETE -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-H "Content-Type: application/json" \
https://api.mesosfer.com/api/v2/storylines/{objectId}/detail/{detailId}

DELETE https://api.mesosfer.com/api/v2/storylines/{objectId}/detail/{detailId}
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
URL Params
Name Required Type Description
objectId Yes String The object ID of the Storyline Header.
detailId Yes String Storyline Detail objectId
Delete Storyline Header Body Response

{
  "result": {}
}

Retrieve Storyline Logs

curl -X GET -H "Authorization: Bearer {accessToken}" \
-H "X-Mesosfer-AppId: {AppId}" \
-H "X-Mesosfer-AppKey: {AppKey}" \
-G \
--data-urlencode 'where={"moduleType":"STORYLINE"}' \
https://api.mesosfer.com/api/v2/logs

GET https://api.mesosfer.com/api/v2/logs
Headers
Name Required Type Value
Authorization Yes String Bearer {accessToken}
X-Mesosfer-AppId Yes String Get Application ID from cloud.mesosfer.com
X-Mesosfer-AppKey Yes String Get Application Key from cloud.mesosfer.com
Retrieve Storyline Logs Body Response

{
    "results":[{
        "beaconId":{
            "__type":"Pointer",
            "className":"Beacon",
            "objectId":"sGwuqbrcwS"
        },
        "createdAt":"2016-12-28T07:07:54.942Z",
        "event":"EXIT",
        "installationId":{
            "__type":"Pointer",
            "className":"_Installation",
            "objectId":"CNtyvfajpv"
        },
        "objectId":"umACtFj52h",
        "updatedAt":"2016-12-30T08:11:30.220Z"
    },
        {
        "beaconId":{
            "__type":"Pointer",
            "className":"Beacon",
            "objectId":"sGwuqbrcwS"
        },
        "createdAt":"2016-12-28T07:07:14.723Z",
        "event":"ENTER",
        "installationId":{
            "__type":"Pointer",
            "className":"_Installation",
            "objectId":"CNtyvfajpv"
        },
        "objectId":"N3qIk0qk5G",
        "updatedAt":"2016-12-30T08:11:33.091Z"
    }]
}