Retrieve a JavaScript object of all the data you have stored for this chatbot 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/context_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”);
}
}
});