API: user sessions
Using a session token, you can retrieve the user information.
GET /usersessions/{token}
This method returns the session information along with the user details.
Resource URL
GET https://app.snipcart.com/api/usersessions/{token}
Headers
Name | Value | Required? | Description |
---|---|---|---|
Accept | application/json |
Yes | Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make. |
Parameters
Name | Required? | Type | Description |
---|---|---|---|
token | yes | uniqueidentifier | The session token, passed in the URL. |
Example request
curl -H "Accept: application/json" \
https://app.snipcart.com/api/usersessions/c83945cd-1802-4861-b1b9-4e98eed8939d |
-u {API_KEY}:
Example response
{
"token":"c83945cd-1802-4861-b1b9-4e98eed8939d",
"expires":"2015-04-03T01:09:10.207Z",
"customer": {
"id":"c25f6054-3fc9-4792-b2d2-3e10eed55708",
"email":"geeks@snipcart.com",
"status":"Confirmed",
"creationDate":"2015-03-23T20:06:28.577Z",
"statistics": {
"ordersCount":1,
"ordersAmount":320.00
},
"billingAddressName":"Charles Ouellet",
"billingAddressCompanyName":"Snipcart",
"billingAddressAddress1":"226 rue St-Joseph Est",
"billingAddressAddress2":null,
"billingAddressCity":"Québec",
"billingAddressCountry":"CA",
"billingAddressProvince":"QC",
"billingAddressPostalCode":"G1K3A8",
"billingAddressPhone":"555 555 5555",
"shippingAddressName":"Charles Ouellet",
"shippingAddressCompanyName":"Snipcart",
"shippingAddressAddress1":"226 rue St-Joseph Est",
"shippingAddressAddress2":null,
"shippingAddressCity":"Québec",
"shippingAddressCountry":"CA",
"shippingAddressProvince":"QC",
"shippingAddressPostalCode":"G1K3A8",
"shippingAddressPhone":"555 555 5555",
"shippingAddressSameAsBilling":true,
"gravatarUrl":"https://www.gravatar.com/avatar/43c0d10549c1cafa66c416c7e7a59698?s=70&d=https%3a%2f%2fapp.snipcart.com%2fcontent%2fimages%2favatar.jpg"
}
}