Back to top

Zattix API.

Endpoint: http://api.zattix.com Every request should have the header Locale set. This will determine the preferred user s language. Country shouldn’t be sent at the moment, just pick the language part (en, it, fr,..) When no Locale is set then will be default on en (English). A list of supported locales could be found here: http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html.

Ads related resources

Create Ad 

Create ad
/ad

An Ad could be of different category types; currently supported Default & Home.

  • Request
  • Headers
    Content-Type: application/json
    Body
        {
        "title": "Test hermano",
        "description": "Test long chars scope and my sister is Laura. Her cat stays in my house now",
        "category": {
                "id": 1
            }
        }
    
  • Response  201
  • Headers
    Content-Type: application/json
    Body
        {
        "id": 55,
        "title": "Test hermano",
        "currency": "CHF",
        "description": "Test long chars scope and my sister is Laura. Her cat stays in my house now",
        "category": {
                "id": 1,
                "type": "DEFAULT",
                "name": "Vehicles",
                "total_ads": 42
            },
        "views": 0,
        "creation_date": 1417019544396,
        "images": [],
        "user": {
                "id": 9,
                "displayName": "ianaz",
                "imageUrl": "http://graph.facebook.com/710883759/picture",
                "name": "Silvio"
            }
        }
    
  • Response  406
  • Headers
    Content-Type: application/json
    Body
        [
        {
        "field": "description",
        "message": "Description must have at least 50 characters"
            }
        ]
    

Ad details 

Return a single Ad
/ad/{id}
  • Parameters
  • id
    int (required) Example: 6

    Ad id you want to retrieve

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        "id": 4,
        "title": "Designer at Zattix",
        "price": null,
        "currency": "CHF",
        "description": "Our mission is to be the first website that empowers user to buy and even sell on the interconnected webosphere. minimum of 12+ years experience with Photoshop.",
        "category": {
            "id": 20,
            "name": "Accounting",
            "father": {
                "id": 2,
                "name": "Jobs",
                "father": null,
                "total_ads": 4
            },
            "total_ads": 1
        },
        "views": 51
    }
    
  • Response  204
  • Headers
    Content-Type: application/json

Ads by category 

Collection of ads by category
/ad/category/{categoryId}{?page}
  • Parameters
  • categoryId
    int (required) Example: 3

    categoryId you want to retrieve ads from.

    page
    int (optional) Example: 0

    Page index you want to retrieve. Default: 0

  • Response  200
  • Headers
    Content-Type: application/json
    Total-count: 12
    Results-per-page: 5
    Body
    [
        {
            id: 2,
            title: "Lorem ipsum 2 lorem",
            price: 656,
            currency: "CHF",
            description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam tincidunt cursus leo, et porttitor eros lacinia a. Suspendisse ",
            category: {
            id: 3,
            name: "Flat & Houses",
            father: null,
            total_ads: 6
        },
        views: 116,
        creation_date: 1409006455000,
        images: [
            {
                small: {
                    url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/small/dc07102d-3482-4371-aeb2-3dfd3503934f.jpg",
                    creation_date: 1409607957000
                },
                medium: {
                    url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/medium/dc07102d-3482-4371-aeb2-3dfd3503934f.jpg",
                    creation_date: 1409607957000
                },
                big: {
                    url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/big/dc07102d-3482-4371-aeb2-3dfd3503934f.jpg",
                    creation_date: 1409607957000
                }
            }
        ]
        }
    ]
    
  • Response  204
  • Headers
    Content-Type: application/json

Last inserted ads 

Last inserted ads
/ad/last-inserted{?excludeMine}

