Endpoints
header
key=Authorization
value={app-secret}
Login
POST
https://baas.kinvey.com/user/{app-key}/login
body
{
"username": "username",
"password": "password"
}
Exemplo de retorno
{
"_id": "hash",
"username": "username",
"email": "[email protected]",
"_kmd": {
"lmt": "2018-04-14T00:40:46.274Z",
"ect": "2018-04-14T00:40:46.274Z",
"authtoken": "hash"
},
"_acl": {
"creator": "hash"
}
}
Pré-cadastro
POST
https://baas.kinvey.com/user/{app-key}
body
{
"username": "[email protected]",
"password": "exemplo",
"phone1": "994847393",
"phone2": "947584959",
"name": "Exemplo da Silva",
"recordtype": "confea",
"recordnumber": "39847",
"address": "Av. Ipiranga, 4000",
"addresscomplement": "apto 758",
"cep": "98929838",
"neighborhood": "Partenon",
"city": "Porto Alegre",
"state": "RS"
}
Exemplo de retorno
{
"username": "[email protected]",
"password": "exemplo2",
"phone1": "994847393",
"phone2": "947584959",
"name": "Exemplo2 da Silva",
"recordtype": "confea",
"recordnumber": "39847",
"address": "Av. Ipiranga, 4000",
"addresscomplement": "apto 758",
"cep": "98929838",
"neighborhood": "Partenon",
"city": "Porto Alegre",
"state": "RS",
"verifieduser": false,
"_kmd": {
"lmt": "2018-04-18T00:16:03.582Z",
"ect": "2018-04-18T00:16:03.582Z",
"authtoken": "d69affd0-b3f1-4826-b15a-afb5df766c1c.OC2HH15oRV24U5cj2PC6FWdQi0zClc9CbmJwiAHYVSU="
},
"_id": "5ad68e435aa1301702ff5199",
"_acl": {
"creator": "5ad68e435aa1301702ff5199"
}
}
Products
POST
https://baas.kinvey.com/appdata/{{app-key}}/product
body
{
"name": "Pera",
"measurement": "un",
"image": { "_type":"KinveyFile","_id":"bf0c8005-f64e-4151-af30-878aa0060581" }
}
Sendo que não é possível o cadastro de orgânicos com o mesmo nome e as unidades permitidas até o momento são "un" e "kg".
GET
https://baas.kinvey.com/appdata/{{app-key}}/product
Exemplo de retorno
[
{
"_id": "5aecef6926860c399a8ff2eb",
"name": "Abacate",
"measurement": "un",
"image": {
"_id": "403097ff-78f2-4463-9ca0-0251e3f78fa3",
"_acl": {
"gr": true,
"creator": "5ae4cd474c356779d5558984"
},
"_filename": "abacate.jpg",
"_public": true,
"mimeType": "image/jpeg",
"size": 236482,
"_kmd": {
"lmt": "2018-05-04T23:39:12.218Z",
"ect": "2018-05-04T23:39:12.218Z"
},
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg",
"_type": "KinveyFile"
},
"_acl": {
"creator": "5ae4eb534c356779d5562fa0"
},
"_kmd": {
"lmt": "2018-05-04T23:40:25.154Z",
"ect": "2018-05-04T23:40:25.154Z"
}
}
]
Available Assortment
POST
https://baas.kinvey.com/appdata/{{app-key}}/availableAssortment
body
{
"id_producer" : "5b0087f9e7944c29fda4658d",
"canceled" : "false",
"products": [
{
"name": "Maçã Vermelha",
"measurement": "kg",
"quantity" : "150",
"price" : "5.5",
"image": {
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/2da6265e-39db-4291-8ba8-530b7cd70892/maca.jpg"
}
},
{
"name": "Abacate",
"measurement": "un",
"quantity" : "200",
"price" : "5.5",
"image": {
"_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg"
}
}
]
}
GET
https://baas.kinvey.com/appdata/{{app-key}}/availableAssortment?query={"id_producer":"idusuario"}
Obs: Os valores idusuario}} e app-key devem ser substituídos pelos dados que se deseja obter na operação.
Exemplo de retorno
[ { "_id": "5b131473978f6b254a4e9c79", "id_producer": "5b0087f9e7944c29fda4658d", "canceled": "false", "products": [ { "name": "Maçã Vermelha", "measurement": "kg", "quantity": "150", "price": "5", "image": { "_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/2da6265e-39db-4291-8ba8-530b7cd70892/maca.jpg" } }, { "name": "Abacate", "measurement": "un", "quantity": "200", "price": "5.5", "image": { "_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg" } } ], "_acl": { "creator": "5b0087f9e7944c29fda4658d" }, "_kmd": { "lmt": "2018-06-02T22:04:35.967Z", "ect": "2018-06-02T22:04:35.967Z" } } ]
Required Assortment
POST
https://baas.kinvey.com/appdata/{{app-key}}/requiredAssortment
body
{ "id_producer" : "5b11e41ef1ae0728029bd7e1", "canceled" : "false", "products": [ { "name": "Maçã Amarela", "measurement": "kg", "quantity" : "150", "image": { "_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/2da6265e-39db-4291-8ba8-530b7cd70892/maca.jpg" } }, { "name": "Abacate", "measurement": "un", "quantity" : "200", "image": { "_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg" } } ] }
GET
https://baas.kinvey.com/appdata/{{app-key}}/requiredAssortment?query={"id_producer":"idusuario"}
Obs: Os valores idusuario}} e app-key devem ser substituídos pelos dados que se deseja obter na operação.
Exemplo de retorno
[ { "_id": "5b11e3865a057f34f1429c17", "id_producer": "5b0087f9e7944c29fda4658d", "canceled": "false", "products": [ { "name": "Maçã Amarela", "measurement": "kg", "quantity": "150", "image": { "_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/2da6265e-39db-4291-8ba8-530b7cd70892/maca.jpg" } }, { "name": "Abacate", "measurement": "un", "quantity": "200", "image": { "_downloadURL": "http://storage.googleapis.com/f043309f51f746e495a9c4a6a4fae3cf/403097ff-78f2-4463-9ca0-0251e3f78fa3/abacate.jpg" } } ], "_acl": { "creator": "5b11e32064a4957428aec9a8" }, "_kmd": { "lmt": "2018-06-02T00:23:34.440Z", "ect": "2018-06-02T00:23:34.440Z" } } ]