Jobs

Placing an order

POST /product_api/v1/jobs/order

Place an order for a product intention, subsequently creating a job.

Request JSON Object:
 
  • uuids (string[]) – Array of uuids of product intentions for which orders need to be placed.
Response JSON Array of Objects:
 
  • uuid (string) – Product intention uuid this job is for.
  • job (object) – Object describing the created job. Has a uuid-field.
Status Codes:
  • 200 OK – yields a list of product intentions.
  • 400 Bad Request – when an invalid set of uuids was provided.

Example request:

POST /product_api/v1/jobs/order
Host: planviewer.nl
Accept: application/json
Content-Type: application/json
{
  "uuids": ["0fe30323-a86e-4048-a7e7-6d60c3365dcb"]
}

Example response:

[
  {
    "uuid": "0fe30323-a86e-4048-a7e7-6d60c3365dcb",
    "job": {
      "uuid": "9dee3afd-3079-47e0-91f1-ab6e1d58f11a"
    }
  }
]

Retrieving status

GET /product_api/v1/jobs/status

View the status of a set of jobs.

Parameters:
  • uuids[] (string) – Uuid of job.
Response JSON Array of Objects:
 
  • uuid (string) – Uuid of job.
  • status (string) – Status of job, either initial, in_progress, finished or error.
  • progress (object) – With fields current and total. Absolute number of steps until completion. Can be used to create a progress bar. Each step can take a variable amount of time. The number of steps and the time spent in each step varies for each product intention.
Status Codes:
  • 200 OK – yields a list of jobs and their status.
  • 400 Bad Request – when an invalid set of uuids was provided.

Example request:

GET /product_api/v1/jobs/status?uuids%5B%5D=9dee3afd-3079-47e0-91f1-ab6e1d58f11a
Host: planviewer.nl
Accept: application/json

Example response:

[
  {
    "uuid": "9dee3afd-3079-47e0-91f1-ab6e1d58f11a",
    "status": "finished",
    "progress": {
      "current": 6,
      "total": 6
    }
  }
]

Retrieving result

GET /product_api/v1/jobs/retrieve/(string: uuid)

Retrieve the result of a job.

Parameters:
  • uuid (string) – Uuid of job.
Status Codes:
  • 200 OK – yields the result of the job as a downloadable file.
  • 403 Forbidden – you are not authorized to retrieve the result of this job.
  • 404 Not Found – job did not finish (successfully).

Example request:

GET /product_api/v1/jobs/retrieve/9dee3afd-3079-47e0-91f1-ab6e1d58f11a
Host: planviewer.nl

Example response:

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 1429793
Content-Transfer-Encoding: binary
Content-Disposition: attachment; filename="20180111_test_example_product_castellastraat_26_6512ex_nijmegen_nl_imro_0268_fbpparkeren_vg01.pdf"