Website logo

Upload a photo

Adds the photo to the authenticated user's list of photos. These photos can be used when selling.

Our photo retention policy is as follows:

All other photos may be deleted at our discretion.

It is recommended that a new photo be uploaded whenever you create a new listing. If you are relisting then uploading a new photo is not required, since you cannot relist a listing that closed more than 45 days ago.

URL: https://api.trademe.co.nz/v1/photos/Add.{file_format}
HTTP Method: POST
Requires Authentication? Yes
Permission Required: MyTradeMeWrite: Maintain your watchlist, answer questions and post comments.
Supported Formats: XML, JSON
Rate Limited? Yes

URL parameters

file_format Enumeration (required) The format of the response.
xml Serialize responses into XML.
json Serialize responses into JSON.

POST Data

<PhotoUploadRequest>

PhotoData String (required) PhotoData
FileName String (required) FileName
FileType String (required) FileType

Returns

<PhotoResponse>

The ID of the added photo.

Status Enumeration Status
Failure 0 Failure
Success 1 Success
NotMemberPhoto 2 NotMemberPhoto
NotMemberAuction 3 NotMemberAuction
NotFound 4 NotFound
PhotoId Integer PhotoId
PhotoUrls <PhotoUrl> or null PhotoUrls
Thumbnail String or null Thumbnail
List String or null List
Medium String or null Medium
Gallery String or null Gallery
Large String or null Large
FullSize String or null FullSize
PlusSize String or null PlusSize
PhotoId Integer PhotoId

Examples

Upload a tiny skull picture (under the name 'skull.png'):

<PhotoUploadRequest xmlns="http://api.trademe.co.nz/v1">
<PhotoData>iVBORw0KGgoAAAANSUhEUgAAABkAAAAUCAMAAABPqWaPAAAABGdBTUEAALGPC/xhBQAAAapQTFRFJls2TLtsNnpJR7JnO7piEycYLKlVP6lfPJdXULdtDy0YRaZiNb1hOsNmCyMTChYNAgcDCykUQsRsN8JkRJJZRKpiChgPNoxPSKBhTqpoV7ZwSq5oDBwRR7VoAwYERbtpSK1lOMNlJIREQKxiETkeL5pSQsVrIXk+BRAJFTUeQbdlRL9qJ2A3Pp9bMJtTO6RcNYhOJolGKo9LK3JBM39KJGg5J3hBKXxDMbRdSMlxDSoWR8lvK51RGlUtK3RBHFkvOr9kRcluOalcH2A0N7dfKHdBTMpzE0YlQMVtDCkVH10zCBsOAQIBHUoqBRAIOJ9YN6ZaO7NhGUcnFVssLHhDCxsQGVMrHlkxTsp2U8x6PcRpU8x5ETseM8FhOqdcP7BiDSMTP79oCyETBhULBQ0HTcBzH1EwP7llETEaNqtbP8VrXM+BAQMCCxsRRsdwVMx8Xs+CDSsXLphPOLxiIlc0RMVvAwoFEzceUK5vMptUVcx7Ws6AIU0vETUcIFw0NIdPOoxVK2c/Cx8SEysbPbFhQqZgQbFjPsRqPMRoCRoPUst6Tsp1HWg2AAAASRMimgAAAMxJREFUKM9j6MUFGIiQaW5sqK9rwiJTU1Fd1V1aWYshU5KfXdCVl9VRXI4mk5vaFRndHRWbmF5UhiqTFuFmae3o4BIYn1mIKhPu0d6upq3V5hQQl4Eq427Ro8QiL9tq6uyfgCpjpd7by8cuLtbb6+qHKqOhKijAxcgtI6dp5oMqo9LBwybEwMQpIarnjSpjpCjM28LPKiWtbxOMKuNp2NPSxiEiaWDfk4weOp3KzAqtunZYws3LWMfE3DYkBVOmM9Q3KCwmKYek+CFeBgAPC+wcLxZW8wAAAABJRU5ErkJggg==</PhotoData>
<FileName>kev.jpeg</FileName>
<FileType>JPEG</FileType>
</PhotoUploadRequest>

Example XML Request (switch to JSON)

<PhotoUploadRequest xmlns="http://api.trademe.co.nz/v1">
  <PhotoData>ABC</PhotoData>
  <FileName>ABC</FileName>
  <FileType>ABC</FileType>
</PhotoUploadRequest>

Example JSON Request (switch to XML)

{
  "PhotoData": "ABC",
  "FileName": "ABC",
  "FileType": "ABC"
}

Example XML Response (switch to JSON)

<PhotoResponse xmlns="http://api.trademe.co.nz/v1">
  <Status>Failure</Status>
  <PhotoId>123</PhotoId>
  <PhotoUrls>
    <Thumbnail>ABC</Thumbnail>
    <List>ABC</List>
    <Medium>ABC</Medium>
    <Gallery>ABC</Gallery>
    <Large>ABC</Large>
    <FullSize>ABC</FullSize>
    <PlusSize>ABC</PlusSize>
    <PhotoId>123</PhotoId>
  </PhotoUrls>
</PhotoResponse>

Example JSON Response (switch to XML)

{
  "Status": 0,
  "PhotoId": 123,
  "PhotoUrls": {
    "Thumbnail": "ABC",
    "List": "ABC",
    "Medium": "ABC",
    "Gallery": "ABC",
    "Large": "ABC",
    "FullSize": "ABC",
    "PlusSize": "ABC",
    "PhotoId": 123
  }
}