0

Here I am again trying to use the Design Automation SDK and I get this error when I try to retrieve bundle aliases, versions or other information that require the id.

I am testing that using one of the existing appbundles available...

public static async Task<dynamic> GetAppBundleVersionsAsync(ForgeService service, Token token, string id)
    {
        try
        {
            if (token.ExpiresAt < DateTime.Now)
                token = Get2LeggedToken();

            AppBundlesApi appBundlesApi = new AppBundlesApi(service);
            Dictionary<string, string> headers = new Dictionary<string, string>();
            headers.Add("Authorization", "Bearer " + token.AccessToken);
            headers.Add("content-type", "application/json");

            var aliases = await appBundlesApi.GetAppBundleVersionsAsync(id, null, null, headers);

            return aliases;
        }
        catch (Exception ex)
        {
            Console.WriteLine(string.Format("Error : {0}", ex.Message));
            return null;

        }
    }

Almost thinking to go to my previous RestSharp implementation :)

1 Answers1

0

There are 2 kinds of IDs:

  1. Fully qualified (string in format owner.name+alias)
  2. Unqualified (just name)

You are trying to list versions of your own AppBundle, so you need to use Unqualified. It seems your ID is fully qualified form.

For more info look at API documentation description of endpoint id parameter you are using https://forge.autodesk.com/en/docs/design-automation/v3/reference/http/design-automation-appbundles-id-versions-GET/#uri-parameters

  • I need more information. Can you attach request and response? It can be done sometimes using charlesproxy (https://www.charlesproxy.com/). You can also ping me on michal.vasicek at autodesk.com. – Michal Vasicek Dec 10 '19 at 11:09