# Clients

# Get all the clients

To get the list of all the clients in Wasi, you can count on the 'URI':

api.wasi.co/v1/client/search

This should return a JSON similar to this one:

{
    "total": 2,
    "0": {
        "id_client": 1,
        "id_user": "1",
        "client_types": [
            {
                "id_client_type": 7,
                "client_type_label": "Buscando"
            }
        ],
        "id_country": "1",
        "country_label": "Colombia",
        "id_region": "26",
        "region_label": "Quindío",
        "id_city": "63",
        "city_label": "Armenia",
        "id_client_status": "1",
        "id_client_origin": 124,
        "client_origin_label": "Portal Inmobliario",
        "first_name": "Pepito",
        "last_name": "Perez",
        "birthday": "1980-12-12",
        "identification": "11111111111",
        "email": "[email protected]",
        "phone": "11111111",
        "cell_phone": "31111111111111",
        "address": "Calle 1 # 1-11",
        "query": "",
        "comment": "",
        "reference": "",
        "send_information": true,
        "created_at": "2017-02-09 09:02:40",
        "updated_at": "0000-00-00 00:00:00",
        "tag": [
            {
                "id": 20,
                "etiqueta": "Nuevo Cliente",
                "color": "#eee"
            }
        ],
    },
    "1": {
        "id_client": 2,
        "id_user": "1",
        "client_types": [
            {
                "id_client_type": 7,
                "client_type_label": "Buscando"
            }
        ],
        "id_country": "1",
        "country_label": "Colombia",
        "id_region": "26",
        "region_label": "Quindío",
        "id_city": "63",
        "city_label": "Armenia",
        "id_client_status": "1",
        "id_client_origin": null,
        "client_origin_label": "",
        "first_name": "John",
        "last_name": "Doe",
        "birthday": "1955-12-12",
        "identification": "21111111111",
        "email": "[email protected]",
        "phone": "21111111",
        "cell_phone": "3211111111111",
        "address": "Calle 2 # 1-11",
        "query": "",
        "comment": "",
        "reference": "",
        "send_information": true,
        "created_at": "2017-02-09 09:02:40",
        "updated_at": "0000-00-00 00:00:00",
        "tag": []
    },
    "status": "success"
}

# Filtering

The filters are optional, below are listed the existing filters for the client search.

Filter Type Detail
query String Keywords to perform a search.
id_property Number Id of a property the client belongs to.
id_client_type Number Client type id, see the Client types section.
id_client_status Number Client status identifier, see the section Client status.
id_client_origin Number Client medium identifier, see section Client origin.
id_user Number Unique identifier of the user (agent or administrator) in charge.

# Paging and sorting

Filter Type
skip Number Offset, indicates from where the records are displayed, 0 by default (from the start, without omitting any).
take Number Limit, number of items to be listed, 10 by default (100 maximum).
order String Can take two values asc (Ascending) and desc (Descending), ascending by default.
order_by String Order by a specific criterion, full_name by default see order_by.

# order_by

Value Description
full_name Sort clients by full name.
created_at Sort clients by date of registration

# Get a client

To get a client in Wasi, you can count on the URI:

api.wasi.co/v1/client/get/#id_client

For a sample client whose id_client is 1, the URI would be

api.wasi.co/v1/client/get/1

This should return a JSON similar to this one:

{
    "id_client": 21,
    "id_user": 9,
    "client_types": [
        {
            "id_client_type": 7,
            "client_type_label": "Buscando"
        }
    ],
    "id_country": 1,
    "country_label": "Colombia",
    "id_region": 26,
    "region_label": "Quind\u00edo",
    "id_city": 63,
    "city_label": "Armenia",
    "id_client_status": 1,
    "id_client_origin": null,
    "client_origin_label": "",
    "first_name": "Jose",
    "last_name": "Capera",
    "birthday": "1991-12-19",
    "identificacion": "1094123123",
    "email": "[email protected]",
    "phone": "7400000",
    "cell_phone": "3001231234",
    "address": "Calle 12A #12-34",
    "query": "",
    "comment": "Interesado en el negocio",
    "reference": "",
    "send_information": true,
    "created_at": "2016-12-11 17:12:12",
    "updated_at": "2017-02-09 12:23:08",
    "tag": [
        {
            "id": 20,
            "etiqueta": "Nuevo Cliente",
            "color": "#eee"
        }
    ],
    "status": "success"
}

