# 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.&#x20;

#### 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="Point Cloud Segmentation" %}

```javascript
{
  "annotation_data": {
    "annotations": [
      {
        "_id": "14e4bd90-6bdc-4571-87e1-adf41908b0ed",
        "_isStationary": false,
        "attributes": {},
        "class_id": "24aaea97-002d-41f1-9632-ce36b829445a",
        "color": "rgb(71, 153, 193)",
        "frame_id": "0",
        "grouping_config": null,
        "label": "Vehicle",
        "label_key": 1,
        "sensor_id": "",
        "text": "Vehicle",
        "track_id": "bce3dd47-0938-4fd7-963b-47e459fda54e",
        "type": "segmentation3d"
      }
    ],
    "frames": [
      {
        "_id": "0"
      }
    ],
    "groups": null,
    "masks": [
      {
        "_id": "8feec956-0d5c-4d3c-b8be-b03d1c8f23a9",
        "frame_id": "0",
        "label_url": "https://xyz.s3.com/123.txt",
        "sensor_id": "18158562",
        "type": "segmentation3d",
        "url": ""
      }
    ],
    "sensors": [
      {
        "sensor_id": "18158562",
        "sensor_type": "CAMERA"
      }
    ],
    "tracks": [
      {
        "_id": "bce3dd47-0938-4fd7-963b-47e459fda54e",
        "attributes": null,
        "color": "rgb(71, 153, 193)",
        "grouping_config": null,
        "label": "",
        "label_id": null,
        "state": "",
        "type": ""
      }
    ]
  },
  "sensor_data": {
    "frames": [
      {
        "ego_pose": {
          "heading": {
            "w": 0.979,
            "x": 0,
            "y": -0.02,
            "z": 0.202
          },
          "position": {
            "x": -40,
            "y": -8,
            "z": -1
          }
        },
        "frame_id": "0",
        "sensors": [
          {
            "data_url": "https://xyz.s3.com/123",
            "original_url": "https://xyz.s3.com/123.jpg",
            "sensor_id": "front_center_rgb",
            "sensor_pose": {
              "heading": {
                "w": 0.98,
                "x": 0,
                "y": -0.05,
                "z": 0.189
              },
              "position": {
                "x": -40,
                "y": -8,
                "z": -1
              }
            }
          }
        ]
      }
    ],
    "sensor_meta": [
      {
        "camera_model": "brown_conrady",
        "id": "18158562",
        "intrinsics": {
          "cx": 950,
          "cy": 500,
          "fx": 1000,
          "fy": 1050,
          "k1": 0.31,
          "k2": -0.024,
          "k3": 0.0017,
          "k4": 0,
          "p1": -0.000466,
          "p2": 0.0002909,
          "scale_factor": 0,
          "skew": 0
        },
        "modality": "camera",
        "name": "front_center_rgb",
        "primary_view": false,
        "state": "editable"
      },
      {
        "id": "18158562",
        "modality": "lidar",
        "name": "front_lidar",
        "primary_view": true,
        "state": "editable"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

To access the PCD mask (`url` in the result object), follow these steps :

1. From the "Frames" object, get the "frame\_id".
2. Go to "Masks" object, and locate the "frame\_id" property with the value needed (from step 1).
3. The "frame\_id" property in "Masks" object will have a "label\_url" attribute.
4. Use the GET Attachment API with the url obtained from "label\_url" attribute.
5. This will generate a Mask file, similar to the sample below.

{% tabs %}
{% tab title="Sample Mask File" %}

```c
[16, 58, 58, 58, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 1, 58, 1, 1,
58, 1, 1, 58, 1, 1, 58, 1, 1, 58, 1, 1, 58, 1, 1, 1, 58, 1, 1, 1, 11, 1, 1, 1,
11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1,
11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1,
11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1, 11,
1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 1, 4, 4, 1, 4, 1, 4, 4, 1, 4, 4, 1, 4, 1, 4,
1, 4, 4, 4, 1, 4, 4, 4, 1, 4, 1, 4, 1, 4, 1, 1, 4, 1, 1, 1, 1, 4, 1, 1, 1, 1, 4,
1, 1, 1, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 4, 1, 4, 4,
1, 4, 1, 4, 4, 1]
```

{% endtab %}
{% endtabs %}

In the annotation list, each class is associated with a distinct label key, which corresponds to a mask within the array. This label key is aligned with the points in the Point Cloud Data, ensuring that the label key is ordered at the same index as the corresponding point in the Point Cloud Data.
