Get User By ID API
POST /getUserById
Description
This endpoint retrieves detailed information about a user based on their unique ID.
Request
Endpoint: /getUserById
Method: POST
Body:
query getUserById ($id: Int) {
getUserById (id: $id) {
id
email
username
resellerId
role
enabled
radAccess
radAccessClear
createdAt
updatedAt
}
}
GraphQL Variables:
{
"id": 0
}
Example Request
cURL:
curl --location 'YOUR_API_ENDPOINT' \
--header 'Content-Type: application/json' \
--data '{"query":"query getUserById ($id: Int) {\n getUserById (id: $id) {\n id\n email\n username\n resellerId\n role\n enabled\n radAccess\n radAccessClear\n createdAt\n updatedAt\n }\n}","variables":{"id":0}}'
Response
The response will include:
id
: Unique identifier of the user.email
: Email address of the user.username
: Username of the user.resellerId
: ID of the reseller associated with the user.role
: Role assigned to the user.enabled
: Status indicating if the user is enabled or not.radAccess
: RAD access level of the user.radAccessClear
: RAD access clearance of the user.createdAt
: Timestamp when the user was created.updatedAt
: Timestamp when the user was last updated.
Errors
- 404 Not Found: User with the provided
id
does not exist. - 500 Internal Server Error: Server error while processing the request.
Notes
- Ensure that the
id
provided is valid and exists in the database. - The response may include sensitive user information. Ensure proper access controls and permissions are in place.
- If the user with the provided
id
does not exist, the response may be null or an error message.