GET v1/ads

Retorna todos os anúncios publicados

Requires Authorization

To perform authorization, you must submit the authentication credentials using the HTTP Basic authorization header.
The authorization header is constructed as follows:

  1. The username and password are combined into a string "user:password"
  2. The resulting literal string is then encoded in Base64
  3. The authorization method followed by the word "Basic" is then placed before the coded sequence.
For example, if the user is 'Aladdin' and the password is 'open-sesame' then the header should be:
Authorization: Basic QWxhZGRpbjpvcGVuLXNlc2FtZQ==

Response Codes

  • OK (200)
  • BadRequest (400)
  • Unauthorized (401)
  • Forbidden (403)
  • NotFound (404)

Response Information

Resource Description

AdResponse array Returns a list of the advertiser Ads.

NameDescriptionTypeAdditional Information
AdIdID code generated by the systeminteger
ReferenceCodeReference code provided by the advertiserstringRequired
TypeOffer type (Venda/Locação/Serviço)stringRequired
ContractIdAdvertiser current Contract IDintegerRequired
CategoryMachine/Equipment CategorystringRequired
MakeMachine/Equipment ManufacturerstringRequired
ModelMachine/Equipment ModelstringRequired
SerialNumberMachine/Equipment Serial Numberstring
YearYear of manufacture of the machine/equipment (ex. 1998)integer
PricePrice of Ad in Reais (ex. R$ 100.000,00 -> 100000). Only numbers.integer
StateState or Province of location (ex. SP)stringRequired
CityCity of location (ex. Jundiaí)stringRequired
DescriptionAd description (Ex.: pintura nova, pneus bons, cabinada, motor novo). It is forbidden to enter addresses of other sites, telephones and email.string
IsPrivateIndicates wheter the Ad is private (published only in EmEstoque)booleanRequired
SyncToMarketplacesIndicar se o anúncio deve ser Sincronizado com os Marketplaces disponíveis através do EmEstoqueboolean
PhotosList with photos links. Maximum of 4 photos.string arrayMax. Length: 4
SpecificationsList of the Ad SpecificationsNameValueItem array
LinksAd links listLink array

Response Formats

application/json, text/json

Notes:

  • In Json format, the parameter names follow the camelCase pattern, that is, they always start with lowercase letters.
[
  {
    "adId": 1,
    "referenceCode": "XXXX0123456",
    "type": "Venda",
    "contractId": 1,
    "category": "Escavadeira",
    "make": "Case",
    "model": "CX220",
    "serialNumber": "ABC123456",
    "year": 2012,
    "price": 100000,
    "state": "SP",
    "city": "Jundiaí",
    "description": "NONONON NONONON NONONON",
    "isPrivate": false,
    "syncToMarketplaces": false,
    "photos": [
      "http://www.yourdomain.com/photo1.jpg",
      "http://www.yourdomain.com/photo2.jpg",
      "http://www.yourdomain.com/photo3.jpg",
      "http://www.yourdomain.com/photo4.jpg"
    ],
    "specifications": [
      {
        "name": "numero-de-serie",
        "value": "ABC1234"
      },
      {
        "name": "ano-fabricacao",
        "value": "2012"
      }
    ],
    "links": [
      {
        "href": "https://www.mercadomaquinas.com.br/anuncio/1-test-ad-permalink-slug",
        "rel": "ad",
        "type": "GET"
      },
      {
        "href": "https://api.mercadomaquinas.com.br/v1/ads/1",
        "rel": "ad api",
        "type": "GET"
      }
    ]
  },
  {
    "adId": 1,
    "referenceCode": "XXXX0123456",
    "type": "Venda",
    "contractId": 1,
    "category": "Escavadeira",
    "make": "Case",
    "model": "CX220",
    "serialNumber": "ABC123456",
    "year": 2012,
    "price": 100000,
    "state": "SP",
    "city": "Jundiaí",
    "description": "NONONON NONONON NONONON",
    "isPrivate": false,
    "syncToMarketplaces": false,
    "photos": [
      "http://www.yourdomain.com/photo1.jpg",
      "http://www.yourdomain.com/photo2.jpg",
      "http://www.yourdomain.com/photo3.jpg",
      "http://www.yourdomain.com/photo4.jpg"
    ],
    "specifications": [
      {
        "name": "numero-de-serie",
        "value": "ABC1234"
      },
      {
        "name": "ano-fabricacao",
        "value": "2012"
      }
    ],
    "links": [
      {
        "href": "https://www.mercadomaquinas.com.br/anuncio/1-test-ad-permalink-slug",
        "rel": "ad",
        "type": "GET"
      },
      {
        "href": "https://api.mercadomaquinas.com.br/v1/ads/1",
        "rel": "ad api",
        "type": "GET"
      }
    ]
  }
]

text/html

[{"adId":1,"referenceCode":"XXXX0123456","type":"Venda","contractId":1,"category":"Escavadeira","make":"Case","model":"CX220","serialNumber":"ABC123456","year":2012,"price":100000,"state":"SP","city":"Jundiaí","description":"NONONON NONONON NONONON","isPrivate":false,"syncToMarketplaces":false,"photos":["http://www.yourdomain.com/photo1.jpg","http://www.yourdomain.com/photo2.jpg","http://www.yourdomain.com/photo3.jpg","http://www.yourdomain.com/photo4.jpg"],"specifications":[{"name":"numero-de-serie","value":"ABC1234"},{"name":"ano-fabricacao","value":"2012"}],"links":[{"href":"https://www.mercadomaquinas.com.br/anuncio/1-test-ad-permalink-slug","rel":"ad","type":"GET"},{"href":"https://api.mercadomaquinas.com.br/v1/ads/1","rel":"ad api","type":"GET"}]},{"adId":1,"referenceCode":"XXXX0123456","type":"Venda","contractId":1,"category":"Escavadeira","make":"Case","model":"CX220","serialNumber":"ABC123456","year":2012,"price":100000,"state":"SP","city":"Jundiaí","description":"NONONON NONONON NONONON","isPrivate":false,"syncToMarketplaces":false,"photos":["http://www.yourdomain.com/photo1.jpg","http://www.yourdomain.com/photo2.jpg","http://www.yourdomain.com/photo3.jpg","http://www.yourdomain.com/photo4.jpg"],"specifications":[{"name":"numero-de-serie","value":"ABC1234"},{"name":"ano-fabricacao","value":"2012"}],"links":[{"href":"https://www.mercadomaquinas.com.br/anuncio/1-test-ad-permalink-slug","rel":"ad","type":"GET"},{"href":"https://api.mercadomaquinas.com.br/v1/ads/1","rel":"ad api","type":"GET"}]}]