Accesstoken

The accesstoken can be used to retrieve user data. The accesstoken object is given as parameter on the "getAccesstokenResponse" event.

<script>
    webshoplogin.accesstoken();
</script>
To get the response of the accesstoken function you can use the "getAccesstokenResponse" event. event.detail is a object with response data
<script>
    document.addEventListener("getAccesstokenResponse", function(event) {
        console.log(event.detail);
    }, false);
</script>

Success response

Response format: Accesstoken object
Response status code: 200
{
  "authorized": true,
  "accesstoken": "WsLD9MMgYABqTnxsRo6QJThmfA13dcWGS5mVa6OF628fWi4YiwgkzUGPQ4FLq0I6"
}

Error response

Response format: string
Response status code: 400
Api key not valid                        

Click here for description and full error list