Return a list of last inserted ad. If the user is logged in will automatically exclude his ads from the list.

  • Parameters
  • excludeMine
    boolean (optional) Example: false

    Set it on false if you want to retrieve also your ads (works only if logged).

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    [
        {
        id: 18,
        title: "Elena Esempio",
        price: 100,
        currency: "CHF",
        description: "Sesso orale: 50.-
        Sesso missionario: 100.-
        Sesso anale 150.-
        Durata di ogni atto fino a 30 minuti.
        Riservazione al 000 000 00 00.
        Solo amanti passionali",
        category: {
        id: 7,
        name: "Community",
        father: null,
        total_ads: 2
        },
        views: 22,
        creation_date: 1415208511000,
        images: [
        {
        small: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/small/ef941ce7-f23d-4066-96fa-c22397e8b90a.jpg",
        creation_date: 1415208556000
        },
        medium: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/medium/ef941ce7-f23d-4066-96fa-c22397e8b90a.jpg",
        creation_date: 1415208556000
        },
        big: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/big/ef941ce7-f23d-4066-96fa-c22397e8b90a.jpg",
        creation_date: 1415208556000
        }
        }
        ]
        },
        {
        id: 17,
        title: "Opel Corsa Gsi",
        price: 6000,
        currency: "CHF",
        description: "Vendo Opel Corsa GSI a CHF 6'000.-
        KM 105'000
        eiofsr
    
        f
        f
    
        f
    
        f
        ",
        category: {
        id: 15,
        name: "Cars",
        father: {
        id: 1,
        name: "Vehicles",
        father: null,
        total_ads: 6
        },
        total_ads: 1
        },
        views: 19,
        creation_date: 1415207382000,
        images: [
        {
        small: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/small/b07a4489-a0b1-4d91-875c-8ab69b22b2ff.jpg",
        creation_date: 1415207583000
        },
        medium: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/medium/b07a4489-a0b1-4d91-875c-8ab69b22b2ff.jpg",
        creation_date: 1415207583000
        },
        big: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/big/b07a4489-a0b1-4d91-875c-8ab69b22b2ff.jpg",
        creation_date: 1415207583000
        }
        }
        ]
        },
        {
        id: 16,
        title: "Bigolone",
        price: 90,
        currency: "CHF",
        description: "Vendo bigolone a 30 chf perch� non lo voglio man. E allora lo voglio!",
        category: {
        id: 16,
        name: "Car Parts & Accessories",
        father: {
        id: 1,
        name: "Vehicles",
        father: null,
        total_ads: 6
        },
        total_ads: 4
        },
        views: 24,
        creation_date: 1415134277000,
        images: [
        {
        small: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/small/6bbb7020-b842-4f8a-8893-2b3f4c61b514.jpg",
        creation_date: 1415134319000
        },
        medium: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/medium/6bbb7020-b842-4f8a-8893-2b3f4c61b514.jpg",
        creation_date: 1415134319000
        },
        big: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/big/6bbb7020-b842-4f8a-8893-2b3f4c61b514.jpg",
        creation_date: 1415134319000
        }
        }
        ]
        },
        {
        id: 15,
        title: "Ghjgjggjgj",
        price: null,
        currency: "CHF",
        description: "dsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfd",
        category: {
        id: 16,
        name: "Car Parts & Accessories",
        father: {
        id: 1,
        name: "Vehicles",
        father: null,
        total_ads: 6
        },
        total_ads: 4
        },
        views: 37,
        creation_date: 1413565363000,
        images: [ ]
        },
        {
        id: 14,
        title: "Scotland ",
        price: null,
        currency: "CHF",
        description: "Scotland.
        Just... Scotland.                                                   .                     
    
        ",
        category: {
        id: 31,
        name: "Vacation Rentals",
        father: {
        id: 3,
        name: "Flat & Houses",
        father: null,
        total_ads: 6
        },
        total_ads: 1
        },
        views: 62,
        creation_date: 1412834439000,
        images: [
        {
        small: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/small/24084f58-e530-4d59-b330-e87da4aa5bff.jpg",
        creation_date: 1412834822000
        },
        medium: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/medium/24084f58-e530-4d59-b330-e87da4aa5bff.jpg",
        creation_date: 1412834822000
        },
        big: {
        url: "http://zattix-images.s3-website-eu-west-1.amazonaws.com/big/24084f58-e530-4d59-b330-e87da4aa5bff.jpg",
        creation_date: 1412834822000
        }
        }
        ]
        }
    ]
    
Search for an Ad
/ad/search{?fulltext}{?page}{?min_price}{?max_price}{?categoryId}{?cityId}{?distance}

