Get context data

Retrieve a JavaScript object of all the data you have stored for this user, including their name, time zone, whether they’re subscribed, and any custom data you have stored.

Endpoint

Endpoint HTTP Method
/user/v1/context_data GET

Parameters

Parameter Type Description In Required
accessToken String Webview access token Query True

Response

Code Description Returns
200 Success JavaScript object of stored user data.
400 Error  

Example

var shoeSize;
$.ajax({
    type: ‘GET’,
    url: ‘/user/v1/content_data?accessToken=’ + accessToken,
    contentType: ‘application/json’,
    data: JSON.stringify(body),
    success: function(userData, xhr, textStatus){
        if(userData.shoeSize){
            shoeSize = userData.shoeSize;
        }else {
            shoeSize = null;
        }
    },
    complete: function(xhr, textStatus){
        if(xhr.status == 400){
            console.log(“error”);
        }
    }
});
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.