Headers
-
Idempotency-Key string
Body
-
Uploaded image that the API will read from and download.
-
supervisor object
-
species object
-
device_id string
Device ID of the mobile device that took the photo.
-
Date taken from image metadata, so it's as close to the actual planted date-time as possible.
POST /upload
curl \
-X POST https://api.protect.earth/upload \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: string" \
-d '{"latitude":51.87351,"longitude":-1.90973,"image_url":"string","supervisor":{"id":"string"},"species":{"id":"string"},"site":{"id":"string"},"device_id":"string","planted_at":"2019-08-24T14:15:22Z"}'
Request example
# Headers
Idempotency-Key: string
# Payload
{
"latitude": 51.87351,
"longitude": -1.90973,
"image_url": "string",
"supervisor": {
"id": "string"
},
"species": {
"id": "string"
},
"site": {
"id": "string"
},
"device_id": "string",
"planted_at": "2019-08-24T14:15:22Z"
}
Response examples (400)
{
"type": "https://protect.earth/probs/something-went-wrong",
"title": "You do not have enough credit.",
"status": 400,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc"
}
Response examples (401)
{
"type": "https://protect.earth/probs/something-went-wrong",
"title": "You do not have enough credit.",
"status": 400,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc"
}
Response examples (403)
{
"type": "https://protect.earth/probs/something-went-wrong",
"title": "You do not have enough credit.",
"status": 400,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc"
}
Response examples (409)
{
"type": "https://protect.earth/probs/something-went-wrong",
"title": "You do not have enough credit.",
"status": 400,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc"
}
Response examples (422)
{
"type": "https://protect.earth/probs/something-went-wrong",
"title": "You do not have enough credit.",
"status": 400,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc"
}