Uploading a file to the plans folder in BIM360Docs - autodesk-forge

I'm new to using the data management API to gain access to BIM360Docs, I've successfully downloaded a file from any folder and I can upload to the project files folder, however the issue lies with uploading to the plans folder, all the API calls seem happy and appears to work, but when I check the actual BIM360Docs website it's not there, when I use the API call to display a folders contents it is there, so it appears to be uploading correctly yet isn't visible for some reason?
Here it is being uploaded successfully:
Here it is being visible using the get folder contents API call but not in docs:
So it is there and I can download it and everything is hunky dory I just can't see it on the website.
PS I'm using the step by step guide on the forge site (I'm unable to link as I don't have enough rep).

Can you tell me to what folder location are you uploading? I'm thinking maybe you are not posting the file to the right location, and that is why you can download it only. In that sense you are correctly creating the storage location, the problem is you are probably uploading your file to the wrong folder. Something I can suggest is the following, get a list of all the available folder within the root folder.
// Get Folder
curl -X GET -H "Authorization: Bearer YOURTOKEN" "https://developer.api.autodesk.com/data/v1/projects/BIM360ACCOUNTID/folders/urn%3Aadsk.wipprod%3Afs.folder%3AYOURROOTFOLDER/contents"
This will give you back a response JSON of all the folder within your Doc Project. Find the ID of the Plans Folder and continue with the following steps using that folder identifier.
//Step 3: Create a storage location
//Step 4: Upload a file to the storage location
//Step 5: Create the first version of the uploaded file
If everything goes correctly you should be able to see your plans in that location now. Please let me know how everything goes with this. Also check that you have the right Scopes setup in your token that the following ones are included scope= account:read account:write
Also that you have the right permissions within your Docs project to upload.

Related

Can you save an image in angular without the backend?

I want to save an image in angular's Assert folder or in a folder created by me. I occupy the input file and a button, nothing more when I save the selected image, I want it to be uploaded or copied to said folders or folder. Can this be done without the backend?
I have been looking for information and watching videos but most of them either use firebase or some other service, I just want it locally. Please, your help would help me a lot.
If I understand your question correctly, you are asking if, at runtime, you can create a file in your Angular applications' 'assets' folder.
This is not possible, because the 'assets' folder is a compile-time artifact. It only exists in your source code tree. In the compiled application, the assets folder does not exist.
Furthermore, when the folder exists, it only does so on the computer on which you wrote the application. The user is running it in their web browser, which is generally running on their computer, not yours.
Now, if you are just asking if you can save a file on the user's computer, take a look at File Save functionality in Angular

Upload multiple JSON files but not all at once on IPFS using moralis

I want to create NFT’s . So i want all json files in directory (/ipfs/CID/1.json,2.json,3.json) but i dont want want to reveal them instantly thats why I will upload only that json files that i want to reveal instantly and then add json files in ipfs to reveal NFTs later.
I want to upload multiple json files on IPFS but not all at once . Moralis uploadFolder working fine but when it try to upload another .json file its parent hash is different.
Example :-
I upload 2 json file in /json folder then moralis upload folder returns me with
/ipfs/CID/1.json
/ipfs/CID/2.json
in this case CID is same and that what i want but when i upload another 3.json file it returns me with another CID
/ipfs/NEW CID/3.json
We can’t use decentralized storage like IPFS, because the URIs in IPFS are hashes of unique pieces of content and we can’t have completely unique URIs for every token in ERC1155.
Refer:- https://rameerez.com/problems-and-technical-nuances-of-nft-immutability-and-ipfs/
you will have to send different requests
If you send it on request moralis will return same base url
I faced the same issue, I came up with a solution, I wrote a script which read images and json from a file structure and upload images to ipfs
you can see my code
https://github.com/RajaFaizanNazir/bulk_IPFS_pin_differentCID
if you face any issue or confusing, feel free to ask me

show linked files in autodesk forge viewer

i am trying to make auto-desk forge viewer.
using this link Forge & ASP.NET: from zero to hero in 30 minutes
and it works fine with single revit file.
now i want to view revit document that has linked document and i found this post How to Set References with Revit Files for View and Data API
but i think it is an old version of api.
so i don't know how to apply these steps in the viewer code.
any help
A zipped file which is contained the host RVT file and corresponding linked files can help you archive this goal. After uploading this ZIP file to the Forge DM, you have to make sure that ‘compressedUrn: true’ and ‘rootFilename: {your host RVT filename with the sub filename .rvt}’ your input field of the job configuration body while submitting your translation job. Please refer here for the details: https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/
Some more info:
If you do not want to manage the reference, while simply count on Forge detects the reference automatically, the choice is what Eason mentioned: package all files in an zip, upload, and ask Forge Post Job service to translate the zip. You only need to specify the root file.
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/
This blog tells more:
https://forge.autodesk.com/cloud_and_mobile/2016/07/translate-referenced-files-by-derivative-api.html
If you want to manage the reference, e.g. in one time, you have uploaded all files of one version or only a few files of the package. While after some time, some files need to be updated, or are not referred anymore, but it is unnecessary to upload all related files again (as in #1, upload zip again).
In such scenario, the choice is, firstly, set reference manually by another Forge service (Set Reference):
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-references-POST/
next, ask POST Job service to translate:
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/
As of 1/2020 Autodesk has said that they do not support reference endpoint when exporting to SVG so zip file is the only supported method currenty.

Drive api - How to navigate to my working directory?

I am super new to using API's. I am trying to turn the drive api on and the final step is
Click the file_download (Download JSON) button to the right of the client ID.
Move this file to your working directory and rename it client_secret.json.
I already downloaded the file (JSON) and it's on my hard drive but I can't seem to navigate to my "working directory". Where is it? and how can I get to it from my "Api and services - Dashboard"
I found the answer in the chapter 'Authentication with OAuth' of google-api-php-client.
Set the path to these credentials using Google_Client::setAuthConfig:
$client = new Google_Client();
$client->setAuthConfig('/path/to/client_credentials.json');
You can put the file whatever you want, but only set the path in the mentied place.

Uploading a file to storage location

I'm getting stuck on uploading a file via the data management API to a BIM 360 storage location, specifically the last step I've been following the step by step guide on the forge site here and saw an answer here however using postman copying and pasting it gets stuck on the final step "update the version of the file" every other step returns correctly however the last one gives me an error 400 BAD_INPUT response, not sure how to format the code and response so i just hosted it here
any help will be appreciated thank you!
I just tested with the BIM360 storage location, and it works good to me, there are a couple of issues you may need to keep in mind as follow:
Since you are using BIM360 hub, so when you try to create the first version of the uploaded file as you described, please use the correct extension type in the POST body, for BIM360, should be items:autodesk.bim360:File and versions:autodesk.bim360:File as follow:
When you try to create a storage under a folder using POST projects/:project_id/storage, in the POST body, you need to specify the folder, please make sure to use the correct folder that allow types of "items:autodesk.bim360:File", for example, the following folder is the root folder of my project, and it only allow the folder of "folders:autodesk.bim360:Folder", if you create a storage under this folder, you will get 403 forbid error.
But this folder should be Ok: