Получение наряда

Наряд может быть получен по uuid или external_id.

Получение наряда по uuid
$ curl -H "Authorization: Bearer api-key" \
       https://api.planadoapp.com/v2/jobs/cb4b2ede-114f-4c55-9118-0b62f8182403 | jq
{
  "job": {
    "uuid": "cb4b2ede-114f-4c55-9118-0b62f8182403"
    "external_id": null,
    "external_order_id": null,
    "serial_no": 22461,
    "status": "started",
    "scheduled_at": "2015-01-19T20:00:00.000Z",
    "scheduled_duration": {
      "minutes": 60
    },
    "template": {
      "uuid": "2bb9f66f-082c-4bfd-b806-e777d483c769",
      "name": "Network diagnostic"
    },
    "client": {
      "uuid": "50c773b3-a4f8-5619-be47-cb6a0edb22cc",
      "external_id": "423430387320568-acme"
    },
    "site": {
      "uuid": "dc62cfdf-f9f1-59ec-80bd-ff5da151e515",
      "external_id": "kelheimer-6"
    },
    "type": {
      "uuid": "8d5f2415-fce3-45a6-b417-ad939a63f70d",
      "code": "Diagnostic"
    },
    "timestamps": {
      "en_route_at": "2015-01-19T20:35:04.617Z",
      "started_at": "2015-01-19T21:02:04.617Z",
      "suspended_at": null,
      "finished_at": null,
    },
    "assignee": {
      "worker": {
        "uuid": "8ebd12cc-b2d9-407c-a4f4-5943263d54a4",
        "email": "john@doe"
      }
    },
    "skills": [
      {
        "uuid": "8d486972-28de-4216-8957-bbfffe0a8d77",
        "name": "Installation"
      },
      {
        "uuid": "173ab190-acf0-42e5-aa4e-4beecd941137",
        "name": "Diagnostic"
      }
    ],
    "territory": {
      "uuid": "d528336e-c310-4485-a80f-580b3b4cb6f1",
      "name": "Manhattan"
    },
    "description": "Chuck Norris threw a grenade and killed 50 people, then it exploded.",
    "address": {
      "formatted": "Kelheimer Str. 6, 10777 Berlin, Germany",
      "entrance_no": null,
      "apartment": null,
      "floor": "3",
      "description": null,
      "geolocation": {
        "longitude": 13.3363265,
        "latitude": 52.4984896
      }
    },
    "contacts": [
      {
        "name": "Herr Karl",
        "value": "0179-1234567",
        "type": "phone"
      }
    ],
    "possible_resolutions": [
      {
        "uuid": "f74c80bd-e21c-4d11-a036-84126004088b",
        "name": "Success"
      },
      {
        "uuid": "19b30c02-371f-4da7-a24f-cf0dd840b793",
        "name": "Failure"
      }
    ],
    "custom_fields": [
      {
        "uuid": "137e2ad5-8d02-6360-d77f-6a19c8f707ca",
        "name": "Instructions",
        "field_type": "file",
        "data_type": "attachment",
        "required": false,
        "value": "https://www.cs.virginia.edu/~robins/Turing_Paper_1936.pdf"
      },
      {
        "uuid": "137e2ad5-8d2e-6a00-d77f-6a19c8f707ca",
        "name": "Order #",
        "field_type": "input",
        "data_type": "string",
        "required": true,
        "value": "IO-42-1862/11/2015"
      },
      {
        "uuid": "137e81d2-c3e3-6b20-78b2-2e6e183cc868",
        "name": "Diagnostic type",
        "field_type": "dictionary",
        "data_type": "dictionary",
        "required": true,
        "dictionary": {
          "uuid": "0bd6395c-1668-4cf2-bdab-1cde5d3eecd9",
          "name": "Diagnostic type"
        }
      }
    ],
    "report_fields": [
      {
        "uuid": "a3d0136f-db10-4b70-a092-d27841c94345",
        "name": "Greetings",
        "field_type": "action",
        "data_type": "boolean",
        "required": true,
        "value": true,
        "filled_at": "2015-11-20T14:12:03Z"
      },
      {
        "uuid": "137e9b14-9ca2-64a0-b9b6-5eb27cb176c4",
        "name": "Photo of issue",
        "field_type": "file",
        "data_type": "image",
        "required": true,
        "pending_files": 0,
        "value": [
          "https://previews.123rf.com/images/rottenman/rottenman1303/rottenman130300014/18519536-broken-cable-isolated-on-white.jpg",
          "https://blog.apnic.net/wp-content/uploads/2018/07/damagedfibreoptic-header-555x202.jpg?v=845dd091246c794f108761aec0e9e7bc"
        ],
        "filled_at": "2015-11-20T14:12:03Z"
      },
      {
        "uuid": "a3d0136f-db10-4b70-a092-d27841c94345",
        "name": "Issue solved?",
        "field_type": "checkbox",
        "data_type": "boolean",
        "required": true,
        "value": true,
        "filled_at": "2015-11-20T14:12:03Z"
      },
      {
        "uuid": "354e9542-e706-4fa1-a52b-175ca7d8081e",
        "name": "Installed equipment",
        "field_type": "barcode",
        "data_type": "string",
        "required": false,
        "value": "80189807",
        "filled_at": "2015-11-20T14:12:03Z"
      },
      {
        "uuid": "1824094e-fa43-43a2-8f6f-c94f201d035c"
        "name": "Actual severity of damage",
        "field_type": "dictionary",
        "data_type": "dictionary",
        "required": true,
        "value": {
          "uuid": "ad5c8dba-2014-4d42-b6f0-d21af8bef97d",
          "name": "Not really"
        }
        "dictionary": {
          "uuid": "e88d66e2-82e3-4699-ab39-e59fe2b902ed",
          "name": "Damage severity"
        },
        "filled_at": "2015-11-20T14:12:03Z"
      },
      {
        "uuid": "127bdd39-efad-4be3-9e07-c5238b78e68d",
        "name": "Notes",
        "field_type": "textarea",
        "data_type": "string",
        "required": false,
        "value": null
      }
    ],
    "version": 5
  }
}
Table 1. Поля job
Поле Тип JSON-тип Может быть null Описание

uuid

UUID

Строка

Нет

Уникальный идентификатор

external_id

Строка

Строка

Да

Внешний идентификатор

external_order_id

Строка

Строка

Да

Внешний идентификатор заказа

serial_no

Целое

Число

Нет

Порядковый номер наряда

status

Строка

Строка

Нет

Состояние наряда

scheduled_at

Дата и время

Строка

Да

Планируемое время начала наряда

scheduled_duration

Длительность

Строка

Да

Планируемая длительность наряда

description

Строка

Строка

Да

Описание наряда. Ограничено 15000 символов

assignee

Исполнитель

Объект

Да

Исполнитель — пользователь или бригада

type

Тип наряда

Объект

Да

Тип наряда

template

Шаблон

Объект

Да

Шаблон

client

Клиент

Объект

Да

Клиент

site

Объект

Объект

Да

Объект

territory

Участок

Объект

Да

Участок

skills

[Навык]

Массив

Нет

Список навыков, требуемых для выполнения наряда

contacts

[Контакт]

Массив

Нет

Список контактов

custom_fields

[Доп. поле]

Массив

Нет

Дополнительные поля наряда

report_fields

[Доп. поле]

Массив

Нет

Поля отчета

possible_resolutions

[Резолюция]

Массив

Нет

Возможные резолюции

resolution

Резолюция

Объект

Нет

Резолюция. Это поле присутствует только в завершенном наряде

version

Целое

Число

Нет

Версия