This article describes the various endpoints related to the Share-on-Mobile app type. Using the various endpoints you can export data related to a particular Share-on-Mobile campaign or all the Share-on-Mobile campaigns that you might have run.


Posts Endpoint


The Posts API endpoint allows you to export the posts / reviews made by users in a Share-on-Mobile campaign. Alternately, this endpoint can also be used to export the posts / reviews of users in all your Share-on-Mobile campaigns.


Type of Request : POST

Endpoint : /app/share-on-mobile/posts

Full URL : https://api.shopsocially.com/v2/app/share-on-mobile/posts


Request Parameters


The following table outlines the POST request parameters that you can use with this endpoint.


Parameter Value Description
campaign_id The campaign ID for the Share-on-Mobile campaign (Optional) The ID of the campaign for which you want to pull the data. If this parameter is not specified, then the data for all the Share-on-Mobile campaigns will be returned.
start_date Date in the format "yyyy-mm-ddTHH:MM:SSZ" in the UTC timezone (Optional) Signifies the date from which you want the data. This date is inclusive, that is, you will get the data for this date as well.
end_date

Date in the format "yyyy-mm-ddTHH:MM:SSZ" in the UTC timezone

(Optional) Signifies the date till which you want the data. This date is inclusive.


Response


On a successful request, this API returns the following JSON response containing a list of all the posts. The meaning of the various fields are included in the following response.


{

"success" : true,

"posts" : [

{

"user_first_name" : "<The first name of the user who made this post>",

"user_last_name" : "<The last name of the user who made this post>",

"user_facebook_profile" : "<The link to the facebook profile of the user>",

"user_photo" : "<The link to the photo of the user>",

"image" : "<The link to the image uploaded by the user>",

"user_comment" : "<The comment or review written by the user>",

"attached_link" : "<The link attached to this post>",

"date" : "<The date and time when this post was created in the format yyyy-mm-ddTHH:MM:SSZ in the UTC timezone>",

"rating" : <The rating selected by the user which will be a number from 0 to 5>

},

{

"user_first_name" : "<The first name of the user who made this post>",

"user_last_name" : "<The last name of the user who made this post>",

"user_facebook_profile" : "<The link to the facebook profile of the user>",

"user_photo" : "<The link to the photo of the user>",

"image" : "<The link to the photo uploaded by the user>",

"user_comment" : "<The comment or review written by the user>",

"attached_link" : "<The link attached to this post>",

"date" : "<The date and time when this post was created in the format yyyy-mm-ddTHH:MM:SSZ in the UTC timezone>",

"rating" : <The rating selected by the user which will be a number from 0 to 5>

}

]

}


 As you find above, all the posts will be a list in the posts field. 


Example


Below is a sample example of the API request should look and what the response looks like. We show the example using the command-line tool curl but you can use any programming language you want to consume the API.


An example request will look like this - 


curl --header "partner-id: <your-partner-id>" --header "api-key: <your-api-key>" --data "campaign_id=<your-campaign-id>" https://api.shopsocially.com/v2/app/share-on-mobile/posts


You can replace your partner ID, API key and campaign ID in the above request and run it from the command line to see the response. An example response will look as follows -


{

    "posts": [

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100001355152234/picture",

            "user_comment": "I got this from Utsav. Fabulous purchase. I simply love it.",

            "image": "http://dk2ew541lwp6s.cloudfront.net/f9b91c56fb4cca96726f28ddaf5d1075.png",

            "user_first_name": "Sheetal",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100001355152234",

            "user_last_name": "Jain",

            "date": "2013-09-14T14:07:12Z"

        },

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100001439824160/picture",

            "user_comment": "Love the colour of the sari. I wear it at least once a week. I use Utsav all the time.",

            "image": "http://dk2ew541lwp6s.cloudfront.net/77228facdbd29528d7b97bbbdc38cca1.png",

            "user_first_name": "Priya",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100001439824160",

            "user_last_name": "Ranjan",

            "date": "2013-09-14T14:11:40Z"

        },

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100000885956294/picture",

            "user_comment": "My dress is amazing. The color is vibrant. Everyone complimented me for it. Love Utsav Fashion.",

            "image": "http://dk2ew541lwp6s.cloudfront.net/9d16577bef97c47eb23508aac5a016ad.png",

            "user_first_name": "Stacy",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100000885956294",

            "user_last_name": "Eason",

            "date": "2013-09-14T14:31:42Z"

        },

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100000906206255/picture",

            "user_comment": "Loving this lehenga. Gorgeous look, great feeling. Thanks Utsav.",

            "image": "http://dk2ew541lwp6s.cloudfront.net/90e803f6e32c750d3ef2c43c21a21b91.png",

            "user_first_name": "Marianne",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100000906206255",

            "user_last_name": "Branch",

            "date": "2013-09-14T14:46:43Z"

        },

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100001439824160/picture",

            "user_comment": "I simply love it. Thanks Ustav :)",

            "image": "http://dk2ew541lwp6s.cloudfront.net/19562c073bee4808649c8c00b506a312.png",

            "user_first_name": "Priya",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100001439824160",

            "user_last_name": "Ranjan",

            "date": "2013-09-14T14:59:26Z"

        },

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100001355152234/picture",

            "user_comment": "I rarely wear a sari. I bought a sari for my sister’s wedding from Utsav. Everyone who looked at it could not stop raving about it.",

            "image": "http://s3.amazonaws.com/iphone-web-app/a4afb73b-f22b-4d3d-bfcc-6a817a01a4e1.png",

            "user_first_name": "Sheetal",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100001355152234",

            "user_last_name": "Jain",

            "date": "2013-09-16T12:35:19Z"

        },

        {

            "rating": 5,

            "user_photo": "http://graph.facebook.com/100001203949755/picture",

            "user_comment": "Wore this kurta to my friend’s wedding. The look is great. My friends loved it.",

            "image": "http://dk2ew541lwp6s.cloudfront.net/cdea6b3579c7505313b0d4424884c2b8.png",

            "user_first_name": "Sunil",

            "attached_link": "http://www.utsavfashion.com",

            "user_facebook_profile": "http://facebook.com/100001203949755",

            "user_last_name": "Chatri",

            "date": "2013-09-16T12:36:59Z"

        }

    ],

    "success": true

}




< Back to Main