10 Oct 2018

BIM 360 Docs: API Changes to Access Data in European Data Center

Default blog image

Note: this is a breaking change. If you have a customer who uses BIM 360 Docs in European data center, you will need to modify your code with new endpoints.

BIM 360 Docs recently started in European data center. Unfortunately, due to this change, you, as a developer of application accessing a model in BIM 360 Docs, will need to take regional aspect into consideration and modify the code to access models that are stored in the European data center.

Note that BIM 360 API are already using different US and EU endpoints for some resources, such as Account Administration feature. See documentation. Data Management API is not affected.

The list of affected endpoints

Model Derivative API

The following list of Model Derivative APIs needs to be changed to include regions information explicitly in the endpoints when accessing data in the data center in Europe.

  • POST references
  • GET :urn/thumbnail
  • GET :urn/manifest
  • DELETE :urn/manifest
  • GET :urn/manifest/:derivativeurn
  • GET :urn/metadata
  • GET :urn/metadata/:guid
  • GET :urn/metadata/:guid/properties

e.g.,

for US data center
https://developer.api.autodesk.com/modelderivative/v2/designdata/:urn/manifest

for European data center
https://developer.api.autodesk.com/modelderivative/v2/regions/eu/designdata/:urn/manifest

Viewer

For Viewer, if you are using v7.26 and earlier, you will need to specify ‘derivativeV2_EU’ as an option parameter in initialization when viewing a model uploaded to BIM 360 Docs in European data center.   

When using ViewingApplication (from this tutorial) you will need to determine if the bucketKey is from EMEA or US. Start by base64 decoding the URN, then check if it contains urn:adsk.wipemea:xxx (for EMEA) or urn:adsk.wipprod:xxx (for US).

In your viewer code, you may try as below to make it work for both US and European region: 

  var options = {
    env: 'AutodeskProduction',
    getAccessToken: getForgeToken,
    api: 'derivativeV2' + (atob(urn.replace('_', '/')).indexOf('emea') > -1 ? '_EU' : '')
  };
  var documentId = 'urn:' + urn;
  Autodesk.Viewing.Initializer(options, function onInitialized() {
      // rest of code here…
  });

where the atob JavaScript function decodes base64 string. ‘replace’ is required as Forge uses _ (underscore) instead / (forward slash). The code sets the api option to:

  • derivativeV2 (for US)  
  • derivativeV2_EU (for EMEA).

We’ll be updating the SDK shortly. 

2/5, 2021 update: there has been an enhancement in the viewer v7.27. The viewer switches to EU endpoint if the decoded urn pattern matches EU urns. If you are using the latest viewer, it should work without EMEA option explicitly specified.  

Related Article