Get all accounts
GET /api/v1/Accounts/get-all
Description
This endpoint retrieves a list of accounts based on specified query parameters.
Request
Headers:
Accept-Language: Change default response message language from English(en). Available languages fr,en
Query Parameters:
- OwnerId: The ID of the account owner. (Optional)
- TenantId: The ID of the tenant. (Optional)
- SearchText: The text to search for in account names or numbers. (Optional)
- Descending: Whether to sort the results in descending order. (Optional)
- Status: The status of the account. (Optional)
- Order: The order in which to sort the results. (Optional)
- Owner: The owner of the account. (Optional)
- PageNumber: The page number of the results. (Optional)
- PageSize: The number of items per page. (Optional)
- version: The version of the API.
URL:
-/api/v1/Accounts/get-all
Response:
- 200: Success, returns a paged list of accounts.
- 400: Bad Request, the request is not valid.
- 404: Not Found, no accounts match the specified criteria.
Error Codes:
- 400: Bad Request, the request is not valid.
- 404: Not Found, no accounts match the specified criteria.
- 500: Internal server error, something went wrong while processing the request.
Example Response:
jsonCopy codeHTTP/1.1 200 OK
{
"totalCount": 100,
"pageSize": 10,
"pageNumber": 1,
"items": [
{
"id": "123",
"name": "Account 1",
"number": "ACCT001",
"status": "Active",
"owner": {
"id": "456",
"name": "User 1"
},
"createdAt": "2024-02-16T12:00:00Z",
"updatedAt": "2024-02-17T12:00:00Z"
},
{
"id": "124",
"name": "Account 2",
"number": "ACCT002",
"status": "Active",
"owner": {
"id": "457",
"name": "User 2"
},
"createdAt": "2024-02-17T12:00:00Z",
"updatedAt": "2024-02-18T12:00:00Z"
}
]
}
Notes:
- This endpoint is useful for retrieving a list of accounts based on specified query parameters.
- The response includes the total count of accounts, the page size, the page number, and the list of accounts.
- The
Accept-Languageheader can be used to change the default response message language. Currently supported languages are English (en) and French (fr). - If no accounts match the specified criteria, a 404 Not Found response will be returned.
Headers
| Content-Type | Value |
|---|---|
| Accept | text/plain |
Query Params
| Param | value |
|---|---|
| OwnerId | <uuid> |
| TenantId | <uuid> |
| SearchText | <string> |
| Descending | <boolean> |
| Status | 1 |
| Order | 1 |
| Owner | 2 |
| PageNumber | <integer> |
| PageSize | <integer> |
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/Accounts/get-all \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!