Get Contact
Description
Retrieve a specific contact by ID.
Authentication
- Required: Yes
- Roles: Any authenticated user
Request
Headers
GET /v1/customer/contact/:id
Authorization: Bearer <token>
Content-Type: application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | number | Yes | Contact ID |
Response
Success Response (200)
{
"data": {
"id": 1,
"name": "John Doe",
"phone": "0123456789",
"email": "john@example.com",
"age": 30,
"address": "123 Main St",
"assigned": 1,
"type": "contact",
"status": "pending",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
}
Error Responses
- 401: Authentication required
- 404: Contact not found
- 422: Validation errors (see Error Response Format)
Error Codes
- E010_BAD_RESOURCE_NOT_EXISTS: Contact not found
Example Usage
curl -X GET https://api.stepx.io.vn/v1/customer/contact/1 \
-H "Authorization: Bearer <token>"
const response = await fetch('https://api.stepx.io.vn/v1/customer/contact/1', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();