JSON API
AuthenticationAutenticação
A API HelloCloud Apipermite allowsdois twotipos kindde of grant types:concessão:
-
ClientCredencialcredentialdo Cliente -
PasswordSenha
Parameter | Description |
---|---|
Access Token URL |
{{base.url}}/Api/access_token |
Username |
|
Password |
|
Client ID |
|
Client Secret |
|
Scopes |
|
Parâmetros Available parameters disponíveis
AccordingDe toacordo JsonApicom specification,a theespecificação availableJsonApi, parametersos areparâmetros thedisponíveis followingsão dependingos onseguintes, thedependendo GETdo endpoint:endpoint GET:
FieldsCampos
FieldsOs cancampos filterpodem onser attributefiltrados object.por Allowedobjeto keysde areatributo. validAs chaves permitidas são propriedades de bean properties.válidas.
Example:Exemplo:
{{base.url}}/V8/module/Accounts/11a71596-83e7-624d-c792-5ab9006dd493?fields[Accounts]=name,account_type
Resultado:
{{base.url}}/V8/module/Accounts/11a71596-83e7-624d-c792-5ab9006dd493?fields[Accounts]=name,account_type
Result:
{
"data": {
"type": "Account",
"id": "11a71596-83e7-624d-c792-5ab9006dd493",
"attributes": {
"name": "White Cross Co",
"account_type": "Customer"
},
"relationships": {
"AOS_Contracts": {
"links": {
"related": "/V8/module/Accounts/11a71596-83e7-624d-c792-5ab9006dd493/relationships/aos_contracts"
}
}
}
}
}
PagePágina
PageA canpágina filterpode filtrar beans ande setdefinir pagination.a Allowedpaginação. keyAs arechaves permitidas são number ande size.
-
page[number]
numbernúmeroofdathepáginawanted pagedesejada -
page[size]
sizetamanhoofdothe resultresultado
Exemplo:
Example:
{{base.url}}/V8/module/Accounts?fields[Account]=name,account_type&page[number]=3&page[size]=1
Result:
Resultado:
{
"meta": {
"total-pages": 54
},
"data": [
{
"type": "Account",
"id": "e6e0af95-4772-5773-ae70-5ae70f931feb",
"attributes": {
"name": "",
"account_type": ""
},
"relationships": {
"AOS_Contracts": {
"links": {
"related": "/V8/module/Accounts/e6e0af95-4772-5773-ae70-5ae70f931feb/relationships/aos_contracts"
}
}
}
}
],
"links": {
"first": "/V8/module/Accounts?fields[Account]=name,account_type&page[number]=1&page[size]=1",
"prev": "/V8/module/Accounts?fields[Account]=name,account_type&page[number]=2&page[size]=1",
"next": "/V8/module/Accounts?fields[Account]=name,account_type&page[number]=4&page[size]=1",
"last": "/V8/module/Accounts?fields[Account]=name,account_type&page[number]=54&page[size]=1"
}
}
SortOrdenar
SortA isclassificação onlysó availableestá whendisponível collectionsquando wantedas tocoleções bedesejam fetched.ser Sortingbuscadas. isA setclassificação toé definida como ASC bypor default.padrão. IfSe thea propertypropriedade isfor prefixedprefixada withcom hyphen,hífen, thea sortordem orderde changesclassificação toserá alterada para DESC.
ImportantAviso notice:importante: weno onlymomento, supportoferecemos singlesuporte sortingapenas rightà now!classificação única!
Example:Exemplo:
{{base.url}}/V8/module/Accounts?sort=-name
Resultado:
Result:
{
"data": [
{
"type": "Account",
"id": "e6e0af95-4772-5773-ae70-5ae70f931feb",
"attributes": {
"name": "White Cross Co",
"account_type": "Customer"
},
"relationships": {
"AOS_Contracts": {
"links": {
"related": "/V8/module/Accounts/1d125d2a-ac5a-3666-f771-5ab9008b606c/relationships/aos_contracts"
}
}
}
},
{
"type": "Account",
"id": "7831d361-2f3c-dee4-d36c-5ab900860cfb",
"attributes": {
"name": "Union Bank",
"account_type": "Customer"
},
"relationships": {
"AOS_Contracts": {
"links": {
"related": "/V8/module/Accounts/7831d361-2f3c-dee4-d36c-5ab900860cfb/relationships/aos_contracts"
}
}
}
}
],
}
Filter
Our filter strategy is the following:
Filtro
Nossa estratégia de filtro é a seguinte:
-
filter[operator]=and
-
filter[account_type][eq]=Customer
ImportantAviso notice:importante: wenão don’toferecemos supportsuporte multipleà levelclassificação sortingem rightvários now!níveis no momento!
SupportedOperadores operatorssuportados
ComparisonComparação
EQ = '=';
NEQ = '<>';
GT = '>';
GTE = '>=';
LT = '<';
LTE = '<=';
EQ = '=';
NEQ = '<>';
GT = '>';
GTE = '>=';
LT = '<';
LTE = '<=';
LogicalLógico
'AND', 'OR'
'AND', 'OR'
Example:Exemplo:
{{base.url}}/V8/module/Accounts?fields[Accounts]=name,account_type&filter[operator]=and&filter[account_type][eq]=Customer
Example:
Exemplo:
{{base.url}}/V8/module/Accounts?filter[account_type][eq]=Customer