Get CL2C User Details API
Learn how to retrieve a specific CL2C user's details through the /v1/cl2c/users/{id} endpoint.
The GET /v1/cl2c/users/{id}
API endpoint allows you to fetch the details of a specific CL2C user based on their unique id
. You must provide the tenant
ID and X-API-Key
for authentication.
Endpoint
GET
/v1/cl2c/users/{id}
Fetches the details of a CL2C user.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | Path | Yes | The unique ID of the user you want to retrieve. |
tenant | string | Header | Yes | Tenant ID for accessing this API. |
X-API-Key | string | Header | Yes | API Key ID for accessing this API. |
Responses
Success (200)
Content Type: application/json
Example Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"userName": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"emailConfirmed": true,
"authenticated": true,
"authValidUpto": "2024-11-05T19:48:49.563Z",
"authLocation": "string",
"phoneNumber": "string",
"walletAddress": "string"
}
This response includes detailed information about the user, including id
, userName
, firstName
, lastName
, email
, emailConfirmed
, authenticated
, authValidUpto
, authLocation
, phoneNumber
, and walletAddress
.
Error (400)
Content Type: application/json
Example Error Response
{
"type": "string",
"title": "string",
"status": 400,
"detail": "string",
"instance": "string",
"errors": {
"fieldName": ["Error message 1", "Error message 2"]
}
}
This response provides detailed error information, including the error type, status, and any additional validation errors for specific fields.
Default Error Response
Content Type: application/json
Example Default Error Response
{
"messages": ["string"],
"source": "string",
"exception": "string",
"errorId": "string",
"supportMessage": "string",
"statusCode": 0
}
This generic error response includes an array of messages, error source, exception details, an error ID for reference, and a support message.
Code Samples
Usage in Different Frameworks
Node.js Example
const axios = require('axios');
const userId = '3fa85f64-5717-4562-b3fc-2c963f66afa6'; // Replace with actual user ID
axios.get(`https://api.example.com/v1/cl2c/users/${userId}`, {
headers: {
'tenant': 'your-tenant-id',
'X-API-Key': 'your-api-key'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response.data));