# Add a Client

To add a new client in Wasi, you have the URI:

api.wasi.co/v1/client/add

After sending the parameters correctly you should return a JSON like the one below:

{
    "id_client": 123456,
    "status": "success"
}

❗️ Important

The request can only be sent via POST, as it should be remembered that for all requests it is also necessary to send the access credentials, see Access Credentials.

# Client types

For client types there are some standard values public that can be taken by the client client_types (there are also private values that are customized by each company) the public values are:

To obtain the list of all the client types supported by Wasi and the ones customized by the company you must use the URI:

api.wasi.co/v1/client-type/all

This should return a JSON similar to the following:

{
    "0": {
        "id_client_type": 1,
        "name": "Comprador",
        "nombre": "Comprador",
        "public": true
    },
    "1": {
        "id_client_type": 2,
        "name": "Vendedor",
        "nombre": "Vendedor",
        "public": true
    },
    "2": {
        "id_client_type": 3,
        "name": "Arrendador",
        "nombre": "Arrendador",
        "public": true
    },
    "3": {
        "id_client_type": 4,
        "name": "Arrendatario",
        "nombre": "Arrendatario",
        "public": true
    },
    "4": {
        "id_client_type": 5,
        "name": "Propietario",
        "nombre": "Propietario",
        "public": true
    },
    "5": {
        "id_client_type": 6,
        "name": "Comisionista",
        "nombre": "Comisionista",
        "public": true
    },
    "6": {
        "id_client_type": 7,
        "name": "Buscando",
        "nombre": "Buscando",
        "public": true
    },
    "7": {
        "id_client_type": 8,
        "name": "Contacto Web",
        "nombre": "Contacto Web",
        "public": true
    },
    "8": {
        "id_client_type": 9,
        "name": "Codeudor",
        "nombre": "Codeudor",
        "public": true
    },
    "9": {
        "id_client_type": 10,
        "name": "Administrador",
        "nombre": "Administrador",
        "public": true
    },
    "10": {
        "id_client_type": 11,
        "name": "Inquilino",
        "nombre": "Inquilino",
        "public": true
    },
    "11": {
        "id_client_type": 12,
        "name": "Contacto Importado",
        "nombre": "Contacto Importado",
        "public": true
    },
    "12": {
        "id_client_type": 13,
        "name": "Comisionista",
        "nombre": "Comisionista",
        "public": false
    },
    "status": "success"
}

❗️ Important

For all the requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

# Client origins

For client origins there are standard values public that can be taken by the client client_origin (there are also private values that are customized by each company) the public values are:

Value Represents
124 Portal Inmobliario

In order to obtain the list of all the collection media supported by Wasi and those customized by the company, the URI must be used:

api.wasi.co/v1/client-origin/all

This should return a JSON similar to the following:

{
    "0": {
        "id_client_origin": 124,
        "name": "Portal Inmobliario",
        "public": true
    },
    "1": {
        "id_client_origin": 125,
        "name": "Directo",
        "public": false
    },
    "2": {
        "id_client_origin": 126,
        "name": "Feria Hogar Corferias 2018",
        "public": false
    },

    "status": "success"
}

❗️ Important

For all the requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

# Properties

# Relate to a property

You can relate a client to a property using both public and private client types, you can see them in the Client Types section.

To relate a property to a client you have the following URI:

POST api.wasi.co/v1/client/#id_client/add-property/#id_property

This URI also requires the parameter id_client_type, that is if we want to relate the client with id 1234 to the property 4321 and that the type of relationship is that this client is Owner (id 5 see Client Types), we should use the URI for this:

POST http://api.wasi.co/v1/client/1234/add-property/4321?id_client_type=5

If everything is in order, this should return a JSON similar to the following:

{
    "status": "success"
}

# Update the type of relation to a property

You can update a client's relationship to a property with the following URI:

POST api.wasi.co/v1/client/#id_client/update-property/#id_property

This URI also requires the parameter id_client_type, that is if we want to change the relationship of the client with id 1234 to the property 4321, and the type of relationship to be Searching (id 7 see Client Types), we should use the URI for this:

POST http://api.wasi.co/v1/client/1234/update-property/4321?id_client_type=7

