download multiple photos

download multiple photos

Anonymous
Not applicable
1,176 Views
5 Replies
Message 1 of 6

download multiple photos

Anonymous
Not applicable
How to download multiple photos from https://bim360field.autodesk.com/photos? We need the photo itself and not only the metadata.
0 Likes
1,177 Views
5 Replies
Replies (5)
Message 2 of 6

mikako_harada
Alumni
Alumni

Hi mlefrancois, 

 

I got some hint from the product team: 

 

>>>>

Photos can be downloaded one by one using /api/binary_data call. Photo is just a reference to a document, so object_id should be the photo’s document_id and object_type is ‘Document’. See example below:

 

{{url}}/api/binary_data?ticket={{ticket_id}}&project_id={{project_id}}&object_id=ba81bcfa-1230-4a88-adb8-c7afe5b27ada&object_type=Document&image_type=original

<<<< 

 

Now, I found the photos can be attachment to the issues, and possibly other types.  As an example, I did a quick test with a photo which is an attachment of an issue.  And I was able to download a jpg file.  I will try to make a minimum sample in the next day or so to share with the community.  

In a mean time, I don't want to hold off sharing the info that the product team provided. 


Mikako Harada
Developer Technical Services
0 Likes
Message 3 of 6

Anonymous
Not applicable

Thank you for your answer. I found the same technique. The mobile app use a getPhotos, but https://bim360field.autodesk.com/api/ is not that simple.

 

Here what I had to do:

 

For Issues photos:

 

- Use api/get_issues to get all document_id attchment with content_type image/jpeg.

        Ex: api/get_issues?ticket={ticket}&project_id={projectId]

-Use api/binary_data to download jpeg photo.

        Ex: api/binary_data ?ticket={ticket}&project_id={projectId]&object_id={document_id}&image_type=original

 

For Library photos (without Daily Updates Photos)

 

-Use api/all_files to get all document_id with content_type image/jpeg. Don't forget the include_hidden=1.

           Ex: api/all_files?ticket={ticket}&project_id={projectId]&include_hidden=1

-Use api/binary_data to download jpeg photo.

          Ex: api/binary_data ?ticket={ticket}&project_id={projectId]&object_id={ document_id }&image_type=original

 

N.B. There is other sources of photos

0 Likes
Message 4 of 6

mikako_harada
Alumni
Alumni

Hi mlefrancois, 

 

You gave me a hint. I double-checked with the product team and learned that there is an undocumented REST call /api/get_photos. If you use this, you will get a list of meta data for each photo. "image_id" is the object_id for /api/binary_data.  This will eliminate needing to go through the parent objects to get to the photo ids.  Could you give it a try? 


Mikako Harada
Developer Technical Services
0 Likes
Message 5 of 6

Anonymous
Not applicable

With GetPhotos can we have the count of photos? Count_only parameter doesn't work. What is the list of parameters of this method?

0 Likes
Message 6 of 6

mikako_harada
Alumni
Alumni

Hi melfrancois, 

 

I checked with the product team.  Unfortunately, they confirmed that there is no API to get a count of photos.

 

The list of parameters for get_photos are: 

 

  • max_updated_at
  • limit
  • offset
  • project_id

 


Mikako Harada
Developer Technical Services
0 Likes