Do not forget to fill the Authorization header in every single request - Authorization: Bearer {your token}
GET https://{host}/rest/v1/{unitId}/views/{viewName}?{queryParameters}
notice: query parameters must be url encoded!
Possible query parameters:
You can ask only for some columns, if predefined column list is too complex four your usecase.
columns={columnName1},{columnName2},...{columnNameN}
You can ask only for some properties, if predefined property list is too complex four your usecase.
properties={propertyName1},{propertyName2},...{propertyNameN}
You can define your own filter, if you want only specific result set.
externalFilter={filter}
operators AND, OR, NOT, ANY can be used in filter. Examples:
externalFilter=isDisabled=false
-> encoded result: externalFilter=isDisabled%3Dfalse
externalFilter=(type='INVOICE.SALES' AND status='APPROVED')
-> encoded result: externalFilter=%28type%3D%27INVOICE.SALES%27%20AND%20status%3D%27APPROVED%27%29
You can limit the number of results
limit={number of records}
The default limit of results is defined by register of such view and in default is always 1000. Be careful with setting higher 'limit' values. The maximum response size to API Gateway is 10 MB. And of course, the size of the answer depends on the number of parameters and their length. If the server's response is larger than 10MB, you will receive an error response. Therefore, the parameter 'limit' must be set very sensibly.
Pagination of the response
Since the number of returned records can be large, pagination must be applied. The default limit is 1000 records for each view, each response returns a metaData object in which it is possible to read what additional offset needs to be used to obtain the next part of the response. If nextOffset = null then there are no more records to send.
offset={index of the first record in pagination} (default = 0)
Response of server
{
"metadata": {
"count": 1000,
"limit": 1000,
"nextOffset": 1000
},
"data": [
{...row object[0] ...},
{...row object[1] ...},
...
{...row object[999] ...}
]
}
Predefined views:
As always, everything in Teamogy can be customized. Here is the list of predefined views available. And it is possible to define yours custom view. Use this as {viewName} url parameter.
companies
companies.client
companies.supplier
persons
brands
documents
documents.order.purchase
documents.quotation.sales
opportunities
absences
invoices.purchase
invoices.sales
cashboxes
internals.sales
internals.purchase
gems
binders
jobs
overheads.client
overheads.internal
tasks
intervals.track
intervals.absence
intervals.attendance
users
groups