If everything is in order, this should return a JSON similar to the following:

{
    "status": "success"
}

# Eliminate the relationship with a property

You can remove a client's relationship with a property by using the following URI:

POST api.wasi.co/v1/client/#id_client/remove-property/#id_property

If we want to eliminate the relationship of the client with id 1234 with the property 4321 we should use the URI for this:

POST http://api.wasi.co/v1/client/1234/remove-property/4321

If everything is in order, this should return a JSON similar to the following:

{
    "status": "success"
}

You can get the properties associated with a client with the following URI:

api.wasi.co/v1/client/properties/#id_client

If everything is in order, this should return a JSON similar to the following:

{
    "0": {
        "id_property": 1234,
        "title": "Propiedad 1",
        "id_client_type": 5,
        "client_type_label": "Propietario"
    },
    "1": {
        "id_property": 1235,
        "title": "Propiedad 2",
        "id_client_type": 1,
        "client_type_label": "Comprador"
    },
    "total": 2,
    "status": "success"
}

# Filtering

The filters are optional, below are listed the existing filters for the property search.

Filter Type Detail
id_client_type Number Client type identifier, see Client types.

# Paging

Filter Type
skip Number Offset, indicates from where the records are displayed, 0 by default (from the start, without omitting any).
take Number Limit, number of items to be listed, 10 by default (100 maximum).

❗️ Important

For all the requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

# Contact

You can generate a client contact using the URI:

api.wasi.co/v1/client/contact

If everything is in order, this should return a JSON similar to the following:

{
    "id_client": 123,
    "new_client": false,
    "status": "success"
}

❗️ Note

The returned value new_client indicates whether a new user was created with the contact.

# Parameters

The parameters for sending the contact are as follows.

Parameter Type Required Description
email String Yes Email of the client making the contact.
first_name String Yes Client's name
last_name String No Client's last name.
phone Number Yes Phone number.
id_country Number Yes Country identifier, see Countries.
id_region Number Yes Identifier of a region, see Regions.
id_city Number Yes City identifier, see Cities.
comment String No Client comments.
send_information Boolean No Boolean value (true or false) that indicates if the client wishes to receive information by email.
id_property Number No Unique identifier of a property.
id_client_type Number No Identifier that indicates the type of client, see the section Client types.

❗️ Note

If the id_property parameter is sent, the client will be associated with the property. If additional to id_property is sent send_information with true value, an email will be sent to the client with the information of the indicated property.

❗️ Important

For all the requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

# Offer

You can generate a client's offer via the URI:

api.wasi.co/v1/client/offer

If everything is in order, this should return a JSON similar to the following:

{
    "status": "success"
}

# Parameters

Los parámetros para el envío de la oferta son los siguientes.

Parameter Type Required Description
email String Yes Email of the client making the offer.
first_name String Yes Client's name
last_name String No Client's last name.
phone Number Yes Phone number.
id_country Number Yes Country identifier, see Countries.
id_region Number Yes Region identifier, see Regions.
id_city Number Yes City identifier, see Cities.
comment String No Client comments.
send_information Boolean No Boolean value (true or false) that indicates if the client wants to receive information to the email.

❗️ Important

For all the requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

# Send to a friend

You can generate the sending of a recommended property to a friend through the URL:

api.wasi.co/v1/client/contact-friend

If everything is in order, this should return a JSON similar to the following:

{
   "id_client": 123,
    "new_client": false,
    "status": "success"
}

❗️ Note

The value returned new_client indicates if a new user was created with the contact.

# Parameters

The parameters for sending to a friend are as follows.

Parameter Type Required Description
email String Yes Email of the contact to whom the message is sent.
first_name String Yes Name of the contact to whom the message is sent.
last_name String No Name of the contact to whom the message is sent.
phone Number No Number of the contact to whom the message is sent
id_country Number No Country identifier, see Countries.
id_region Number No Region identifier, see Regions.
id_city Number No City identifier, see Cities.
from_name String Yes Name of the person sending the message
comment String No Text sent in the message.
id_property Number Yes Unique identifier of a property.

❗️ Note

If the id_property parameter is sent, the client will be associated with the property. If additional to id_property is sent send_information with true value, an email will be sent to the client with the information of the indicated property.

❗️ Important

For all the requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

Last Updated: 8/3/2020, 9:51:52 PM