API: _ Default behavior

Authentication defaults 

Request parameters:

ParameterTypeInDescription
AuthorizationstringHEADERToken retrieved from API: Authentication

Response Parameter (Success):

As in main request

Response Parameter (Error):

Parameter

Type

Description

errorstringA message containing information about the error 
messageintegerError 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:

ParameterTypeInDefaultDescription
limitintegerQUERY100Number of results per request
pageintegerQUERY1Default page (1= we are starting from row 0 to tow 100)

Filtering parameters:

ParameterTypeINExampleDescription
created_at | updated_atstringQUERYfilters[created_at]=2022-06-09Filtering by date = value
created_at | updated_atarray[from]QUERYfilters[created_at][from]=2022-06-09Filtering by date >= from
created_at | updated_atarray[to]QUERYfilters[created_at][to]=2022-06-09Filtering by date <= to
created_at | updated_atarray[from,to]QUERYfilters[created_at][from]=2022-06-09&filters[created_at][to]=2022-06-09Filtering by date between from and to

Sorting parameters

ParameterTypeInDefaultDescription
sortstringQUERYmain alias . idname of sorting column, all available columns are shown in specific description of endpoint or on error (just add anything to get available sorts)
orderstringQUERYascDefault sort is asc, avaiable is asc or desc

Fields parameters

ParameterTypeInExampleDescription
fieldsarrayQUERYfields[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):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList 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:

ParameterTypeInDescription
idinturlID of requested entity

JSON data (All fields are optional and can be send selective):

like in main request

Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)

Response (Error):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList of errors devided by field in associative array {field_name:error message}
error_countintegerNumber 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
}