{
  "swagger": "2.0",
  "info": {
    "description": "This document describe Immobiliare.it\\'s real time APIS to manage listings.\nEntities defined as payload are documented into the linked XSD schema and are the same adopted on batch import\\'s process. Take care is mandatory to send as payload **only** the entities `property`, `auction` or `realtor`. Not the root element `feed`.\n\nAPIs are protected by authentication using HTTP Basic Auth standard and documented into the specification guide. Access account (username, password and partner-id) are provided after service activation.\n\nEvery API entrypoint response is a `<ServiceResponse>` node, as described on the linked document.\n\n",
    "version": "1.0.0",
    "title": "Immobiliare.it - Listing Integration"
  },
  "host": "feed.immobiliare.it",
  "basePath": "/ws",
  "tags": [
    {
      "name": "property",
      "description": "endpoints for properties management"
    },
    {
      "name": "company",
      "description": "endpoints for companies and realtors management"
    },
    {
      "name": "auction",
      "description": "endpoints for auctions management"
    },
    {
      "name": "lead",
      "description": "endpoints for users leads management"
    },
    {
      "name": "user",
      "description": "endpoints for private users management"
    }
  ],
  "schemes": ["https"],
  "paths": {
    "/import/immobiliare/property": {
      "put": {
        "tags": [
          "property"
        ],
        "summary": "Upsert a property listing",
        "description": "create a new listing if it does not exists or update an existing one if it is already created",
        "consumes": [
          "text/xml"
        ],
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "An object matching the 'property' schema element",
            "required": true,
            "schema": {
              "$ref": "#/definitions/property"
            }
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "group for whom operation is performed",
            "required": true
          },
          {
            "in": "header",
            "name": "Content-Type",
            "type": "string",
            "description": "text/xml",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Listing created or updated with success"
          },
          "400": {
            "description": "generic error"
          },
          "404": {
            "description": "listing not found"
          }
        }
      },
      "delete": {
        "tags": [
          "property"
        ],
        "summary": "Removes a property listing",
        "description": "removes a listing identifying it by agency and external ID",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "username",
            "type": "string",
            "description": "the agency username",
            "required": true
          },
          {
            "in": "query",
            "name": "code",
            "type": "string",
            "description": "the listing external id",
            "required": true
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "listing removed"
          },
          "404": {
            "description": "listing not found"
          }
        }
      }
    },
    "/import/immobiliare/property/{listingId}": {
      "delete": {
        "tags": [
          "property"
        ],
        "summary": "Removes a property listing",
        "description": "removes a listing identifying it by internal ID",
        "consumes": [
          "text/xml"
        ],
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "listingId",
            "type": "integer",
            "description": "the internal listing id",
            "required": true
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "listing removed"
          },
          "404": {
            "description": "listing not found"
          }
        }
      }
    },
    "/export/property/{propertyId}": {
      "get": {
        "tags": [
          "property"
        ],
        "summary": "Returns a property listing",
        "description": "Returns a property listing by id",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "propertyId",
            "description": "the property id ",
            "required": true,
            "type": "integer"
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "the partner group",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Returns property"
          },
          "404": {
            "description": "property not found"
          }
        }
      }
    },
    "/export/property": {
      "get": {
        "tags": [
          "property"
        ],
        "summary": "Returns property",
        "description": "Returns property by id, uuid or by external-id and partner group",
        "produces": [
          "application/json",
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "propertyId",
            "description": "the property id",
            "type": "integer"
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "the partner group ",
            "type": "string",
            "required": true
          },
          {
            "in": "query",
            "name": "uuid",
            "description": "the property uuid",
            "type": "string"
          },
          {
            "in": "query",
            "name": "external-id",
            "description": "the property external-id",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns property"
          },
          "404": {
            "description": "property not found"
          }
        }
      }
    },
    "/import/immobiliare/auction": {
      "put": {
        "tags": [
          "auction"
        ],
        "summary": "Auction UPSERT",
        "description": "Add or update a _judicial auction_ listing",
        "consumes": [
          "text/xml"
        ],
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "A XML's node based on the `auction` schema",
            "required": true,
            "schema": {
              "$ref": "#/definitions/auction"
            }
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "group for whom operation is performed",
            "required": true
          },
          {
            "in": "header",
            "name": "Content-Type",
            "type": "string",
            "description": "text/xml"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Generic error"
          },
          "404": {
            "description": "Listing not found"
          }
        }
      },
      "delete": {
        "tags": [
          "auction"
        ],
        "summary": "Remove a judicial auction by username and external-id",
        "description": "Remove a _judicial auction_ listing identified by agency `username` and `external-id`",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "username",
            "type": "string",
            "description": "Agency username",
            "required": true
          },
          {
            "in": "query",
            "name": "code",
            "type": "string",
            "description": "Agency choosen unique id (external-id)",
            "required": true
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "Group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Removed with success"
          },
          "404": {
            "description": "Listing not found"
          }
        }
      }
    },
    "/import/immobiliare/auction/{listingId}": {
      "delete": {
        "tags": [
          "auction"
        ],
        "summary": "Remove judicial auction by internal id",
        "description": "Remove a judicial auction listing using our listingId Immobiliare/Getrix",
        "consumes": [
          "text/xml"
        ],
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "listingId",
            "type": "integer",
            "description": "Listing Id ",
            "required": true
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "Group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Listing removed with success"
          },
          "404": {
            "description": "Listing not found"
          }
        }
      }
    },
    "/export/auction/{auctionId}": {
      "get": {
        "tags": [
          "auction"
        ],
        "summary": "Returns an auction from catalog in immobiliare.it",
        "description": "Returns an auction by id from catalog in immobiliare.it",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "auctionId",
            "description": "The auction id",
            "required": true,
            "type": "integer"
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "the partner group",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the auction"
          },
          "404": {
            "description": "auction not found"
          }
        }
      }
    },
    "/export/auction": {
      "get": {
        "tags": [
          "auction"
        ],
        "summary": "Returns the auction from catalog in immobiliare.it",
        "description": "Returns the auction from catalog in immobiliare.it by id, uuid or by external-id and partner group",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "auctionId",
            "description": "the auction id",
            "type": "integer"
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "the partner group",
            "type": "string",
            "required": true
          },
          {
            "in": "query",
            "name": "uuid",
            "description": "the auction uuid",
            "type": "string"
          },
          {
            "in": "query",
            "name": "external-id",
            "description": "the auction external-id",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "returns the auction"
          },
          "404": {
            "description": "auction not found"
          }
        }
      }
    },
    "/import/immobiliare/company/realtor": {
      "put": {
        "tags": [
          "company"
        ],
        "summary": "Add or update a realtor",
        "description": "Add or update a _realtor_ entity",
        "consumes": [
          "text/xml"
        ],
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "A XML node based on the `agent` schema",
            "required": true,
            "schema": {
              "$ref": "#/definitions/agent"
            }
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "Group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Added or updated with success"
          },
          "400": {
            "description": "Generic rrore"
          },
          "404": {
            "description": "Realtor not found"
          }
        }
      }
    },
    "/export/group/{groupName}/company": {
      "get": {
        "tags": [
          "company"
        ],
        "summary": "Returns the companies list",
        "description": "Returns the companies list by name group",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "groupName",
            "type": "string",
            "description": "The name group",
            "required": true
          },
          {
            "in": "query",
            "name": "onlyActive",
            "type": "boolean",
            "default": false,
            "description": "if 'true' filters the companies with status='true' or status='test'",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the companies list that belong to the same group"
          },
          "400": {
            "description": "Bad request sent"
          },
          "404": {
            "description": "Companies of group not found"
          }
        }
      }
    },
    "/export/company/{companyId}": {
      "get": {
        "tags": [
          "company"
        ],
        "summary": "Returns company by id",
        "description": "Returns a company by id",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "companyId",
            "type": "integer",
            "description": "The company id",
            "required": true
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "The partner group",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the company"
          },
          "400": {
            "description": "Bad request sent"
          },
          "404": {
            "description": "Company not found"
          }
        }
      }
    },
    "/export/company": {
      "get": {
        "tags": [
          "company"
        ],
        "summary": "Returns company",
        "description": "Returns company data by id, uuid or by external-id and partner group",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "companyId",
            "type": "integer",
            "description": "The company Id",
            "required": false
          },
          {
            "in": "query",
            "name": "uuid",
            "type": "string",
            "description": "The company uuid",
            "required": false
          },
          {
            "in": "query",
            "name": "externalId",
            "type": "string",
            "description": "external id",
            "required": false
          },
          {
            "in": "query",
            "name": "listings",
            "type": "boolean",
            "default": false,
            "description": "the listings related by company",
            "required": false
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "the partner group",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Returns company by id"
          },
          "400": {
            "description": "Bad request sent"
          },
          "404": {
            "description": "Company not found"
          }
        }
      }
    },
    "/import/immobiliare/company": {
      "delete": {
        "tags": [
          "company"
        ],
        "summary": "Removes a company",
        "description": "Removes a company by id, uuid or external-id and partner group",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "companyId",
            "type": "integer",
            "description": "the company id",
            "required": false
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "The partner group",
            "type": "string",
            "required": true
          },
          {
            "in": "query",
            "name": "uuid",
            "type": "string",
            "description": "The company uuid",
            "required": false
          },
          {
            "in": "query",
            "name": "externalId",
            "type": "string",
            "description": "The external-id",
            "required": false
          },
          {
            "in": "query",
            "name": "username",
            "type": "string",
            "description": "The company username",
            "required": false
          },
          {
            "in": "query",
            "name": "hardDelete",
            "type": "boolean",
            "description": "if true it enables a permanent deletion of the agency",
            "default": false,
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Company successfully removed"
          },
          "400": {
            "description": "Bad request"
          },
          "404": {
            "description": "Company not found"
          }
        }
      }
    },
    "/ws/import/immobiliare/company": {
      "put": {
        "tags": [
          "company"
        ],
        "summary": "Add or update a company",
        "description": "Add or update a company",
        "produces": [
          "text/xml"
        ],
        "consumes": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "A XML's node based on the `agent` schema",
            "required": true,
            "schema": {
              "$ref": "#/definitions/agent"
            }
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "group for whom operation is performed",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad request"
          },
          "404": {
            "description": "Company not found"
          }
        }
      }
    },
    "/import/immobiliare/lead": {
      "put": {
        "tags": [
          "lead"
        ],
        "summary": "Add a lead",
        "description": "Add a lead",
        "produces": [
          "text/xml"
        ],
        "consumes": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "A XML's node based on the `lead` schema",
            "required": true,
            "schema": {
              "$ref": "#/definitions/lead"
            }
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "description": "group for whom operation is performed",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad request"
          },
          "404": {
            "description": "Lead not found"
          }
        }
      }
    },
    "/import/immobiliare/user": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Returns the private user",
        "description": "Returns the private user by username or uuid",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "username",
            "type": "string",
            "description": "private user username",
            "required": false
          },
          {
            "in": "query",
            "name": "uuid",
            "type": "string",
            "description": "private user uuid",
            "required": false
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "Group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the user"
          },
          "400": {
            "description": "Bad request sent"
          },
          "404": {
            "description": "User not found"
          }
        }
      },
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Auction UPSERT",
        "description": "Add or update a private user",
        "consumes": [
          "text/xml"
        ],
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "A XML's node based on the `user` schema",
            "required": true,
            "schema": {
              "$ref": "#/definitions/user"
            }
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "group for whom operation is performed",
            "required": true
          },
          {
            "in": "header",
            "name": "Content-Type",
            "type": "string",
            "description": "text/xml"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Generic error"
          },
          "404": {
            "description": "User not found"
          }
        }
      },
      "delete": {
        "tags": [
          "user"
        ],
        "summary": "Remove a private user",
        "description": "Remove a private user identified by `username` or `uuid`",
        "produces": [
          "text/xml"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "username",
            "type": "string",
            "description": "private user username",
            "required": false
          },
          {
            "in": "query",
            "name": "uuid",
            "type": "string",
            "description": "private user uuid",
            "required": false
          },
          {
            "in": "header",
            "name": "X-IMMO-SOURCE",
            "type": "string",
            "description": "Group for whom operation is performed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Removed with success"
          },
          "404": {
            "description": "User not found"
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "basicAuth": {
      "type": "basic"
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "definitions": {
    "auction": {
      "type": "object",
      "description": "For a complete <auction> model look at the XSD linked on top",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int32",
          "xml": {
            "attribute": true
          }
        },
        "operation": {
          "type": "string",
          "xml": {
            "attribute": true
          }
        }
      }
    },
    "property": {
      "type": "object",
      "description": "For a complete <property> model look at the XSD linked on top",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int32",
          "xml": {
            "attribute": true
          }
        },
        "operation": {
          "type": "string",
          "xml": {
            "attribute": true
          }
        }
      }
    },
    "agent": {
      "type": "object",
      "description": "For a complete <agent> model look at the XSD linked on top",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32",
          "xml": {
            "attribute": true
          }
        },
        "external-id": {
          "type": "string",
          "xml": {
            "attribute": true
          }
        },
        "uuid": {
          "type": "string",
          "xml": {
            "attribute": true
          }
        }
      }
    },
    "lead": {
      "type": "object",
      "description": "For a complete <lead> model look at the XSD linked on top",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int32",
          "xml": {
            "attribute": true
          }
        },
        "operation": {
          "type": "string",
          "xml": {
            "attribute": true
          }
        }
      }
    },
    "user": {
      "type": "object",
      "description": "For a complete <user> model look at the XSD linked on top",
      "properties": {
        "ID": {
          "type": "integer",
          "format": "int32",
          "xml": {
            "attribute": true
          }
        },
        "operation": {
          "email": "string",
          "xml": {
            "attribute": true
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Check xsd schema here",
    "url": "/ws/import/docs/import-schema"
  }
}