SVF POST job file conversion failure - autodesk

A friend and I are following the Autodesk Viewer tutorial here:
https://developer.autodesk.com/en/docs/viewer/v2/tutorials/basic-viewer/
We've both completed all the previous steps except for the very last of using the APIs POST job endpoint to send a base64 encoded urn off to the Model Derivative API for conversion to a SVF file so that Autodesk's Viewer may use it.
This is what I'm using to send the POST job request:
curl -X 'POST' -H 'Authorization: Bearer cywr9WWu8kml3rQIVnPDohFDsoRl' -H
'Content-Type: application/json' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job'
-d '{"input": {"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXl0ZXN0YnVja2V0dGVzdDIvZ2lyaV9zaXJfY29weTEucnZ0"},
"output": {"formats": [{"type": "svf","views": ["2d","3d"]}]}}'
and this is the APIs response:
{"type":"manifest","hasThumbnail":"false","status":"failed","progress":"complete",
"region":"US","urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXl0ZXN0YnVja2V0dGVzdDIvZ2lyaV9zaXJfY29weTEucnZ0",
"derivatives":[{"name":"giri_sir_copy1.rvt","hasThumbnail":"false","status":"failed",
"progress":"complete","messages":[{"type":"error","code":"Revit-InternalError",
"message":"<message>We have encountered some issues while preparing the file for viewing.
Please contact support for assistance.</message>"},{"type":"error",
"message":"Unrecoverable exit code from extractor: -1073741831",
"code":"TranslationWorker-InternalFailure"}],"outputType":"svf"}]}
Any insights is greatly appreciated.

Summarizing the comments on the question: here is the link to the sample running and source code (postJob function).
Please note this sample is storing the file directly under the developer account (OSS), not under the user account (Data Management), it's an important difference! The first uses 2-legged token, the second uses 3-legged token. Data Management contains some abstractions/metadata to organize the files, like hubs, projects and folders, but ultimately stores on OSS. Depending on the way it was stored, you need different tokens/permissions to read/write it.

Related

How do I save a historical (past) dataset in Foundry

