Aspose.CAD Cloud api.cad scope missing on Free Plan

I have an active Aspose Cloud Free Plan with 150 API calls per month.

My application authenticates successfully using Client Credentials and receives an OAuth token, but the token does not contain the api.cad scope.

Requests to /v3.0/cad/... return:
errorAuthorization — Unauthorized — The authorization data is incorrect.

My application and storage are configured correctly and the dashboard shows my Free Plan as Active.

Can you please enable Aspose.CAD Cloud / api.cad entitlement for my account/application, or advise how this is enabled for the free 150-call plan?

@Morrina,
Hello,
could you please provide your subscription number and e-mail associated with requests, so we can check this on our side? Do you use token generated from https://id.aspose.cloud/connect/token?

############################# email removed for security

@Morrina,
Hello,
we don’t see any issues with the account.
Please specify what you are trying to do, what is the server you use to get token, what is the endpoint, what is the task you are trying to solve. We will try to reproduce the issue.

Thank you for checking the account.

We are integrating Aspose.CAD Cloud into a WordPress/PHP application. The calls are made server-side from PHP, not from the browser.

Our task is to convert uploaded CAD files, primarily DWG and DXF, into GLB/GLTF for 3D rendering inside our application.

For authentication we are using the OAuth client-credentials flow.

Token server:
https://id.aspose.cloud/connect/token

We have also tested the older/fallback endpoint:
https://api.aspose.cloud/connect/token

We successfully receive an OAuth access token from Aspose.

CAD API endpoint:
https://api.aspose.cloud/v3.0/cad

The problem occurs when we then call the Aspose.CAD API using the returned bearer token. The CAD request returns an Unauthorized / errorAuthorization response.

Our diagnostics indicate that the access token is being issued successfully, but it does not appear to include access to the CAD API / api.cad scope or entitlement.

The workflow we are trying to achieve is:

  1. User uploads a DWG or DXF file to our server.
  2. Our PHP server obtains an OAuth token using the Aspose Client ID and Client Secret.
  3. Our server submits the CAD file to Aspose.CAD Cloud.
  4. Aspose converts the file to GLB.
  5. We download the resulting GLB back to our server.

We are not attempting to call the API through JavaScript/CORS. CORS Origin is therefore left blank in the Aspose application settings.

The account dashboard shows the Free Plan as active and API calls are available.

Could you please confirm:

  • whether https://id.aspose.cloud/connect/token is the correct OAuth token endpoint for Aspose.CAD Cloud;
  • whether https://api.aspose.cloud/v3.0/cad is the correct base CAD API endpoint;
  • whether our application should receive an api.cad scope/permission in the OAuth token;
  • and which exact Aspose.CAD REST endpoint/request you recommend for converting a DWG or DXF file to GLB?

If helpful, we can provide the exact HTTP request and sanitized response from our diagnostics, with the Client Secret and access token removed.

@Morrina,

Thank you for all details.

Please use this endpoint to get tokens for CAD requests: https://id.aspose.cloud/connect/token. There is no additional permission for scopes.

I have tried this endpoint https://api.aspose.cloud/v3.0/cad/saveAs/glb with POST, and this one https://api.aspose.cloud/v3.0/cad/glb with PUT, both worked for me. Put the content of the drawing as “drawingData” argument in request.

Here is the verified implementation in C# so you can see arguments for your PHP application.

HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://api.aspose.cloud/v3.0/cad/saveAs/glb");

client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

var drawingFile = System.IO.File.OpenRead(fileName);

using var content = new MultipartFormDataContent
        {
            {
                new StreamContent(drawingFile), "drawingData"
            }
        };

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, client.BaseAddress);
request.Content = content;

HttpResponseMessage response = client.SendAsync(request).Result;

HttpContent responseContent = response.Content;

using (Stream output = System.IO.File.OpenWrite(destFileName))
using (Stream input = responseContent.ReadAsStream())
{
    input.CopyTo(output);
}

The export (both reading and rendering) of 3D items from DXF/DWG is complicated, and we have only some basic implementation there (export as lines only). So probably it is better to start setup using some simple DXF/DWG (with few polylines only for instance) and try 3D content when simple example works.

That worked perfectly - Thank you

1 Like

@Morrina,
glad to hear it worked :slight_smile: