opportunity-project-pairs/{opportunityProjectPairId}
Relinks a project from an opportunity group child that it’s paired with to the group parent. The link between the project and the child opportunity is removed.
This endpoint can be used only when the existing opportunity-project pair has a value of true
for the shouldRelinkGroup
field. This happens when a new child opportunity linked to a project is added to a group already linked to a project, as shown in the following scenario.
Example scenario:
- There are 3 opportunities:
Opp1
,Opp2
, andOpp3
. Opp1
andOpp2
are grouped under parent opportunityGroupA
.- Project
Prj1
is linked toGroupA
. - Project
Prj2
is linked toOpp3
. - You add
Opp3
toGroupA
.
Use PATCH opportunity-project-pairs to relink Prj2
with GroupA
. Prj2
is no longer linked to Opp3
, and Prj1
is no longer linked to GroupA
.
For more information about opportunity-project pairs, see the Manage Opportunity Projects and Pairs tutorial.
Resource Information
Method and URI | PATCH https://developer.api.autodesk.com/construction/buildingconnected/v2/opportunity-project-pairs/{opportunityProjectPairId} |
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
projectId string | The project id to re-link to this opportunity.
It can be from a child opportunity or the same as the current project id. If it
is the same, only Max length: 24 |
Response
HTTP Status Code Summary
200 OK | OK |
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 (200)
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
OK
Request
curl -v 'https://developer.api.autodesk.com/construction/buildingconnected/v2/opportunity-project-pairs/:opportunityProjectPairId' \
-X 'PATCH' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"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"
}