Skip to main content

Posting photos from an app

Club leaders can let their own app, such as a photo editor's export script, post photos straight into one of the club's collections. The app uses an API key: a long secret that works only for that one collection.

Make a key​

  1. Open the collection on your club's page.
  2. Tap ⋯ → API keys.
  3. Give the key a name that says what will use it, such as "Lightroom exporter", and tap Make key.
  4. Copy the key straight away. You won't see it again. The window also shows a ready-made example with your API's address filled in.

A collection can have up to 5 active keys. The list shows when each one was last used.

Keep it secret​

Anyone with the key can add, caption and remove photos in that collection. So:

  • Don't post it in a group chat or put it in a shared document.
  • Keep it in your app's settings or an environment variable, not in code you share.
  • If a key might have leaked, or someone who had it leaves the club, revoke it in ⋯ → API keys and make a new one. A revoked key stops working at once. Photos it already posted stay.

What the app can do​

RequestWhat it does
GET /photosLists the collection's photos, oldest first
POST /photosAdds a photo: a form field file (PNG, JPEG or WebP, up to 10 MB), an optional caption, and an optional strip (see Photo booths). Returns the photo's short link and its QR code
GET /photos/<id>/qr.png?size=600The photo's QR code as a PNG, 200 to 2,000 pixels wide
PATCH /photos/<id>Changes a photo's caption: {"caption": "..."}
DELETE /photos/<id>Takes a photo out of the collection
PUT /coverSets the cover: {"photo_id": "..."}

Every request sends the key as Authorization: Bearer rku_live_.... Photos the app posts also appear in the club's Gallery, marked "Added by API" for leaders.

Removing a photo deletes it from the Gallery only if the app posted it and no other collection holds it. Photos leaders added on the site are only taken out of the collection.

Photo booths: a QR code for every shot​

Every photo on RankUoG has its own short link, like rankuog.com/p/Ab3dE9xY. Scanning it opens the photo full screen with a Download photo button. A photo booth can print these links as QR codes on the back of each strip, one per shot, so guests keep the paper strip and can still get every photo.

  1. Make up one label per strip, such as the booth's session number, and send it as strip with each shot of that strip. Shots with the same label are one strip: whoever scans any of them can swipe through the rest.

  2. Each upload's reply has:

    • photo.short_url: the link;
    • qr_png: the QR code as a 600-pixel PNG in base64;
    • qr_svg: the same code as SVG, for printers that prefer vector images.

    Need another size later? Call GET /photos/<id>/qr.png?size=....

  3. Print each code at least 15 mm wide. Keep the white border around it, and don't stretch it or put it on a coloured background.

Photos from the booth are public, like everything else in the collection.

Limits​

  • 120 uploads an hour and 1,000 a day per key, and 600 requests an hour in all. Over a limit, the app gets error 429 and a Retry-After header saying how many seconds to wait.
  • A club can have up to 500 photos. When the Gallery is full, uploads get error 409 until a leader deletes some.
  • Resize photos to about 2560 pixels on the long side before sending. The site shows them as they arrive.

Every error comes back as JSON with an error message you can show or log.