Get the logged in user via token

In order to get the logged in user on your website from Weasl's API, send the following request (example in python):

import requests as req

user_token = 'USER TOKEN'
client_id = 'YOUR WEASL CLIENT ID'
url = 'https://api.weasl.in/end_users/me'

headers = {
    'Authorization': 'bearer {}'.format(user_token),
    'X-Weasl-Client-Id': client_id,
}

res = req.get(url, headers=header)
print(res.json())
"""
{
    "data": {
        "id": "some long UUID",
        "attributes": {},
        "activity": {
            "last_login_at": None,
            "created_at": None,
            "updated_at": None
        },
        "identity": {
            "email": "somebody@email.com",
            "phone_number": None
        }
    }
}
"""

Did this help answer your question?

thumbs up
thumbs down

Thanks for the feedback! 🙏🏽


Help by drift