Once you have obtained the access_token, you can read information about the user who’s authenticated.

The endpoint for reading information about the user is /api/v1/userInfo, and you should access it using aGET HTTP request. We will be expecting the access_token to be sent as Bearer in the Authorization header of your request. A Python code example can be found here:

access_token = data_received['access_token']
headers = {"Authorization": f'Bearer {access_token}'}
print(f'Headers: {json.dumps(headers)}')
r = requests.get(SERVER_API_HOSTNAME/api/v1/userInfo, headers=headers)

An example of a response that you could be expecting, is this:

{
"email": "[email protected]",
"firstName": "John",
"lastName": "Smith",
"balance": 43.0,
"addressLine1": "Flat 23",
"addressLine2": "Ivor House",
"postcode": "SW2 5RS",
"city": "London",
"country": "United Kingdom"
}