Referencing entities

When using API, it is common to reference other entities. For example, you want to add a new job using the existing “Repair” template.

One way is to pass uuid of the template:

$ curl -H "X-Planado-API-Key:XXX" \
       --data "{\"template\":{\"uuid\":\"5990757f-fb00-4822-8c76-f967bda14554\"},\"description\": \"New repair job\"}" \
       https://api.planadoapp.com/v2/jobs
{"job_uuid":"8070f98d-b3f6-4cc8-b7c4-54b6709cd98b"}

Another option is passing name of the template:

$ curl -H "X-Planado-API-Key:XXX" \
       --data "{\"template\":{\"name\":\"Repair\"},\"description\": \"New repair job\"}" \
       https://api.planadoapp.com/v2/jobs
{"job_uuid":"8070f98d-b3f6-4cc8-b7c4-54b6709cd98b"}

It is easier to deal with names since they are more descriptive. However, uuid values are immutable and thus more reliable.

Most of Planado entities can either be referenced by uuid or name. Assignees can also be referenced by email.