Website logo

Upload an agent branding image

Adds the agent branding image to the authenticated user's list of agent branding images. These images can be used to enhance an agent contact details. This API method is currently available only for property agents.

These images are retained indefinitely.

URL: https://api.trademe.co.nz/v1/Photos/agentbranding.{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)

The actual image data which is base64 encoded.

FileName String (required)

A textual label for the image, which is intended to make it easier for the user to find the photo when creating a listing. If the file name looks like a path (with forward slash or backslash characters) all characters up to the last slash will be removed. The following characters are not allowed: " < > |

FileType String (required)

The file type of the image ("BMP", "GIF", "JPG", "JPEG" or "PNG"). Case is ignored.

Returns

<PhotoResponse>

The ID of the added agent branding image.

Status Enumeration

The status of the photo operation.

Failure 0

The photo action was a failure.

Success 1

The photo action was a success.

NotMemberPhoto 2

The photo is not owned by the member.

NotMemberAuction 3

The auction is not owned by the member.

NotFound 4

The auction was not found.

PhotoId Long Integer

The ID of the photo.

Description String or null

A description of the error message, if an error occurred.

PhotoUrls <PhotoUrl> or null

When uploading a new photo, contains a collection of URLs for this photo, one for each size.

Thumbnail String or null

The URL for the thumbnail sized photo (always 85x64, with white borders).

List String or null

The URL for the list view sized photo (scaled down to fit 160x120).

Medium String or null

The URL for the medium sized photo (scaled down to fit 175x175).

Gallery String or null

The URL for the gallery sized photo (scaled down to fit 233x176).

Large String or null

The URL for the large sized photo (scaled down to fit 352x264).

FullSize String or null

The URL for the full sized photo (scaled down to fit 670x502).

PlusSize String or null

The URL for the plus sized photo (scaled down to fit).

PhotoId Long Integer

The ID of the photo.

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>
  <Description>ABC</Description>
  <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,
  "Description": "ABC",
  "PhotoUrls": {
    "Thumbnail": "ABC",
    "List": "ABC",
    "Medium": "ABC",
    "Gallery": "ABC",
    "Large": "ABC",
    "FullSize": "ABC",
    "PlusSize": "ABC",
    "PhotoId": 123
  }
}