Skip to content

admin get_posts.json

Timothy Duffy edited this page Mar 8, 2015 · 2 revisions

###admin/get_posts.json###

All admin api's require a token to be passed in. See get_access_token.json for more information.

admin/get_posts.json?token=238236fa-0e1a-499c-8051-c46e2f416387&start=<start_index>&count=<count>&deleted=<deleted>

There are three optional fields:

[ OPTIONAL ]
start
    Start allows you to set a starting index for the responses.  This is 
    useful for paging.
    Note: If start is not specified, then it defaults to 0.

[ OPTIONAL ]
count
    Count allows you to set the number of responses to return.  This is 
    useful for paging.
    Note: If count is not specified, then it defaults to 50.

[ OPTIONAL ]
deleted
    This will return only the deleted posts if set to a non-zero int.  If 
    omitted or set to 0, 
    posts that are not deleted will be returned.

Example response:

{
    "posts": [
        {
            "deleted": false,
            "verified_user": false,
            "post_id": 3,
            "client_id": "c844debc-7671-4226-aada-b8b4bf58040b",
            "language_code": "en",
            "lat": 43.1,
            "lng": -77.5,
            "post_datetime": "2015-01-07 15:19:27.223430",
            "media_objects": [
                {
                    "media_id": "80774262-6cc7-4697-b852-95ea2d05dfdd",
                    "file_name": "4c1c23ab-d989-49fc-af1a-594a38cc1339.jpg",
                    "preview_file_name": "4c1c23ab-d989-49fc-af1a-594a38cc1339p.jpg",
                    "media_text": "I saw a policeman help walk an old lady accross the street today.",
                    "caption": "",
                    "media_type_description": "Text.",
                    "media_type_name": "text"
                }
            ],
            "user_id": 2,
            "title": "",
            "assignment_id": null,
            "assignment_name": null,
            "language_name": "English"
        },
        {
            "deleted": false,
            "verified_user": false,
            "post_id": 2,
            "client_id": "120ce16c-4d52-48e4-8f7a-11e8ee49879c",
            "language_code": "en",
            "lat": 43.1,
            "lng": -77.5,
            "post_datetime": "2015-01-07 15:19:26.948721",
            "media_objects": [
                {
                    "media_id": "d4d8a1d7-92c4-425d-b722-a21b95537295",
                    "file_name": "4c1c23ab-d989-49fc-af1a-594a38cc1339.jpg",
                    "preview_file_name": "4c1c23ab-d989-49fc-af1a-594a38cc1339p.jpg",
                    "media_text": "Going out to Da CLUB!!!",
                    "caption": "",
                    "media_type_description": "Text.",
                    "media_type_name": "text"
                }
            ],
            "user_id": 3,
            "title": "",
            "assignment_id": 1,
            "assignment_name": "What are you doing for new years?",
            "language_name": "English"
        },
        {
            "deleted": false,
            "verified_user": false,
            "post_id": 1,
            "client_id": "c844debc-7671-4226-aada-b8b4bf58040b",
            "language_code": "en",
            "lat": 43.1,
            "lng": -77.5,
            "post_datetime": "2015-01-07 15:19:26.665846",
            "media_objects": [
                {
                    "media_id": "668ad40c-1c39-41b1-baf5-5cb9e3c5f64f",
                    "file_name": "4c1c23ab-d989-49fc-af1a-594a38cc1339.jpg",
                    "preview_file_name": "4c1c23ab-d989-49fc-af1a-594a38cc1339p.jpg",
                    "media_text": "Hopefully staying awake long enough to see the ball drop ... :/",
                    "caption": "",
                    "media_type_description": "Text.",
                    "media_type_name": "text"
                }
            ],
            "user_id": 2,
            "title": "",
            "assignment_id": 1,
            "assignment_name": "What are you doing for new years?",
            "language_name": "English"
        }
    ],
    "success": true
}

There are two different errors that can come back:

{
    "error_text": "Invalid auth token.",
    "success": false
}

{
    "error_text": "Missing 'token' field in request.",
    "success": false
}

The file_name and preview_file_name fields are used in this manor:

http://<root_domain>/media/<file_name>

- and -

http://<root_domain>/media/<preview_file_name>
Clone this wiki locally