> For the complete documentation index, see [llms.txt](https://annotationdocs.telusinternational.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://annotationdocs.telusinternational.com/image-segmentation/get-job-results.md).

# Get job results

## JOB RESULT

<mark style="color:blue;">`GET`</mark> `https://api.playment.io/v1/projects/:project_id/jobs/:job_id`

This endpoint allows you to get the annotations created on a job.

#### Path Parameters

| Name        | Type   | Description                                                                              |
| ----------- | ------ | ---------------------------------------------------------------------------------------- |
| job\_id     | string | ID of the job. You would have received this ID in the response when you created the job. |
| project\_id | string | ID of the project where the job was created                                              |

#### Headers

| Name      | Type   | Description                |
| --------- | ------ | -------------------------- |
| x-api-key | string | API key for authentication |

{% tabs %}
{% tab title="200 Job results successfully retrieved." %}

```javascript
{
    "data": {
        "project_id": "905ea3ee-6f62-4bb7-8c31-471e486d9202",
        "reference_id": "001",
        "job_id": "3f3e8675-ca69-46d7-aa34-96f90fcbb732",
        "batch_id": "468b6ae3-e98d-4d08-9427-b6e7a016054c",
        "status": "completed",
        "work_flow_id": "51bb440c-f0ed-4286-8984-ea399cbc1f9w",
        "priority_weight": 5,
        "tag": "2aae1234-acac-1234-eeff-12a22a237bbc",//tag is the workflow_id for the job  
        "result": "https://playment-data-uploads.s3.ap-south-1.amazonaws.com/sample-result.json"
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}

## ATTACHMENT

<mark style="color:blue;">`GET`</mark> `https://api.playment.io/v1/attachments?url=:result_url`

The *result\_url* (`data.result`) returned by the GET Job result API is a private URL (Well, it's public till 15th July 2021, after which we'll enforce it to be private). You need to use this Attachment access API to securely fetch the results. Please refer to the Attachment Access API document for more detail.

#### Path Parameters

| Name        | Type   | Description                                   |
| ----------- | ------ | --------------------------------------------- |
| result\_url | string | Result URL returned by the GET job result API |

#### Headers

| Name      | Type   | Description                |
| --------- | ------ | -------------------------- |
| x-api-key | string | API key for authentication |

{% tabs %}
{% tab title="200 " %}

```
The API will redirect to a signed URL of the attachment
```

{% endtab %}
{% endtabs %}

## Result Object

{% tabs %}
{% tab title="Simple Segmentation" %}

```javascript
{
  "legend": {
    "#fdffd34": "Car",
    "#f23334": "Sky",
    "#fd2d34": "Tree" 
  },
  "url": "https://playment-data-uploads.s3.ap-south-1.amazonaws.com/clients/e81bddc9-e39c-4a7f-bef4-caee6f757009/projects/6f5ed111-1a46-4e06-8d72-c0dec50ac0b7/batch_export_result/0f0abfb5-4c5f-4838-a89e-92d5234b0b09/576d8391-0ce5-4cd4-969a-f3806e1cf2f4/source.png"
}
```

{% endtab %}

{% tab title="Instance Aware Segmentation" %}

```javascript
{
  "legend": {
    "#00c537": "car # 1",
    "#01d9fc": "pedestrian # 1",
    "#fac1c2": "pedestrian # 2",
    "#fb0379": "pedestrian # 3",
    "#fcbe92": "car # 2",
    "#fda7df": "vegetation"
  },
  "instances": [
          {
            "_id": "8037614b-b5b9-420b-8e82-d601b1a7f276",
            "color": "#00c537",
            "index": 1,
            "value": "car # 1",
            "class_id": "f0443067-b6a5-4eae-a743-c967d606bb01",
            "attributes": []
          },
          {
            "_id": "bc3a8010-82cc-40cc-bac0-9a1511b5ea0c",
            "color": "#fcbe92",
            "index": 2,
            "value": "car # 2",
            "class_id": "f0443067-b6a5-4eae-a743-c967d606bb01",
            "attributes": []
          },
          {
            "_id": "0037614b-b5b9-420b-8e82-d601b1a7f276",
            "color": "#01d9fc",
            "index": 1,
            "value": "pedestrian # 1",
            "class_id": "00443067-b6a5-4eae-a743-c967d606bb01",
            "attributes": []
          },
          {
            "_id": "1c3a8010-82cc-40cc-bac0-9a1511b5ea0c",
            "color": "#fac1c2",
            "index": 2,
            "value": "pedestrian # 2",
            "class_id": "00443067-b6a5-4eae-a743-c967d606bb01",
            "attributes": []
          },
          {
            "_id": "037614b-b5b9-420b-8e82-d601b1a7f276",
            "color": "#fb0379",
            "index": 3,
            "value": "pedestrian # 3",
            "class_id": "00443067-b6a5-4eae-a743-c967d606bb01",
            "attributes": []
          },
          {
            "_id": "7c3a8010-82cc-40cc-bac0-9a1511b5ea0c",
            "color": "#fda7df",
            "index": 0,
            "value": "vegetation",
            "class_id": "4443067-b6a5-4eae-a743-c967d606bb01",
            "attributes": []
          }
          ],
  "url": "https://playment-data-uploads.s3.ap-south-1.amazonaws.com/clients/e81bddc9-e39c-4a7f-bef4-caee6f757009/projects/6f5ed111-1a46-4e06-8d72-c0dec50ac0b7/batch_export_result/0f0abfb5-4c5f-4838-a89e-92d5234b0b09/576d8391-0ce5-4cd4-969a-f3806e1cf2f4/source.png"
}
```

{% endtab %}
{% endtabs %}

To access the PNG mask (`url` in the result object), you will need to use the GET Attachment API.

The mask is a PNG file with four 8-bit channels. The first 3 channels are R, G & B respectively. These can be used to obtain a hex code for any pixel, which then maps to a class or instance based on the`legend` object.

![](/files/-MSbMASFRkGxrI9VPUQX)
