Media Upload
From EveryTrail API Developer Documentation
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 name | Parameter format | Required | Description |
|---|---|---|---|
| username | string | yes | username of user performing the request |
| password | string | yes | password of user performing the request |
| trip_id | int | no | id of the trip to associate the media with. Not required because it is possible to upload media without attaching it to a trip |
| lat | double | yes | latitude component of location coordinate |
| lon | double | yes | longitude component of location coordinate |
| ele | double | no | elevation component of location coordinate |
| name | string | yes | caption for the media |
| desc | string | no | description for the media |
| time | string in Standard Date Format | yes | media creation timestamp |
| data | binary | yes* | data for the media file (*required only for picture uploads) |
| source | string | yes* | source of the media file (*required only for vide uploads: youtube, flickr, picasa) |
| source_url | string | yes* | url of the media file on the host site (*required only for vide uploads) |
| source_id | string | yes* | unique id of the media file on the host site (*required only for vide uploads) |
| duration | int | yes* | duration of the media (*required only for video uploads) |
| thumbnail_url | string | yes* | 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.
