Skip to main content

Set Up Asite and ACC Integration Using a Code Block

This article will explain how to enable integration using the Code Block

Updated over a month ago

If you choose to set up integration using the code block option, follow the steps below:

  1. After you click Code Block, enter the required code (JSON Script) in the provided space.

EXAMPLE:

Below is an example of a JSON script with which you can map projects, folders, files, and file attributes for seamless document exchange when integrating using the Code Block option.

[
{
"folders": [
{
"asiteFolderId": "129385968",
"externalFolderId": "urn:adsk.wipemea:fs.folder:co.E8LpqrwRQ6mTn5_qsV5tvg",
"eventType": "dm.version.added"
},
{
"asiteFolderId": "129385968",
"externalFolderId": "urn:adsk.wipemea:fs.folder:co.E8LpqrwRQ6mTn5_qsV5tvg",
"eventType": "dm.version.modified",
"folder-metadata": {
"Attr-Date": "a date",
"Attr-N": "a text number",
"Attr-Dropdown": "a dd",
"Attr-TN": "a text LN",
"Attr-D": "a text decimal",
"Attr-E": "a text email"
}
}
],
"asiteProjectId": "2167425",
"project-metadata": {
"DocStatus": "a DocStatus",
"DocTitle": "Document_Title",
"PurposeOfIssue": "POI",
"DocRef": "a DocRef",
"isPrivate": "private",
"RevisionNotes": "NOTES"
},
"externalProjectId": "b.a079daf9-4b63-4e0a-a8d8-d1486cf77ae9",
"region":"EMEA"
}
]

Below is the description of the above code into logical parts:

  • "asiteFolderId": "129385968" - Here, '129385968' refers to the folder ID in Asite CDE. To get the folder ID of a file in Asite CDE, you can refer to the file's URL when it is open in the Viewer. The value showing opposite 'folderId=' (followed by a '$' sign) is the folder ID of the file open in the Viewer (You can also use a URL decoder service such as https://meyerweb.com/eric/tools/dencoder/ if required).

  • "externalFolderId": "urn:adsk.wipemea:fs.folder:co.E8LpqrwRQ6mTn5_qsV5tvg" - Here, 'urn:adsk.wipemea:fs.folder:co.E8LpqrwRQ6mTn5_qsV5tvg' refers to the folder ID from Autodesk Construction Cloud (ACC). To get the folder ID of a file in ACC, you can refer to the URL of a file when it is opened in the Viewer. The value showing opposite 'folderUrn=' (followed by an '&' sign) is the folder ID of the file open in Viewer.

  • "eventType": "dm.version.added" - Here, 'dm.version.added' indicates that the added event will occur from ACC once the user publishes the file in the folder on Asite CDE as per the folder ID mentioned above.

  • "eventType": "dm.version.modified" - Here, 'dm.version.modified' indicates that the modified event will occur from ACC once the user updates the file attributes in the folder on Asite CDE as per the folder ID mentioned above.

  • "folder-metadata" - Here, 'folder-metadata' refers to the metadata associated with the folder as per the folder ID mentioned above.

  • "Attr-Date": "a date" - Here, 'Attr-Date' refers to the name of a configurable attribute of the 'Date Picker' type in Asite CDE, while 'a date' refers to the date value coming from ACC.

  • "Attr-N": "a text number" - Here, 'Attr-N' refers to the name of a configurable attribute of the 'Textbox' type with the 'Integer' input data type in Asite CDE, while 'a text number' refers to the text number value coming from ACC.

  • "Attr-Dropdown": "a dd" - Here, 'Attr-Dropdown' refers to the name of a configurable attribute of the 'Dropdown list' type in Asite CDE, while 'a dd' refers to the dropdown list coming from ACC.

  • "Attr-TN": "a text LN" - Here, 'Attr-TN' refers to the name of a configurable attribute of 'Textbox' type with 'Letters and Numbers' input data type in Asite CDE, while 'a text LN' refers to the text letters and numbers value coming from ACC.

  • "Attr-D": "a text decimal" - Here, 'Attr-D' refers to the name of a configurable attribute of the 'Textbox' type with the 'Decimal' input data type in Asite CDE, while 'a text decimal' refers to the text decimal value coming from ACC if any.

  • "Attr-E": "a text email" - Here, 'Attr-E' refers to the name of a configurable attribute of 'Textbox' type with 'Email' input data type in Asite CDE, while 'a text email' refers to the text email value coming from ACC if any.

  • "asiteProjectId": "2167425" - Here, '2167425' refers to the project ID in Asite CDE. To get the project ID of a file in Asite CDE, you can refer to the file's URL when it is open in the Viewer. The value showing opposite the 'projectId=' (followed by a '%' sign) is the project ID of the file open in the viewer.

  • "project-metadata" - Here, 'project-metadata' refers to the metadata associated with the project as per the above-mentioned project ID.

  • "DocStatus": "a DocStatus" - Here, 'DocStatus' refers to the file status value in Asite CDE, while 'a DocStatus' refers to the file status value from ACC.

  • "DocTitle": "Document_Title" - Here, 'DocTitle' refers to the document title value in Asite CDE, while 'Document_Title' refers to the document title value coming from ACC.

  • "PurposeOfIssue": "POI" - Here, 'PurposeOfIssue' refers to the value of the purpose of issue of the file in Asite CDE, while 'POI' refers to the purpose of value coming from ACC.

  • "DocRef": "a DocRef" - Here, 'DocRef' refers to the doc ref value in Asite CDE, while 'a DocRef' refers to the field that will be matched from ACC for the corresponding doc ref value.

  • "isPrivate": "private" - Here, 'isPrivate' refers to the privacy status in Asite CDE, while 'private' refers to the privacy status value coming from ACC.

  • "RevisionNotes": "NOTES" - Here, 'RevisionNotes' refers to the revision notes in Asite CDE, while 'NOTES' refers to the revision notes value from ACC.

  • "externalProjectId": "b.a079daf9-4b63-4e0a-a8d8-d1486cf77ae9" - Here, 'b.a079daf9-4b63-4e0a-a8d8-d1486cf77ae9' includes the project ID from ACC starting with a prefix 'b.'. 'b.a079daf9-4b63-4e0a-a8d8-d1486cf77ae9' translates to a project ID of 'a079daf9-4b63-4e0a-a8d8-d1486cf77ae9'.

  • "region":"EMEA" - Here, 'EMEA' refers to the data hosting region from ACC. Currently, only three regions are supported - US, EMEA, and AUS (Read More about regions in ACC).

    2. Click Save Integration to save the entered details.


Did this answer your question?