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"
}
}
Organics
POST
https://baas.kinvey.com/appdata/{{app-key}}/Organics
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}}/Organics
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"
}
}
]
Harvests
POST
https://baas.kinvey.com/appdata/{{app-key}}/Harvests
body
{
"id_producer" : "5ae4eb537864c356779d5562fa0",
"canceled" : "false",
"organics" : [
{
"organic" : {
"name" : "melancia",
"measurement" : "un",
"image" : "dakjflksdjflskdfjkl"
},
"quantity" : "5",
"price" : "6,6"
},
{
"organic" : {
"name" : "laranja",
"measurement" : "un",
"image" : "dakjflksdjflskdfjkl"
},
"quantity" : "5",
"price" : "5,5"
},
{
"organic" : {
"name" : "limão",
"measurement" : "un",
"image" : "dakjflksdjflskdfjkl"
},
"quantity" : "5",
"price" : "5,5"
}
]
}
GET
https://baas.kinvey.com/appdata/{{app-key}}/Harvests
Exemplo de retorno
[
{
"_id": "5af4db1b8ad21e249a8c6cac",
"id_producer": "5ae4eb537864c356779d5562fa0",
"canceled": "false",
"organics": [
{
"organic": {
"name": "melancia",
"measurement": "un",
"image": "dakjflksdjflskdfjkl"
},
"quantity": "5",
"price": "6,6"
},
{
"organic": {
"name": "laranja",
"measurement": "un",
"image": "dakjflksdjflskdfjkl"
},
"quantity": "5",
"price": "5,5"
},
{
"organic": {
"name": "limão",
"measurement": "un",
"image": "dakjflksdjflskdfjkl"
},
"quantity": "5",
"price": "5,5"
}
],
"_acl": {
"creator": "5ae4eb0b4c356779d5562e2f"
},
"_kmd": {
"lmt": "2018-05-10T23:51:55.674Z",
"ect": "2018-05-10T23:51:55.674Z"
}
}
]