Skip to end of metadata
Go to start of metadata

Return the jpg-file of the requested photo.

API version

1.0

Working example URL: https://en.onlinedemo.picapport.de/picapportapi/1.0/getPhoto?sid=bdV9KFX26z7zcP5Whjbjnw&index=12&height=400

Parameter to identify the photo

NameTypeSince
version
RequiredValue(s)

Option1: get photo from a shared gallery

sidstring7.4yesShareID. Unique sid returned by getSharedGallerys or by the Web-GUI function share photos
indexint7.4yesZero based index of requested photo in shared gallery.

Option2: get photo from an already executed runQuery

apisidstring7.4yes

Based on the setting of webapi.default.uid in picapport.properties you may provide one of the following values

  • Session-ID returned from createWebApiSession

  • If you do not provide apisid and configuration parameter webapi.default.uid is set to a valid userid (with same password)
    a WebApi-Session will be created implicitly for the defined user.

  • If an existing userID is provided (with password set to same value as userID ) a WebApi-Session will be created implicitly
    for the defined userID.

vidint7.4yesViewID returned from runQuery
indexint7.4yesZero based index of requested photo in view returned by runQuery
Option3: get a single photo from a unique photoID
apisidstring7.4yesdesciption see above option2
photoidstring7.4yes

A valid photo id to uniquely identify a photo. see: PhotoID on page Full text search of photos - Supported metadata

If photoid is provided as parameter, vid and index will be ignored even if they are provided

Since version 7.4 you can query the photoid in the thumbnail view. Select one or more photos and then menu: tags -> "show metadata details"

Because the photoid is a base64 encoded String it may contain '+' or '/' characters. The proper escaping for the URL is:

  • %2B for '+'
  • %2F for '/'

You can also use JavaScripts encodeURIComponent() function.

See examples below

With this option3 it is now possible to directly link to a photo in PicApport without having to deal with sessions etc. if you provide a webapi.default.uid or a valid userID for apisid

Examples

 

Additional optional Parameters

NameTypeSince
version
RequiredValue(s)
widthint7.4no

Width and height in pixels

  • if width and height are not specified a jpg-File with original dimensions without any metadata will be returned

  • if only width is specified the returned image will be scaled to width. Height depends on aspect ratio
  • if only height is specified the returned image will be scaled to height. Width depends on aspect ratio
  • if both width and height are specified the dimension of the resulting image will calculated to get the
    largest possible image for the given rectangle (even if it has to be rotated 90 degrees)
    Typically the screen dimension of a smartphone or tablet that can be rotated is passed.

    If height equals width the resulting image will cover the entire square. Parts may be cut off:
    This can be used to create square tiles.
heightint7.4no
qualityfloat7.4no

jpg quality
values: 0.0 - 1.0 (if not defined default = 0.7)
only relevant if width or height id specified

Result

mime typeimage/jpeg
contentrequested image
http status codes
  • 200 OK
  • 400 Bad Request
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 501 Not implemented
  • No labels