I want to save a version of my dataset called (order_clean). But not the current version. The version I want to save is from the past. I understand this is a historical transaction that still exists within my retention policy window. How would I be able to do this?
This can be done via an API call and hitting a specific endpoint.
This answer assumes a working knowledge around authorization tokens and curl requests:
Obtain the desired dataset’s RID (Example in screenshot below), as well as the transaction ID of the transaction corresponding to the version of the dataset you want.
[
Create a new branch in your specific dataset by running a curl request populated as follows:
curl -X POST -H "Content-type: application/json" -H "Authorization: Bearer YOUR_AUTH_TOKEN" "STACK_URL/foundry-catalog/api/catalog/datasets/YOUR_DATASET_RID/branchesUnrestricted2/NEW_BRANCH_NAME" -d '{"parentRef": "YOUR_TRANSACTION_ID", "parentBranchId": "master"}'
Replace YOUR_AUTH_TOKEN, STACK_URL, YOUR_DATASET_RID, NEW_BRANCH_NAME and YOUR_TRANSACTION_ID with appropriate values. Short lived authentication token can be generated following these instructions.
Save the branch into a new dataset with a transform in a Code Repo, specifying the Input with the path to the dataset as well as the new branch’s name from #2.

Is there a way to get a propertiesUrl from Autodesk Forge's Model Properties API that is not pre-signed?

I am writing a Dynamo script to extract the properties out of all of the models in my modelset in BIM 360. Some of the files (notably the ones with more objects) will give me a pre-signed propertiesUrl value that looks like this:
https://bim360-nucleus-production-us-east-1-temporary-index.s3.amazonaws.com/36174d28-fbd6-4146-a3af-3f3a7bb8ec52/index/v2/indexes/5JAa5g6Nk-t5KQsgFe5OJA/properties.ldjson.gz?X-Amz-Expires=60&X-Amz-Security-Token={{token_value}}-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={{Credential_value}}/20220509/us-east-1/s3/aws4_request&X-Amz-Date=20220509T223945Z&X-Amz-SignedHeaders=host&X-Amz-Signature={{Amz_Signature_Value}}
This pre-signed URL has been troublesome because it will expire within 60 seconds of being issued and Dynamo is having trouble making the requests on time, or because I will get a network transport error when using the DynaWeb package (only 1/3 requests are made successfully):
Dynaweb Network Transport Error
When I try using Dynamo's OOTB node "Web Request", it will give me values that contain characters that aren't even close to what the response should be.
Dynamo Web Request OOTB Response
Is there a way to circumvent the need for a pre-signed url for the "propertiesUrl" endpoint? I can't find anything in the API in how to download the properties from the indices besides what is detailed here (which shows how to get properties with a Bearer token, but not how to opt out of a pre-signed url format):
https://forge.autodesk.com/en/docs/acc/v1/reference/http/index-v2-index-properties-get/
curl -v 'https://developer.api.autodesk.com/construction/index/v2/projects/cd743656-f130-48bd-96e6-948175313637/indexes/da39a3ee5e6b4b0d/properties' -H 'Authorization: Bearer <token>'

"No access to API product" error when trying to reach Data Connector API

I'm experiencing issues when trying to call the Data Connector API via Postman.
When executing the POST request to submit a data request, Postman returns the following error:
"developerMessage": "The client_id specified does not have access to the api product",
"moreInfo": "https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/error_handling/",
"errorCode": "AUTH-001"
Here is what I've tried:
I have created a Forge app which has access to all APIs.
The user has Executive Overview permissions within the account (which has many projects).
I call the API using a 3-legged auth token with data:read, data:write and data:create scopes.
This is the code I'm using (exported from Postman):
curl --location --request POST 'https://developer.api.autodesk.com/data-connector/v1/accounts/<ACCOUNT_ID>/requests' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <BEARER_TOKEN>' \
--data-raw '
{
"description": "Test Extract",
"scheduleInterval": "ONE_TIME",
"effectiveFrom": "2021-01-30T12:00:00Z",
"serviceGroups": ["admin", "checklists", "dailylogs", "issues", "locations", "submittals", "cost", "rfis"]
}'
Your help would be highly appreciated. Thanks!
Jro, Simon, Data Connector API is now accessible. Could you give it a try if it can work at your side? Thank you for your patience and any feedback!
I have the exact same issue as yours, I don't know if the API is really public or not.
Hope that someone from Adesk forge team could answer us.
yes, this API is public beta now. We are working with engineer team and will get back to you soon. Our apology for the issue!

Unable to exchange `code` for Salesforce Marketing Cloud token

I am trying to exchange a Salesforce Marketing Cloud (SFMC) authorization_code for an access_token per the docs here: https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/access-token-app.htm
curl https://{my_subdomain}.auth.marketingcloudapis.com/v2/token \
--request POST \
--header "Content-Type: application/json" \
--data '{"grant_type": "authorization_code", "code": "{{my_code}}", "client_id": "{{my_client_id}}", "redirect_uri": "https://127.0.0.1:80/", “client_secret: “{{my_client_secret}}”, "scope": "audiences_read list_and_subscribers_write offline"}'
Yet it continually gives me the following error:
{"documentation":"https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm","errorcode":0,"message":"Bad Request"}%
I have no idea where I am going wrong, any help is appreciated.
I was seeing "correct" errors when I was using an expired code and when my client_id and/or client_secret were wrong, but nothing after I pasted in the correct values. Perhaps it is my scopes?
According to the docs linked in the error code, The token was not found in the request, or it is invalid or expired.. This is the only error code that has customcode == 0. It is strange since I am trying to get a token, not pass one in, and that error code is associated with a 401, which may or may not be what I am receiving back.
It turns out my client_secret in my data was using the incorrect double quote. It was a slanted double-quote. I discovered this when I tried using Python3 instead of cURL and was converting my JSON above into JSON to pass to the requests library. I was able to successfully get a token.
So the answer is, the above is correct, just watch your encodings!

Box.com API Get Information About a Folder - Stops working

Simple and quick question :-)
My application (https://www.box.com/services/rubibox) stops working. I use this request for retrieve items in folder http://developers.box.com/docs/#folders-get-information-about-a-folder and this request stops working yesterday. Is maintance on Box.com Apiv2 or request was removed from Apiv2?
PS: I know that is possible to use http://developers.box.com/docs/#folders-retrieve-a-folders-items but this is not good for me because not contain current folder informations.
Thanks
Due to a recent API change a call to /folders no longer includes the item_collection by default. You must now ask for the item_collection in the request:
curl https://api.box.com/2.0/folders/FOLDER_ID?fields=item_collection
-H "Authorization: Bearer ACCESS_TOKEN"