Upload a Unit

POST /upload

Internal endpoint for iOS app only, to upload a unit from the field.

Headers

application/json

Body

  • latitude number(double) Required
  • longitude number(double) Required
  • image_url string(url) Required

    Uploaded image that the API will read from and download.

  • Hide supervisor attribute Show supervisor attribute
    • id string(uuid) Required
  • species object
    Hide species attribute Show species attribute
    • id string(uuid) Required
  • site object Required
    Hide site attribute Show site attribute
    • id string(uuid) Required
  • Device ID of the mobile device that took the photo.

  • planted_at string(date-time) Required

    Date taken from image metadata, so it's as close to the actual planted date-time as possible.

Responses

POST /upload
curl \
 -X POST https://hostname/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-24 14:15:22 UTC"
}