# Banners

# Get all the banners

To get the list of all the banners in Wasi, you have the URI:

api.wasi.co/v1/banner/search

This should return a JSON similar to this one:

{
    "1": {
        "id_banner": 1,
        "title": "Banner 1",
        "link": "http://link.com/banner1",
        "id_status": "1",
        "status_label": "Active",
        "image": "https://images.wasi.co/publicidad/banner1.jpg",
        "position": 0
    },
    "2": {
        "id_banner": 2,
        "title": "Banner 2",
        "link": "http://link.com/banner2",
        "id_status": "2",
        "status_label": "Inactive",
        "image": "https://images.wasi.co/publicidad/banner2.jpg",
        "position": 1
    },
    "3": {
        "id_banner": 3,
        "title": "Banner 3",
        "link": "http://link.com/banner3",
        "id_status": "1",
        "status_label": "Active",
        "image": "https://images.wasi.co/publicidad/banner3.jpg",
        "position": 2
    },
    "total": 3,
    "status": "success"
}

# Filtering

To filter, the following options apply.

Filter Type
query String Keywords to perform a search.
id_status Number Id corresponding to the status of the banner, see Banner fields.
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)

# Get a banner

To get a banner in Wasi, you have to have the URI:

api.wasi.co/v1/banner/get/#id_banner

For a sample banner whose id_banner is 1, the URI would be:

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

This should return a JSON similar to this one:

{
    "id_banner": 1,
    "title": "Banner 1",
    "link": "http://link.com/banner1",
    "id_status": "1",
    "status_label": "Active",
    "image": "https://images.wasi.co/publicidad/bbanner1.jpg",
    "position": 1,
    "status": "success"
}

# Add a banner

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

api.wasi.co/v1/banner/add

To know which are the parameters that must be sent you can see the section Banner fields, the fields that we can send as a parameter in the table must appear as modifiable.

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

{
    "id_banner": 1,
    "title": "Banner 1",
    "link": "http://link.com/banner1",
    "id_status": "1",
    "status_label": "Active",
    "image": "https://images.wasi.co/publicidad/bbanner1.jpg",
    "position": 1,
    "status": "success"
}

❗️ Important

Parameters can be sent via GET or via POST, as well as remembering that for all requests it is also necessary to send the access credentials, see Access Credentials.

# Update Banner

To update a banner in Wasi, you have the URI:

api.wasi.co/v1/banner/update/#id_banner

To know which are the fields that can be updated you can see the section Banner fields, the fields that we can send as a parameter in the table must appear as modifiable.

For example if you want to change the title of the banner id_banner 3, you must do the following:

api.wasi.co/v1/banner/update/3?title=Test title

This should return a JSON like the next one:

{
     "id_banner": 3,
     "title": "Titulo test",
     "link": "http://link.com/banner3",
     "id_status": "1",
     "status_label": "Active",
     "image": "",
     "position": 0
}

❗️ Important

The parameters to be modified can be sent via GET or via POST, as well as remembering that for all requests it is also necessary to send the access credentials, see Access Credentials.

# Remove banner

To remove a banner in Wasi, you have the URI:

api.wasi.co/v1/banner/delete/#id_banner

For example if you want to remove the banner with id_banner 3, you should do the following:

api.wasi.co/v1/banner/delete/3

This should return a JSON like the next one:

{
    "id_banner": 3,
    "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.

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