8 Jul 2024

BuildingConnected Webhooks API

We are delighted to announce the availability of BuildingConnected (BC) Webhook! To automate ETL (Extract, Transform, and Load) workflow that connects with other systems, webhook plays a key role.   In the first set of BC webhooks API, we exposed the following a set of events for opportunity and bid:

  • bid.created : a new bid revision is created.
  • opportunity.comment.created: a new opportunity comment is created.
  • opportunity.comment.deleted: an opportunity comment is deleted.
  • opportunity.comment.updated: an opportunity comment is updated
  • opportunity.created: a new opportunity is created.
  • opportunity.status.updated: an opportunity's status is updated.

autodesk.construction.bc  is the name of the system. 

The API follows the APS Webhook API standard. The usage is similar. You could subscribe one specific event, or events group by wildcard. The BuildingConnected webhook supports 3-legged token only. Note: To work with the APIs, the user must belong to an office with a subscription Bid Board Pro.

The code snippet below shows an example of request body. You specify callbackUrl. The scope will be the company of the logged user.  It also supports to add custom data in hookAttribute. 

{
    "callbackUrl": "http://bf067e05.ngrok.io/callback",
    "scope": {
         "companyId": "{{companyId}}"
    },
    "hookAttribute": {
        "myData": "myDataValue"
    }
}

The callback payload will include the basic data of the relevant entities: e.g. opportunity id for opportunity.created, and bid id for bid.created. opportunity.status.updated will return the new status. To get more detail information about the event object, you may need to call additional BC endpoints.

To obtain comments as a result of opportunity.comment.* events  following two new endpoints are made available :

  • GET:Opportunity/:oppId/Comments
  • GET:Opportunity/:oppId/Comments/:commentId

These return the comments in the given opportunity. The content body is in HTML format. They can be applied within 3rd party custom application. Below shows a sample response: 

{
            "id": "6650063d36f7b10049aaa28d",
            "opportunityId": "6627779ac415eba5996c5723",
            "createdAt": "2024-05-24T03:15:09.417Z",
            "createdBy": "63eaddea4dc87e1cc1ce1793",
            "updatedAt": "2024-05-24T03:16:26.307Z",
            "content": "<div>This is a test of <b>BuildingConnected</b> <i>Webhook</i> API. It supports <u>a few events</u>:</div><ul><li>bid.created  </li><li>opportunity.comment.created</li><li>opportunity.comment.deleted</li><li>opportunity.comment.updated</li><li>opportunity.created</li><li>opportunity.status.updated</li></ul>",
            "userName": "Xiaodong Hotmail"
}

Available Materials: 

Should you have any questions, please contact APS.Help at: https://developer.autodesk.com/en/support/get-help. 

 

Related Article