v1/projects/{projectId}/issues/{issueId}/placements:upsert
Adds a placement to the specified issue, or replaces the issue’s existing placement. Note that Sheet placements are not supported.
For more information about issue pushpins, see the Help documentation.
For the complete workflow, see the Create Issues with File Pushpins tutorial.
Resource Information
| Method and URI | POST https://developer.api.autodesk.com/construction/issues/v1/projects/{projectId}/issues/{issueId}/placements:upsert |
| Authentication Context | User-delegated only (accepts only three-legged access tokens) |
| Required OAuth Scopes | data:write |
| Data Format | JSON |
Request
Headers
| Authorization* string | Must be Bearer <token>, where <token> is a three-legged access token obtained via an Authorization Code flow or a Secure Service Account (SSA) flow.
The SSA flow is designed for headless server-to-server operations. While it functions like a two-legged flow (no user interaction), it is classified as three-legged because it preserves user context. |
| Content-Type* string | Must be application/json |
Request
URI Parameters
| projectId string: UUID | The ID of the project.
Use the Data Management API to retrieve the project ID. For more information, see the Retrieve a Project ID tutorial. You need to convert the project ID into a project ID for the Forma API by removing the “b." prefix. For example, a project ID of b.a4be0c34a-4ab7 translates to a project ID of a4be0c34a-4ab7. |
| issueId string: UUID | The unique identifier of the issue. To find the ID, call GET issues. |
Request
Body Structure
The body content.
| placements* array | The list of placements for the issue. |
| oneOf* array:oneOf | |
| file placement* object | A file placement links an issue to a specific position within a 2D or a 3D model. |
| type* string | The type of the placement.
Possible values: |
| lineageUrn* string | The unique cross-version identifier for the file. |
| createdAtVersion* int | The file version in which this placement was created. When updating, the value must match the existing value (the file version when the issue was first placed). |
| viewable* object | The object containing information about a specific view within a file. |
| guid* string | The GUID of the viewable. |
| viewableId string | It is recommended to include this field if it is available to help identify the correct viewable. Additional identifier specified by file extractors for the viewable within the design application. May be a GUID or arbitrary string. Stability across file versions depends on the file format. |
| name* string | The name of the viewable.
Max length: 1000 |
| is3D* boolean | true if it is a 3D viewable
false if it is a 2D viewable |
| pins* array | The list of pins associated with the placement. Each pin is either a 2D or 3D pin. |
| oneOf* array:oneOf | |
| 3D file pin* object | The pin object containing information about the individual 3D pin. |
| externalId string | An external identifier of the element the pushpin is associated with in the viewable. |
| objectId string | The ID of the element the pushpin is associated with in the viewable. |
| position* object | The coordinates of the pushpin’s position in the viewable. |
| x* number | The x-coordinate of the pushpin’s position in the viewable. |
| y* number | The y-coordinate of the pushpin’s position in the viewable. |
| z* number | The z-coordinate of the pushpin’s position in the viewable. |
| viewerState* object | The viewer state at the time the pushpin was created. You can get the viewer state object by calling viewer.getState(). To restore the viewer instance use viewer.restoreState(). See the Viewer API documentation for more details. |
| uid string: UUID | The unique identifier of the pin. |
| viewableInfo* one of | The object containing version information for the file where the pushpin is positioned. |
| documentVersionUrn* object | The decoded version URN of the document where this pushpin is positioned. |
| documentVersionUrn* string | The decoded version URN of the document where this pushpin is positioned.
To obtain this value from the Autodesk Viewer, get the encoded URN from the viewer model:
Then decode it using base64 decoding, for example in JavaScript:
Note that the encoding may vary (standard base64 versus URL-safe base64), so you might need to decode the URN with fallback handling for different encoding formats. |
| 2D file pin* object | The pin object containing information about the individual 2D pin. |
| position* object | The coordinates of the pushpin’s position in the viewable. |
| x* number | The x-coordinate of the pushpin’s position in the viewable. |
| y* number | The y-coordinate of the pushpin’s position in the viewable. |
| z number | The z-ordering that determines the render order of overlapping pins. |
| uid string: UUID | The unique identifier of the pin. |
| viewableInfo* one of | The object containing version information for the file where the pushpin is positioned. |
| documentVersionUrn* object | The decoded version URN of the document where this pushpin is positioned. |
| documentVersionUrn* string | The decoded version URN of the document where this pushpin is positioned.
To obtain this value from the Autodesk Viewer, get the encoded URN from the viewer model:
Then decode it using base64 decoding, for example in JavaScript:
Note that the encoding may vary (standard base64 versus URL-safe base64), so you might need to decode the URN with fallback handling for different encoding formats. |
| sheet placement - not supported* object | Sheet placements are currently not supported. |
Response
HTTP Status Code Summary
| 200 OK | Success |
| 400 Bad Request | Invalid input |
| 403 Forbidden | The request is valid but lacks the necessary permissions. |
| 404 Not Found | Issue not found |
| 500 Internal Server Error | Internal server error |
Response
Body Structure (200)
| placements array | The list of created placements for the issue. |
| oneOf array:oneOf | |
| file placement object | A file placement links an issue to a specific position within a 2D or a 3D model. |
| type string | The type of the placement.
Possible values: |
| lineageUrn string | The unique cross-version identifier for the file. |
| createdAtVersion int | The file version in which this placement was created. When updating, the value must match the existing value (the file version when the issue was first placed). |
| viewable object | The object containing information about a specific view within a file. |
| guid string | The GUID of the viewable. |
| viewableId string | It is recommended to include this field if it is available to help identify the correct viewable. Additional identifier specified by file extractors for the viewable within the design application. May be a GUID or arbitrary string. Stability across file versions depends on the file format. |
| name string | The name of the viewable.
Max length: 1000 |
| is3D boolean | true if it is a 3D viewable
false if it is a 2D viewable |
| pins array | The list of pins associated with the placement. Each pin is either a 2D or 3D pin. |
| oneOf array:oneOf | |
| 3D file pin object | The pin object containing information about the individual 3D pin. |
| createdAt datetime: ISO 8601 | The date and time the pushpin was created. |
| issueId string: UUID | The unique identifier of the issue the pushpin is associated with. |
| updatedAt datetime: ISO 8601 | The date and time the pushpin was updated. |
| uid string: UUID | The unique identifier of the pin. |
| externalId string | An external identifier of the element the pushpin is associated with in the viewable. |
| objectId string | The ID of the element the pushpin is associated with in the viewable. |
| position object | The coordinates of the pushpin’s position in the viewable. |
| x number | The x-coordinate of the pushpin’s position in the viewable. |
| y number | The y-coordinate of the pushpin’s position in the viewable. |
| z number | The z-coordinate of the pushpin’s position in the viewable. |
| viewerState object | The viewer state at the time the pushpin was created. You can get the viewer state object by calling viewer.getState(). To restore the viewer instance use viewer.restoreState(). See the Viewer API documentation for more details. |
| viewableInfo object | The object containing version information for the file where the pushpin is positioned. |
| documentVersionUrn string | The decoded version URN of the document where this pushpin is positioned. |
| documentVersionId string | Not relevant |
| 2D file pin object | The pin object containing information about the individual 2D pin. |
| createdAt datetime: ISO 8601 | The date and time the pushpin was created. |
| issueId string: UUID | The unique identifier of the issue the pushpin is associated with. |
| updatedAt datetime: ISO 8601 | The date and time the pushpin was updated. |
| uid string: UUID | The unique identifier of the pin. |
| position object | The coordinates of the pushpin’s position in the viewable. |
| x number | The x-coordinate of the pushpin’s position in the viewable. |
| y number | The y-coordinate of the pushpin’s position in the viewable. |
| z number | The z-ordering that determines the render order of overlapping pins. |
| viewableInfo object | The object containing version information for the file where the pushpin is positioned. |
| documentVersionUrn string | The decoded version URN of the document where this pushpin is positioned. |
| documentVersionId string | Not relevant |
| sheet placement - not supported object | Sheet placements are currently not supported. |
Example
Success
Request
curl -v 'https://developer.api.autodesk.com/construction/issues/v1/projects/:projectId/issues/:issueId/placements:upsert' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"placements": [
{
"type": "file",
"lineageUrn": "urn:adsk.wipprod:dm.lineage:0C9edNQuT2SrfoyKQ1Gv_Q",
"createdAtVersion": 1,
"viewable": {
"guid": "24820322-7c54-4a01-93e6-e701749f0345",
"viewableId": "42",
"name": "3D view of the 3rd floor of the building",
"is3D": true
},
"pins": [
{
"externalId": "01a239ce-47cc-4e94-8aa3-2a39866cfc61",
"objectId": "1220",
"position": {
"x": 2,
"y": 3,
"z": 8
},
"viewerState": {
"version": "2.0",
"viewport": {
"isOrthographic": true,
"eye": [
11.93456399701644,
-63.303164503703584,
23.691735672776954
],
"target": [
-1.179143015468064,
-6.361187926162934,
-10.224027244435305
],
"up": [
-0.11265990933995478,
0.4891887482888158,
0.8648711542045641
]
},
"autocam": {
"sceneUpDirection": {
"x": 0,
"y": 0,
"z": 1
},
"sceneFrontDirection": {
"x": 0,
"y": 1,
"z": 0
},
"cubeFront": {
"x": 1,
"y": 0,
"z": 0
}
}
},
"uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"viewableInfo": {
"documentVersionUrn": "urn:adsk.wipprod:fs.file:vf.6wUAJP_jQ7OvQntO43aCrg?version=4"
}
}
]
}
]
}'
Response
{
"placements": [
{
"type": "file",
"lineageUrn": "urn:adsk.wipprod:dm.lineage:0C9edNQuT2SrfoyKQ1Gv_Q",
"createdAtVersion": 1,
"viewable": {
"guid": "24820322-7c54-4a01-93e6-e701749f0345",
"viewableId": "42",
"name": "3D view of the 3rd floor of the building",
"is3D": true
},
"pins": [
{
"createdAt": "2023-10-01T12:00:00Z",
"issueId": "d26c0adb-bb27-4cec-b3ad-bae5ce5a0b29",
"updatedAt": "2023-10-01T12:00:00Z",
"uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"externalId": "01a239ce-47cc-4e94-8aa3-2a39866cfc61",
"objectId": "1220",
"position": {
"x": 2,
"y": 3,
"z": 8
},
"viewerState": {
"version": "2.0",
"viewport": {
"isOrthographic": true,
"eye": [
11.93456399701644,
-63.303164503703584,
23.691735672776954
],
"target": [
-1.179143015468064,
-6.361187926162934,
-10.224027244435305
],
"up": [
-0.11265990933995478,
0.4891887482888158,
0.8648711542045641
]
},
"autocam": {
"sceneUpDirection": {
"x": 0,
"y": 0,
"z": 1
},
"sceneFrontDirection": {
"x": 0,
"y": 1,
"z": 0
},
"cubeFront": {
"x": 1,
"y": 0,
"z": 0
}
}
},
"viewableInfo": {
"documentVersionUrn": "urn:adsk.wipprod:fs.file:vf.6wUAJP_jQ7OvQntO43aCrg?version=4",
"documentVersionId": "5a5f7d98-d043-4a2a-aba2-5c265ae9da9b"
}
}
]
}
]
}