Search code examples
autodeskforgeautodesk-bim360

Unable to complete Workato recipe due to 2-legged token error


I am in workato, and have a recipe that parses a CSV when there is an update to the CSV. Once detected, the recipe extracts the file contents, and is intended to compare those contents to the Companies extracted from the Autodesk Construction Cloud account.

Prior to extracting the Companies, I obtain a 2-legged oauth token per this article: https://forge.autodesk.com/en/docs/oauth/v1/reference/http/authenticate-POST/

However, when running the request to extract the companies, I am given an error stating "403 Forbidden: {"code":1003,"message":"Only support 2 legged access token."}"

Following this article: https://forge.autodesk.com/en/docs/bim360/v1/reference/http/companies-GET/

My input request comes out as:

{
response_type: json,
path: https://developer.api.autodesk.com/hq/v1/accounts/[my account id (yes, I trimmed the "b.")]/companies,
output: [{"name":"id","type":"string","optional":false,"control_type":"text"},{"name":"name","type":"string","optional":false,"control_type":"text"}],
request_headers:  [
 {
name: Authorization,
value: Bearer [access_token gained from previous step]
}
],
Action name: GET Companies,
Method: get
}

Solution

  • The solution was not to use the BIM 360 connection but instead to set up a custom HTTP connection. I used that connected to obtain the 2-legged token, and then used the connection again to place the get request that had failed previously.