Request

Response

    Update a PCO’s Custom Attributes

    This tutorial demonstrates how to update a PCO’s custom attributes.

    Before You Begin

    Step 1: Get a PCO in BIM 360 Cost Management

    Find the ID of the PCO you want to update by calling GET change-orders/:changeOrder. In this example, assume that the container ID is e94b9bc8-1775-4d76-9b1d-c613e120ccff. Add the include=attributes query string parameter to include the custom attributes in the response.

    Request

    curl 'https://developer.api.autodesk.com/cost/v1/containers/e94b9bc8-1775-4d76-9b1d-c613e120ccff/change-orders/pco?limit=100&offset=0&include=attributes' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0'
    

    Response

    {
            "results": [{
            "id": "1a53c5c0-61b6-11e8-b4c8-f7f2ad363daa",
            "number": "0001",
            "name": "Revised Entrance Layout",
            "scope": "out",
            "type": "",
            "description": "",
            "note": "",
            "...": "...",
            "createdAt": "2018-05-27T13:58:58.844Z",
            "updatedAt": "2018-12-26T05:40:42.665Z",
            "properties": [{
                "name": "Revised Substantial Completion",
                "value": "2020-6-1",
                "propertyDefinitionId": "9240df60-61b5-11e8-9d14-7f96380922a0",
                "...": "...",
            }]
        }],
        "pagination": {
            "totalResults": 1,
            "limit": 100,
            "offset": 0
        }
    }
    
    Show More

    Note the PCO ID (results[0].id) in the first part of the response - 55254a50-44d9-11e9-99d7-79aa05d3109e, and the custom attribute definition ID (9240df60-61b5-11e8-9d14-7f96380922a0).

    Step 2: Update the Custom Attribute Value

    Use the container ID (e94b9bc8-1775-4d76-9b1d-c613e120ccff), PCO ID (55254a50-44d9-11e9-99d7-79aa05d3109e), and custom attribute definition ID (9240df60-61b5-11e8-9d14-7f96380922a0) to call POST property-values:batch-update to update the custom attribute value.

    Request

    curl -v 'https://developer.api.autodesk.com/cost/v1/containers/e94b9bc8-1775-4d76-9b1d-c613e120ccff/property-values:batch-update' -X 'POST' -H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' -H 'Content-Type: application/json' \
    -d '[{associationId: "55254a50-44d9-11e9-99d7-79aa05d3109e", associationType: "FormInstance", propertyDefinitionId: "9240df60-61b5-11e8-9d14-7f96380922a0", value: "2020-06-16T16:00:00.000Z"}]'
    

    For change orders including PCOs, the associationType is FormInstance, and the PCO ID is associationId. For other modules, the associationType is the module name, for example, Budget, or Contract, and the associationId is always the empty UUID 00000000-0000-0000-0000-000000000000.

    Response

    You get the full content of the updated custom attribute value.

    [{
          "name": "Revised Substantial Completion",
          "value": "2020-06-16T16:00:00.000Z",
          "propertyDefinitionId": "9240df60-61b5-11e8-9d14-7f96380922a0",
      "...": "...",
    }]
    

    Multiple custom attributes can be updated altogether.

    Congratulations! You have successfully updated the PCO’s custom attribute value.