Media Upload

From EveryTrail API Developer Documentation

Jump to: navigation, search

Contents

URL

/api/media/create

Semantics

Uploads a geotagged media file and optionally attaches it to a trip with specified ID. Returns the media ID on the server if successful.

Parameters

Parameter nameParameter formatRequiredDescription
usernamestringyesusername of user performing the request
passwordstringyespassword of user performing the request
trip_idintnoid of the trip to associate the media with. Not required because it is possible to upload media without attaching it to a trip
latdoubleyeslatitude component of location coordinate
londoubleyeslongitude component of location coordinate
eledoublenoelevation component of location coordinate
namestringyescaption for the media
descstringnodescription for the media
timestring in Standard Date Formatyesmedia creation timestamp
databinaryyes*data for the media file (*required only for picture uploads)
sourcestringyes*source of the media file (*required only for vide uploads: youtube, flickr, picasa)
source_urlstringyes*url of the media file on the host site (*required only for vide uploads)
source_idstringyes*unique id of the media file on the host site (*required only for vide uploads)
durationintyes*duration of the media (*required only for video uploads)
thumbnail_urlstringyes*url for the thumbnail for the media (*required only for video uploads)

Success Response

<etMediaCreateResponse status="success">
  <tripID>${trip ID}</tripID>
  <mediaID>${media ID}</mediaID>
  <mediaType>${media type}</mediaType>
  <thumbnailUrl>${thumbnail url}</thumbnailUrl>
  <fullsizeUrl>${fullsize url}</fullsizeUrl>
</etMediaCreateResponse>

${trip ID}: optional: the trip ID of the trip the media was attached to. Only present if in the upload a media ID was specified.

${media ID}: ID of media object on the server as int

${media type}: mime-type of the media object as string

${thumbnail url}: path to the thumbnail image (if the upload was an image)

${fullsize url}: path to the fullsize image (if the upload was an image)

Error Reponse

<etMediaUploadResponse status="error">
  <tripID>${trip ID}</tripID>
  ${error reponse}
</etMediaUploadResponse>

${trip ID}: The integer ID of the trip on the server

${error reponse}: See format in Error Reponse Format

Old Versions

Documentation of the old versions of this API is available here.

Personal tools