opportunity-project-pairs
Creates a new opportunity-project pair to relink a project from a group child opportunity to its group parent.
When you use POST projects to create a project from an opportunity, it also links the project with the opportunity as a pair.
The paired opportunity might later be grouped under a new group parent opportunity (see the Create and Manage Opportunities tutorial.) The project remains paired with that now-child opportunity. Use this endpoint to remove that pair link and relink the project to the new group parent.
Note that this endpoint cannot be used to link an unlinked project to an opportunity.
Example scenario:
- There are 2 opportunities:
Opp1
andOpp2
. Opp1
andOpp2
are grouped under parent opportunityGroupA
.- Project
Prj1
is linked toOpp1
.
Use POST opportunity-project-pairs to relink Prj1
to GroupA
. Prj1
is no longer linked to Opp1
.
For more information about opportunity-project pairs, see the Manage Opportunity Projects and Pairs tutorial.
Resource Information
Method and URI | POST https://developer.api.autodesk.com/construction/buildingconnected/v2/opportunity-project-pairs |
Authentication Context | user context required |
Required OAuth Scopes | data:write |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via a three-legged OAuth flow. |
Content-Type* string | Must be application/json |
Request
Body Structure
opportunityId string | The ID of a group parent opportunity to which the project identified by projectId should be linked.
Note that this endpoint can be used only to re-link a project from one of the group parent’s children. Max length: 24 |
projectId string | The ID of the project to re-link from a child opportunity to the parent opportunity identified by opportunityId .
Max length: 24 |
Response
HTTP Status Code Summary
201 Created | Created |
400 Bad Request | The parameters of the requested operation are invalid. |
401 Unauthorized | The provided bearer token is not valid. |
403 Forbidden | The user or service represented by the bearer token does not have permission to perform this operation. |
404 Not Found | The requested resource could not be found. |
429 Too Many Requests | Rate limit exceeded; wait some time before retrying. The ‘Retry-After’ header might provide the amount of the time to wait. |
500 Internal Server Error | An unknown error occurred on the server. |
Response
Body Structure (201)
id string | The unique ID of the opportunity-project pair.
Max length: 24 |
createdBy string | The unique user ID of the BuildingConnected user that created the pair.
Max length: 24 |
createdAt datetime: ISO 8601 | The date and time that the pair was created, in ISO 8601 format. |
updatedAt datetime: ISO 8601 | The date and time that the pair was last updated, in ISO 8601 format. |
opportunityId string | The unique ID of the opportunity in the pair. |
projectId string | The unique ID of the project in the pair.
Max length: 24 |
fileSyncingError string | Indicates whether an error has occured in the syncing and describes the error content. |
shouldRelinkGroup boolean | Indicates whether the pair needs to be relinked. This is relevant for grouped opportunities where there may be multiple paired projects within the group.
For more information about this scenario, see PATCH opportunity-project-pairs. Possible values:
|
fileStatus enum:string | The processing status of files being transferred to the project from the linked opportunity.
Possible values: QUEUED , IN_PROGRESS , SUCCESS , FAILED |
Example
Created
Request
curl -v 'https://developer.api.autodesk.com/construction/buildingconnected/v2/opportunity-project-pairs' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"opportunityId": "5fcdcd0b3db0876c669215fb",
"projectId": "5fcdcd0b3db0876c66921af6"
}'
Response
{
"id": "5fcdcd0b3db0876c66921a3a",
"createdBy": "5d8104b87e392d56e1e4b4ca",
"createdAt": "2020-12-07T18:00:00.000Z",
"updatedAt": "2020-12-07T18:00:00.000Z",
"opportunityId": "5fcdcd0b3db0876c66925fb1",
"projectId": "5fcdcd0b3db0876c669253c8",
"fileSyncingError": null,
"shouldRelinkGroup": false,
"fileStatus": "IN_PROGRESS"
}