The BIM 360 Field API documentation is available here: https://bim360field.autodesk.com/apidoc/index.html.
General Workflow
Using Library API as an example, here is the general workflow for using the BIM 360 Field APIs:
- Authenticate with BIM 360 Field using the /api/login method. This method uses BIM 360 Field credentials and returns an authentication ticket. This ticket must be passed to all subsequent requests as the ticket parameter.
- If you don't already know your project's unique identifier, call the /api/projects method. This method returns a list of all projects that the authenticated user is on. Pass the project_id value to the project_id parameter of subsequent API calls.
- To get the library's folder structure, call /api/library/all_folders.
- To get a list of files in a directory, call /api/library/all_files. Optionally, specify a directory name, either as a POST parameter or in the URL (for example, /api/library/all_files/Plans).
- To retrieve a file, use /api/library/file. Depending on the parameters passed in, this method can return several different file types.
- To publish a file, use either your language's network library or the command-line tool curl. Autodesk recommends using curl because it is tested and supported. See the following sections for examples.
General API Requirements
- You must be able to make POST requests to http://bim360field.autodesk.com.
- Your language's network library must be able to send binary data to a REST endpoint. This is used only for the /api/publish method. If you're unsure of how to do this, you may also use curl. See the following example for accessing the APIs from a curl command.
-
If possible, find a library for your language that supports JSON handling. All responses are serialized as JSON, and most languages have JSON parsers available.
Example of an API Call
This call publishes the local file named building1_plans.pdf to the Plans folder of the document library. This call assumes that the ticket ID and project ID have been previously obtained from other API calls.
To publish the file to the library, issue the following command using curl:
curl -s -F "ticket=f106c25c-50c0-11e0-adb4-204809548cbe" -F "project_id=92332458-4be0-11e0-9e43-e284ec139aca" -F "directory=/Plans" -F "filename=building1_plans.pdf" -F "Filedata=@building1_plans.pdf" http://bim360field.autodesk.com/api/library/publish
Note that you must pass in values for ticket, project_id, filename, directory, and Filedata.
The document library is hierarchical and structured like a filesystem, so you can specify arbitrarily deep directories (for example, /Building1/Systems/Electrical/Basement). Directories that don't exist are created automatically.
When specifying the name of the local file to send, pass it as the parameter of Filedata. In the previous example, it comes after the @ sign. The @ sign tells curl to use the contents of the filename specified as the data for that parameter.