User API
Documentation on using the user API through OAuth2 in SePay.
Introduction
SePay's User API allows you to access information about the current user and their company. You can get personal information of the user and detailed information about the company they belong to.
To use this API, you need the profile permission (for user information) or company permission (for company information) in the Access Token scope.
Get User Information
https://my.sepay.vn/api/v1/meAuthorization: Bearer {YOUR_ACCESS_TOKEN}
This endpoint returns information of the current user authenticated via OAuth2.
Required permissions:
- Scope:
profile
curl -X GET "https://my.sepay.vn/api/v1/me" \-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
"status": "success",
"data": {
"id": 1234,
"first_name": "Nguyễn",
"last_name": "Văn A",
"email": "nguyen.van.a@example.com",
"phone": "0901234567",
"avatar": "https://www.gravatar.com/avatar/0bc83cb571cd1c50ba6f3e8a78ef1346"
}
}idintegerUser ID
first_namestringUser's first name
last_namestringUser's last name
emailstringUser's email address
phonestringUser's phone number
avatarstringAvatar URL from Gravatar
Error Codes
Below are the error codes that may be encountered when using the User API:
401unauthorizedToken is invalid or expired
403forbiddenNo permission to access this resource
Next Step
Next, learn about the Company API to get detailed information about the user's company.