Api
API Overview
Última actualización
¿Te fue útil?
API Overview
Última actualización
¿Te fue útil?
SQL Server A3ERP instance data access
Display of returned fields in views
Fixed API KEY obtained by validation on customer, supplier, carrier, representative, person or API_login masters.
The API has a log file in the folder indicated in the configuration in which the incidents and results of the API calls are recorded.
In all queries the query option is given to obtain only the number of records in the query and to be able to paginate the results. For this we must use the parameters of the query header.
In many queries you can sort by a parameter or filter by parameters, both can be used at the same time.
Returns the fields displayed by the view in the query.
Example:
View with the fields to be returned
Bearer + JWT_token
GET /api/campos/{vista} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Returns the fields of the selected view
{
"campos": [
{
"nombrecampo": "idfacv",
"tipo": "Currency",
"longitud": 7,
"descripcion": "identifier factura venta",
"permitenulos": "[F,T]",
"cuadrado": "[F,T]",
"libreria": "A3ERP"
}
]
}
To get the number of records in a query we must create the Count parameter in the header and assign it the value T. (Record count cannot be used with the order parameter of queries).
Example:
An api endpoint
Bearer + JWT_token
T
GET /api/{endpoint} HTTP/1.1
Host: server:<port>
Authorization: text
contar: text
Accept: */*
Returns an Array Objects with parameter records
[
{
"registros": 44273
}
]
To paginate a query we have to indicate in the header parameters (sorting is needed for pagination to work)
Example:
An api endpoint
Number of records per page
Page number to display
Bearer + JWT_token
GET /api/{endpoints} HTTP/1.1
Host: server:<port>
PageSize: 1
Page: 1
Authorization: text
Accept: */*
Returns the paged call
Sin contenido
The sort order can be changed using SQL syntax.
Example:
Parameter to be sorted
Bearer + JWT_token
GET /api/order/{order} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Returns the endpoint sorted by that parameter
Sin contenido
The filter has the same where SQL syntax so you can add several different filters in the same request.
Example:
https://server:5555/api/maestro/almacenes/filtro/encargado="7260 GYD"
SQL syntax filtering
Bearer + JWT_token
GET /api/filtro/{filtro} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Returns the endpoint filtered by that parameter
Sin contenido
It can be used together by putting the filter first.
Ejemplo:
https://server:5555/api/maestro/almacenes/filtro/encargado="7260 GYD"/order/desc
SQL syntax filtering
Parameter to sort SQL
Bearer + JWT_token
GET /filtro/{filtro}/order/{order} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Returns the filtered and sorted endpoint
Sin contenido