Website logo

Retrieve attributes for a category

Retrieves the list of attributes which are applicable to a specific category.

Some categories are currently unsupported (including subcategories): 350 (Real Estate), 5000 (Jobs) and 36 (Businesses for sale).

This API is deprecated in favour of the category details API.

URL: https://api.trademe.co.nz/v1/categories/{category}/attributes.{file_format}
HTTP Method: GET
Requires Authentication? No
Permission Required: Public
Supported Formats: XML, JSON
Rate Limited? No

URL parameters

category String (required)

The category number for which you wish to see the attributes for. This must be a leaf category (for example, you cannot view the attributes for Computers > Desktops, but you can for Computers > Desktops > CRT monitors).

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

Returns

Collection of <Attribute>

Name String or null Name
DisplayName String or null DisplayName
Type Enumeration AttributeType
None 0 None
Boolean 1 Boolean
Integer 2 Integer
Decimal 3 Decimal
String 4 String
DateTime 5 DateTime
Range <AttributeRange> or null Range
Lower String or null Lower
Upper String or null Upper
MaxStringLength Integer MaxStringLength
Options Collection of <AttributeOption> or null Options
Value String or null Value
Display String or null Display
Units Collection of <AttributeUnit> or null Units
Display String or null Display
Multiplier Number Multiplier
IsRequiredForSell Boolean IsRequiredForSell
GroupName String or null GroupName

Examples

https://api.trademe.co.nz/v1/Categories/9374-9375-9377-/Attributes.xml - Retrieves attribute information for the International Accommodation category.

Example XML Response (switch to JSON)

<Attributes xmlns="http://api.trademe.co.nz/v1">
  <Attribute>
    <Name>ABC</Name>
    <DisplayName>ABC</DisplayName>
    <Type>None</Type>
    <Range>
      <Lower>ABC</Lower>
      <Upper>ABC</Upper>
    </Range>
    <MaxStringLength>123</MaxStringLength>
    <Options>
      <AttributeOption>
        <Value>ABC</Value>
        <Display>ABC</Display>
      </AttributeOption>
      <AttributeOption>
        <Value>ABC</Value>
        <Display>ABC</Display>
      </AttributeOption>
    </Options>
    <Units>
      <AttributeUnit>
        <Display>ABC</Display>
        <Multiplier>123.0</Multiplier>
      </AttributeUnit>
      <AttributeUnit>
        <Display>ABC</Display>
        <Multiplier>123.0</Multiplier>
      </AttributeUnit>
    </Units>
    <IsRequiredForSell>false</IsRequiredForSell>
    <GroupName>ABC</GroupName>
  </Attribute>
  <Attribute>
    <Name>ABC</Name>
    <DisplayName>ABC</DisplayName>
    <Type>None</Type>
    <Range>
      <Lower>ABC</Lower>
      <Upper>ABC</Upper>
    </Range>
    <MaxStringLength>123</MaxStringLength>
    <Options>
      <AttributeOption>
        <Value>ABC</Value>
        <Display>ABC</Display>
      </AttributeOption>
      <AttributeOption>
        <Value>ABC</Value>
        <Display>ABC</Display>
      </AttributeOption>
    </Options>
    <Units>
      <AttributeUnit>
        <Display>ABC</Display>
        <Multiplier>123.0</Multiplier>
      </AttributeUnit>
      <AttributeUnit>
        <Display>ABC</Display>
        <Multiplier>123.0</Multiplier>
      </AttributeUnit>
    </Units>
    <IsRequiredForSell>false</IsRequiredForSell>
    <GroupName>ABC</GroupName>
  </Attribute>
</Attributes>

Example JSON Response (switch to XML)

[
  {
    "Name": "ABC",
    "DisplayName": "ABC",
    "Type": 0,
    "Range": {
      "Lower": "ABC",
      "Upper": "ABC"
    },
    "MaxStringLength": 123,
    "Options": [
      {
        "Value": "ABC",
        "Display": "ABC"
      },
      {
        "Value": "ABC",
        "Display": "ABC"
      }
    ],
    "Units": [
      {
        "Display": "ABC",
        "Multiplier": 123.0
      },
      {
        "Display": "ABC",
        "Multiplier": 123.0
      }
    ],
    "IsRequiredForSell": false,
    "GroupName": "ABC"
  },
  {
    "Name": "ABC",
    "DisplayName": "ABC",
    "Type": 0,
    "Range": {
      "Lower": "ABC",
      "Upper": "ABC"
    },
    "MaxStringLength": 123,
    "Options": [
      {
        "Value": "ABC",
        "Display": "ABC"
      },
      {
        "Value": "ABC",
        "Display": "ABC"
      }
    ],
    "Units": [
      {
        "Display": "ABC",
        "Multiplier": 123.0
      },
      {
        "Display": "ABC",
        "Multiplier": 123.0
      }
    ],
    "IsRequiredForSell": false,
    "GroupName": "ABC"
  }
]