Get OTC Group Search
Search for OTC (Over-The-Counter) deals associated with a specific user.
Endpoint
POST /v2/users/otcs/users/{user_id}/group-search
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | The unique identifier of the user |
Request Body
{
"page": 1,
"per_page": 10
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | Yes | Page number for pagination |
| per_page | integer | Yes | Number of items per page |
Response
Returns a paginated list of OTC deals associated with the user.
Success Response (200 OK)
{
"data": [
{
"deal_id": "number",
"token_id": "string",
"token_name": "string",
"token_symbol": "string",
"quantity": "number",
"available_quantity": "number",
"price": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"seller_id": "string",
"seller_name": "string",
"buyer_id": "string",
"buyer_name": "string",
"deal_type": "string",
"status": "string",
"expires_at": "string",
"created_at": "string",
"updated_at": "string"
}
],
"pagination": {
"current_page": 1,
"per_page": 10,
"total": "number",
"total_pages": "number"
}
}
Example
Request
curl -X POST "\{\{baseUrl\}\}/v2/users/otcs/users/680c02896d91ca0145cfeb81/group-search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \{\{token\}\}" \
-d '{
"page": 1,
"per_page": 10
}'
Response
{
"data": [
{
"deal_id": 12,
"token_id": "68ae06cfcccf4e8fc19362d1",
"token_name": "Real Estate Token",
"token_symbol": "RET",
"quantity": 50,
"available_quantity": 30,
"price": {
"amount": 12.0,
"decimal": 6,
"symbol": "USDT"
},
"seller_id": "680c02896d91ca0145cfeb81",
"seller_name": "John Doe",
"buyer_id": null,
"buyer_name": null,
"deal_type": "sell",
"status": "active",
"expires_at": "2024-02-15T10:30:00Z",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"current_page": 1,
"per_page": 10,
"total": 1,
"total_pages": 1
}
}
Error Responses
400 Bad Request
{
"error": "Invalid request parameters"
}
401 Unauthorized
{
"error": "Authentication required"
}
403 Forbidden
{
"error": "Access denied"
}
404 Not Found
{
"error": "User not found"
}
500 Internal Server Error
{
"error": "Internal server error"
}