Posts End Point

All endpoints are only available over https and will need an auth token to be accessible.

/posts/ is available from the root endpoint https://api.getgrandstand.com/v1/ An authorized GET request will return a response similar to the following:

Default Response:

  {
    "links": {
        "first": "https://api.getgrandstand.com/v1/posts/",
        "last": null,
        "next": "https://api.getgrandstand.com/v1/posts/?cursor=cD0yMDE3LTA1LTA0KzIwJTNBNDYlM0EyMCUyQjAwJTNBMDA%3D",
        "prev": "https://api.getgrandstand.com/v1/posts/?cursor=cj0xJnA9MjAxNy0wNS0wNCsyMCUzQTQ3JTNBMjMlMkIwMCUzQTAw"
    },
    "data":[
       {
          "type":"post",
          "id":"123456",
          "attributes":{
             "created":"2016-12-08T22:31:12.619078Z",
             "modified":"2016-12-08T22:31:13.279052Z",
             "tags":[],
             "platform_id":"1463377403709011_1463398863706865",
             "time":"2016-12-08T22:30:35Z",
             "platform":"facebook",
             "text":"This is an example text message.",
             "link":"https://facebook.com/1463377445709011_1463399993706899",
             "media":[
                {
                   "type":"photo",
                   "src":"https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/15319285_1594299243917371_4935397297022536972_n.jpg?oh=0c4dca42e9d99828b24d7049c3eeb8f0&oe=58B8EE3A"
                }
             ],
             "author_picture":"https://graph.facebook.com/1336691299991630/picture",
             "author_id":"11223344556677",
             "author_influence":99,
             "author_handle":"ISL DEV",
             "hashtags":[],
             "mentions":[],
             "moderation_status":null,
             "character_count":60
          },
          "relationships":{
             "campaign":{
                "data":{
                   "type":"Campaign",
                   "id":"55"
                }
             },
             "pipeline":{
                "data":{
                   "type":"Pipeline",
                   "id":"78"
                }
             }
          }
       }
    ],
    "meta": {
        "pagination": {
            "page": null,
            "count": 10
        }
    }
}

Properties

Data

list

The data is key contains a list of all the post information.

Name Type Description
type string The type of object being returned. Default is posts
id string The post’s ID on Grandstand
attributes object All information on the post
relationships object The related information for the post, its campaign and pipeline

Attributes

dictionary

The fields related to the post collected from Grandstand on the platform’s API. By default, not all fields are returned when you make a query. You can choose the fields you want returned with the fields query parameter.

Name Type Description
created string The date as a string the post was saved on Grandstand platform
modified string The date as a string for the date the post was last modified on Grandstand platform string The platform for a post
tags list A list of strings. These are labels added a post from the Grandstand admin
platform_id string The post’s ID on a given platform
time string The time the post was made on a given a platform
platform: string The platform of a the posts twitter, facebook, instagram
data object The raw response data from the given platforms api related to this post.
text string The text from the post
link string A link to the post on the given platform
media: list A list of objects that contain any media attached to a post. Read more
author_picture string A url to the author’s profile image on the given platform
author_id string The authors id on the a platform
author_influence int A calculated number to represent the author’s capable influence
author_handle string The author’s name or handle on a platform
hashtags list A list of strings of the hashtags added to a post
mentions list A list of strings of users’ mentions on a post
moderation_status: boolean A boolean representing if a post has been approved for display Default true
character_count int The number of characters in the text of a post

Links

dictionary

The links key contains a dictionary of all pagination links

Meta

dictionary

The meta key contains a dictionary of all meta information

Selecting attributes fields

Add the query parameter fields to select the fields you want to return from attributes. This can be used to return fields that are not returned by default or just limit the number of fields to make your query more efficient. fields=all can also be used to return all the fields.

Example

curl https://api.getgrandstand.com/v1/posts/?fields=platform,data

Response

{
    "links": {
        "first": "http://localhost:11000/api/v1/posts/?fields=platform%2Cdata",
        "last": null,
        "next": "http://localhost:11000/api/v1/posts/?cursor=cD0yMDE3LTA1LTEyKzE4JTNBMjMlM0EyMSUyQjAwJTNBMDA%3D&fields=platform%2Cdata",
        "prev": null
    },
    "data": [
        {
            "type": "post",
            "id": "3311",
            "attributes": {
                "platform": "facebook",
                "data": {
                    "id": "16408876059357989_16409159548487",
                    "from": {
                        "id": "7929396234202424",
                        "name": "John Doe"
                    },
                    "message": "This is an example message",
                    "created_time": "2017-02-10T18:26:22+0000"
                }
            }
        },
        {
            "type": "post",
            "id": "3312",
            "attributes": {
                  "platform": "facebook",
                   "data":{
                      "id":"1463377445709011_1463399993706899",
                      "created_time":"2016-12-08T22:30:35+0000",
                      "from":{
                         "id":"11223344556677",
                         "name":"ISL DEV"
                      },
                      "message":"This is an example message with photo.",
                      "attachment":{
                         "target":{
                            "id":"1594299243917371",
                            "url":"https://www.facebook.com/photo.php?fbid=1594299243917371&set=p.1594299243917371&type=3"
                         },
                         "media":{
                            "image":{
                               "width":396,
                               "height":720,
                               "src":"https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/15319285_1594299243917371_4935397297022536972_n.jpg?oh=0c4dca42e9d99828b24d7049c3eeb8f0&oe=58B8EE3A"
                            }
                         },
                         "type":"photo",
                         "url":"https://www.facebook.com/photo.php?fbid=1594299243917371&set=p.1594299243917371&type=3"
                      }
                   }
            }
        }
    ],
    "meta": {
        "pagination": {
            "page": 1,
            "count": 2
        }
    }
}