Get user

To retrieve user data you will have to use the getUser method. You have to define event-listener yourself.

<script>
    webshoplogin.getUser(signature, nonce, accesstoken);
</script>
To get the response of the getUser function you can use the "getUserResponse" event.
<script>
    document.addEventListener("getUserResponse", function(event) {
        console.log(event.detail);
    }, false);
</script>

Success response

Response format: User object
Response status code: 200
{
    "user": {
      "id": "9TJB5F1bnA5N4rZCDBrIr8Xgt6cwNKhf1GKjcXqd",
      "version": 1,
      "username": "bob@example.com",
      "verified": true
    },
    "customer": {
      "version": 1,
      "prefix": "Mr",
      "firstname": "Bob",
      "lastname": "Abbes",
      "suffix": "Jr",
      "birthday": "1993-01-23",
      "gender": 1,
      "subscribed": false,
    },
    "addresses: [
        0 => {
         "address_id": 3,
         "version": 1,
         "prefix": "Mr",
         "firstname": "Bob",
         "lastname": "Abbes",
         "suffix": "Jr",
         "company": "WebshopLogin",
         "street": "De Ruijterkade",
         "number": 112,
         "additional": A,
         "city": "Amsterdam",
         "country": "NL",
         "province": "Noord-Holland",
         "postal": "1011AB",
         "telephone": "0202615278",
         "fax": null,
         "default_billing": true,
         "default_shipping": true,
       }
    ],
}

Error response

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

Click here for description and full error list