June 9, 2022

Design Automation will URL Decode the Data URI in argument

Recently Design Automation team made an improvement related to Data URI, it will URL Decode the data of URI in argument now, and it applies to all the Design Automation engines including AutoCAD, Inventor, Revit, 3ds Max.

Previously, the Design Automation will not do any URL decode for the URI data, take the 2 input parameters in the following workitem for example:

{
    "activityId": "{{dasNickName}}.{{activityName}}+{{activityAlias}}",
    "arguments": {
        "inputFile": {
            "url": "https://developer.api.autodesk.com/oss/v2/signedresources/XXXXXXXX"
        },
        "inputJson-1": {
            "url": "data:application/json,{'fileName':'%d0%9c_500_%d0%9c%d0%a1%d0%9a_50%20%d0%bf%d0%be%20%d0%b3%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d0%b5.dwg'}"
        },
        "inputJson-2": {
            "url": "data:application/json,{'fileName':'.!@#$%25^()_SpecilalFolder/test01.dwg'}"
        },
        "outputRvt": {
            "verb": "put",
            "url": "https://developer.api.autodesk.com/oss/v2/signedresources/XXXXXXXX"
        }
    }
}
  • inputJson-1 includes a key of fileName, and the value is url encoded.
  • inputJson-2 includes reserved character and url-encoded character mixed.

They will not be decoded while saving to local file, and it can't be read out correctly by the addin unless your plugin decodes it first.   

 

From now on, Design Automation will URL decode the "data" part of the URI when handling the WorkItem payloads.

Most customers should not be affected by this change and don't need to take any action for the existing workflows. This change may help succeed the WorkItems with data URI such as inputJson-1

We now require that clients' Data URI be compliant with rfc2397 and the "data" part of the URI to be URL encoded, especially:

  1. If their WIs start to fail due to unencoded data URI (such as inputJson-2).
  2. Start new workflows with data URI as inputs

 

Posted by

Developer Advocate

Zhong Wu started his career in Autodesk since 2006 on AutoCAD Architecture as a software developer with more than 6 years working experience. After that, Zhong moved to Autodesk Development Network(now is renamed to Forge Partner Development) team as a Developer Advocate mainly focus on the API support/consultant for Maya/MotionBuilder, and started to contribute in Forge evangelism and support with the growing of...

Related Posts