API: _ Default behavior
Authentication defaults
Request parameters:
Parameter | Type | In | Description |
---|---|---|---|
Authorization | string | HEADER | Token retrieved from API: Authentication |
Response Parameter (Success):
As in main request
Response Parameter (Error):
Parameter | Type | Description |
---|---|---|
error | string | A message containing information about the error |
message | integer | Error code |
Request Header
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg
Response (Error)
401 Unauthorized { "code": 401 "message": "Invalid JWT Token" }
List defaults
GET list
Paging parameters:
Parameter | Type | In | Default | Description |
---|---|---|---|---|
limit | integer | QUERY | 100 | Number of results per request |
page | integer | QUERY | 1 | Default page (1= we are starting from row 0 to tow 100) |
Filtering parameters:
Parameter | Type | IN | Example | Description |
---|---|---|---|---|
created_at | updated_at | string | QUERY | filters[created_at]=2022-06-09 | Filtering by date = value |
created_at | updated_at | array[from] | QUERY | filters[created_at][from]=2022-06-09 | Filtering by date >= from |
created_at | updated_at | array[to] | QUERY | filters[created_at][to]=2022-06-09 | Filtering by date <= to |
created_at | updated_at | array[from,to] | QUERY | filters[created_at][from]=2022-06-09&filters[created_at][to]=2022-06-09 | Filtering by date between from and to |
Sorting parameters
Parameter | Type | In | Default | Description |
---|---|---|---|---|
sort | string | QUERY | main alias . id | name of sorting column, all available columns are shown in specific description of endpoint or on error (just add anything to get available sorts) |
order | string | QUERY | asc | Default sort is asc, avaiable is asc or desc |
Fields parameters
Parameter | Type | In | Example | Description |
---|---|---|---|---|
fields | array | QUERY | fields[name]=true | name = field name from available list, values: true= field will be added, false = field will be removed |
Response Parameter (Success):
As in main request
Response Parameter (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Limiting and Paging
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?limit=2&page=1 --header '[....]'
Filtering
(Created at date)
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?filters[created_at]=2022-06-09 --header '[....]'
from
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?filters[created_at][from]=2022-06-09 --header '[....]'
to
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?filters[created_at][to]=2022-06-09 --header '[....]'
between
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?filters[created_at][from]=2021-06-09&filters[created_at][to]=2022-06-09 --header '[....]'
Sorting & ordering
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?sort=chat.id&order=desc --header '[....]'
Adding/removing fields
Request
curl -X GET https://public.brokerstar.biz/api/v3/contact?fields[permissions]=true&fields[name_1]=false --header '[....]'
Read defaults
Update defaults
PUT entity
Request parameter:
Parameter | Type | In | Description |
---|---|---|---|
id | int | url | ID of requested entity |
JSON data (All fields are optional and can be send selective):
like in main request
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
status | int | Response status (same as in http code) |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
error_count | integer | Number of errors in errors array |
Response (Error)
400 Bad Request { "error": "Missing argument (name_2), new-emai:\n This value is not a valid email address.", "errors": { "name_2": "This argument is required", "mail": "new-emai:\n This value is not a valid email address." }, "error_count": 2, "code": 400 }