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

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

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