API for retrieving photos

There appears to be no binary data passed through the Oplog when I perform an Oplog API call.

How do I retrieve photos from a web script? What is the base API URL for this? Which app Id and token do I use, the one for the specific app/environment combination?

Documentation on this is not clear.

Hi George

There is no API for solely retrieving photos or other attachments (documents, signatures, etc.). Instead, this data is retrieved as part of the standard API response for the objects they are attached to.

You can therefore use any of the backend APIs that allow you to retrieve objects, namely:

  1. Retrieving a single object (docs)
  2. Retrieving all objects (docs)
  3. Querying objects (docs)

If any attachments are present in any of the objects returned then it will be part of that object’s payload, and will be presented as link/url (or set of links for photos captured in the app) that can be accessed to download the attachment in question.

Attachment API Response example

{
    "id": "eacb4836-f1b9-11e1-9750-001cc01904e3",
    "state": "uploaded",
    "thumbnail": "https://run.journeyapps.com/media/AwNDkyOSJdLFsicCIsI?sha1=12345",
    "fullscreen": "https://run.journeyapps.com/media/3JlZW4iXV0W1siZiIs?sha1=12345",
    "original": "https://run.journeyapps.com/media/SJdLFsicCIsW1siZiIs?sha1=12345"
}

As to your question about which app / environment combination, that will be for the DB / Backend in question. That is to say, in order to use of the standard Backend APIs to retrieve an object(s) you would use the normal Backend API and associated authentication method. Once you have the links/URLs, they can be accessed without authentication.

I hope this makes sense