Fulltext search for an Ad. Will return a default number of results per page. This is set to 5 but keep in mind it could change. You will find this value into the response header Results-per-page. Total ads will be returned into response’s header too (Total-count)

  • Parameters
  • fulltext
    string (optional) Example: car

    String of what to search; for example “car” or “two bedrooms flat”. Fulltext search

    page
    int (optional) Example: 2

    Page you want to retrieve. Default: 0

    min_price
    float (optional) Example: 5.50

    Minimum price to filter. Default: null

    max_price
    float (optional) Example: 200

    Maximum price to filter. Default: null

    categoryId
    int (optional) Example: 7

    Category id to filter. `

    cityId
    int (optional) Example: 3489

    City id to filter.

    distance
    double (optional) Example: 20

    Distance to filter from the specified cityId.

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Total-count: 12
    Results-per-page: 5
    Body
    [
        {
        id:9,
        title:"Motorboot Draco 2500 TC / Standplatz Z�rchsee",
        price:12000,
        currency:"CHF",
        description:"2 Kabinenboot 4 Schlafpl�tze Toilette K�che Flybridge 2 Motoren Mercruiser 140 mit Z Bugstrahl Ankerwinch Fishfinder Kompas Navi Musikanlage 6 LS Rettungsmaterial Beiboot mit El Aussenborder und grossem Funreif. Zustand gut,alles funktioniert. Zugelassen f�r 10 Pers. Standplatz beim Rapperswiler Damm kann �bernommen werden. Preis ist verhandelbar.",
        category:{
        id:19,
        name:"Other Vehicles",
        father:{
        id:1,
        name:"Vehicles",
        father:null,
        total_ads:6
        },
        total_ads:1
        },
        views:64
        },
        {
        id:15,
        title:"Ghjgjggjgj",
        price:null,
        currency:"CHF",
        description:"dsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfddsfgfdgfdfdgfgfd",
        category:{
        id:16,
        name:"Car Parts & Accessories",
        father:{
        id:1,
        name:"Vehicles",
        father:null,
        total_ads:6
        },
        total_ads:4
        },
        views:37
        },
        {
        id:16,
        title:"Bigolone",
        price:90,
        currency:"CHF",
        description:"Vendo bigolone a 30 chf perch� non lo voglio man. E allora lo voglio!",
        category:{
        id:16,
        name:"Car Parts & Accessories",
        father:{
        id:1,
        name:"Vehicles",
        father:null,
        total_ads:6
        },
        total_ads:4
        },
        views:23
        },
        {
        id:3,
        title:"Alfa Romeo miti turismo 1.4 2010 one lady owner! Fsh! 34000 miles!",
        price:5300,
        currency:"CHF",
        description:"This beautiful little car has only had one lady owner from new! Very low mileage with full alfa Romeo service history from new! Last service was in March!! Tax till March 2015 Mot till march 2015 2 keys! Air-con Cd Electric windows Electric folding mirrors MP3 Bluetooth etc etc Lovely little car to drive! Very reliable We welcome AA/RAC inspection We will also take your car/van in part exchange if you want!!! Please tel Harry on 07866194983 thanks! Sorry no texts please! Thanks!",
        category:{
        id:16,
        name:"Car Parts & Accessories",
        father:{
        id:1,
        name:"Vehicles",
        father:null,
        total_ads:6
        },
        total_ads:4
        },
        views:219
        },
        {
        id:7,
        title:"sfsdffds",
        price:null,
        currency:"CHF",
        description:"Max Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network OutMax Network Out",
        category:{
        id:16,
        name:"Car Parts & Accessories",
        father:{
        id:1,
        name:"Vehicles",
        father:null,
        total_ads:6
        },
        total_ads:4
        },
        views:25
        }
        ]
    

User 

User related resources. Login/logout too.

User operations 

Create user
/user

Will create a new user and send an activation e-mail to the specified e-mail address.

  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "id":0,
        "displayName":"ianaz",
        "imageUrl":null,
        "name":"Silvio",
        "email":"iasndjknsd@askdmasdl.com",
        "street":null,
        "password":"asdasd",
        "repeat_password":"asdasd"
    }
    
  • Response  201
  • Headers
    Content-Type: application/json
    Body
    {
        "id":11,
        "displayName":"ianaz",
        "imageUrl":null,
        "name":"Silvio",
        "email":"ianaz90@gmail.com",
        "street":null,
        }
    
  • Response  406
  • Headers
    Content-Type: application/json
    Body
    [
        {
        "field":"email",
        "message":"A user with this e-mail address is already existing"
        },
        {
        "field":"password",
        "message":"Password should have at least 5 characters"
        }
        ]
    
Logged User details
/user

Will return user details when logged or a 401 Unauthorized if user is not logged. User details will be complete (e-mail, street,..)

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        id: 1,
        displayName: "ianaz",
        imageUrl: "http://graph.facebook.com/710883759/picture",
        name: "Silvio",
        email: "ianaz90@gmail.com",
        street: "Kilchbergstrasse 174"
        }
    
  • Response  401
  • Headers
    Content-Type: application/json

Verify user 

Verify user
/user/verify/{id}/{hash}

Hash will be sent with the mail after registration

  • Parameters
  • id
    int (required) Example: 4

    User id to activate

    hash
    String (required) Example: a94a8fe5ccb19ba61c4c0873d391

    Secure hash

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        id: 1,
        displayName: "ianaz",
        imageUrl: "http://graph.facebook.com/710883759/picture",
        name: "Silvio",
        email: "ianaz90@gmail.com",
        street: "Kilchbergstrasse 174"
        }
    

User details 

Single User details
/user/{id}
  • Parameters
  • id
    int (required) Example: 4

    User id to retrieve data from

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"id":1,"displayName":"ianaz","imageUrl":"http://graph.facebook.com/710883759/picture","name":"Silvio"}
    
  • Response  401
  • Headers
    Content-Type: application/json

Signin 

Sign in resources

Login with facebook 

Sign in with facebook
/signin/facebook{scope}
  • Parameters
  • scope
    String (required) Example: email,offline_access

    Facebook login requires the following string: email,offline_access

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        id: 1,
        displayName: "ianaz",
        imageUrl: "http://graph.facebook.com/710883759/picture",
        name: "Silvio",
        email: "ianaz90@gmail.com",
        street: "Kilchbergstrasse 174"
        }
    
  • Response  401
  • Headers
    Content-Type: application/json

Category 

Categories related resources

Categories list 

Retrieve first level of categories
/category
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    [
        {
        id: 1,
        name: "Vehicles",
        father: null,
        total_ads: 5
        },
        {
        id: 2,
        name: "Jobs",
        father: null,
        total_ads: 4
        },
        {
        id: 3,
        name: "Flat & Houses",
        father: null,
        total_ads: 6
        },
        {
        id: 4,
        name: "Services",
        father: null,
        total_ads: 0
        },
        {
        id: 5,
        name: "Pets",
        father: null,
        total_ads: 0
        },
        {
        id: 6,
        name: "For Sale",
        father: null,
        total_ads: 0
        },
        {
        id: 7,
        name: "Community",
        father: null,
        total_ads: 1
        }
        ]
    

Category details 

Category details
/category/{categoryId}

Will return category details with their related ads.

  • Parameters
  • categoryId
    int (required) Example: 8

    Filter data only for ads in the specified categoryId without children categories’s ads.

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    [
        {
        id:9,
        title:"Motorboot Draco 2500 TC / Standplatz Z�rchsee",
        price:12000,
        currency:"CHF",
        description:"2 Kabinenboot 4 Schlafpl�tze Toilette K�che Flybridge 2 Motoren Mercruiser 140 mit Z Bugstrahl Ankerwinch Fishfinder Kompas Navi Musikanlage 6 LS Rettungsmaterial Beiboot mit El Aussenborder und grossem Funreif. Zustand gut,alles funktioniert. Zugelassen f�r 10 Pers. Standplatz beim Rapperswiler Damm kann �bernommen werden. Preis ist verhandelbar.",
        category:{
        id:19,
        name:"Other Vehicles",
        father:{
        id:1,
        name:"Vehicles",
        father:null,
        total_ads:6
        },
        total_ads:1
        },
        views:64
        },
        {
        id: 4,
        title: "Designer at Zattix",
        price: null,
        currency: "CHF",
        description: "Our mission is to be the first website that empowers user to buy and even sell on the interconnected webosphere. minimum of 12+ years experience with Photoshop.",
        category: {
        id: 20,
        name: "Accounting",
        father: {
        id: 2,
        name: "Jobs",
        father: null,
        total_ads: 4
        },
        total_ads: 1
        },
        views: 546
        }
        ]
    

City 

Cities related resources

Get city by position 

List all City
/city/detect{latitude}{longitude}
  • Parameters
  • latitude
    float (required) Example: 47.335831

    Latitude

    longitude
    float (required) Example: 8.540401

    Longitude

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        id: 5359,
        zip: "8246",
        name: "Alt Paradies",
        region: "Z�rich",
        lang: "de"
        }
    
  • Response  204
  • Headers
    Content-Type: application/json

Language 

Languages related resources

List all languages 

List all languages
/language
  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    [
        {
        id: "de",
        name: "Deutsch"
        },
        {
        id: "en",
        name: "English"
        },
        {
        id: "fr",
        name: "Français"
        },
        {
        id: "it",
        name: "Italiano"
        }
        ]
    

Generated by aglio on 26 Nov 2014