TwentyThree Developer APIAPI Method: /api/photo/get-update-token

API Method: /api/photo/get-update-token

Last updated on May 17, 2016.

Pre-authenticate a meta data update of either a video or a photo.

This method can be used to pre-authenticated client changes without proxying them through your servers and the API. The flow is very similar to the one described in detail in the Browser-based uploads section of the API documentation, but in general terms this method will return a token which can be included in an update request from a standard HTML form or HTTP request.

Parameters

ParameterDescription
photo_idThe photo object to be updated.
valid_minutesHow many minutes should the token be valid for. The default is 180 minutes (or 3 hours). The minimum value is 15 minutes and the maximum is 24 hours.
max_usesHow many times may the returned token be uses? The default is 1 upload; the maximum is 100

Permission level

The minimum required permission level is:

write

Example XML Response

<response status="ok" permission_level="write" 
  message="The update token is ready to use" cached="0">
  <update_token>022fe6e3fb42758d6147c539727c5358af3524b1</update_token>
  <photo_id>123456</photo_id>
  <max_uses>1</max_uses>
  <valid_minutes>180</valid_minutes>
  <valid_until>1266711372</valid_until>
</response>

Example JSON Response

{
  "status": "ok", 
  "message":"The update token is ready to use",
  "permission_level":"write",
  "cached":"0",
  "updatetoken":{
    "valid_minutes": "180", 
    "update_token": "022fe6e3fb42758d6147c539727c5358af3524b1", 
    "max_uses: "1", 
    "valid_until": "1266713254", 
    "photo_id": "123456"
  },
  "p": "1",
  "size": "1",
  "site": { ... },
  "endpoint": "/api/photo/get-update-token"
}