# Location Information
# Get Location List
By using this API endpoint, it is possible to get list of locations that are created under a Tenant. Tenant represents customer and Locations represent their venues / branches / stores / physical locations.
# Endpoint
GET /locations
# Response
TIP
HTTP/1.1 200 OK
{
"data": [
{
"id": "ZV4NljAPlq5",
"name": "Costa Jeddah Street",
"description": "",
"address": "Costa Jeddah Street",
"post_code": null,
"city": "",
"state": "",
"country_code": "SA",
"login_page_name": "Prelogin (Live)",
"login_page_id": "MmOPgO4P26x",
"post_login_page_name": "Postlogin (Live)",
"post_login_page_id": "elka5Y9aBn2",
"external_location_id": "",
"lat": "24.5013014",
"lng": "23.5013014",
"is_trashed": false
}
],
"links": {
"first": "https://api.iperawifi.com/api/v1/locations?page=1",
"last": null,
"prev": null,
"next": "https://api.iperawifi.com/api/v1/locations?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"path": "https://api.iperawifi.com/api/v1/locations",
"per_page": 10,
"to": 1
}
}
# Get Location Count
By using this API endpoint, it is possible to get the count of the locations that are created under a Tenant.
# Endpoint
GET /locations/count
# Response
TIP
HTTP/1.1 200 OK
{
"count": 1000
}
# Get Location Hierarchy
By using this API endpoint, it is possible to get list of location hierarchy. Api endpoint returns width and height data as meter.
# Endpoint
GET /locations/hierarchy
# Response
TIP
HTTP/1.1 200 OK
{
"data": [
{
"id": "ZV4NljAPlq5",
"name": "West Location",
"lat": "24.5013014",
"lng": "54.3897024",
"buildings" : [
{
"id": "TV5NYkjLq8",
"name": "West Building",
"lat": "41",
"lng": "29",
"floors": [
{
"id": "pXYG90jQnzk",
"name": "West Floor F1",
"image": {
"name": "https://api.iperawifi.com/a/18_JdQRLpk6WGk/img/maps/Tmsöfdösn4sdfsfdsfsd.png",
"width": 5000,
"height": 3200
},
"dimensions": {
"width": 200,
"length": 200
},
"zones": []
},
{
"id": "gep9lKOma16",
"name": "West Floor F2",
"image": {
"name": "https://api.iperawifi.com/a/14_KLFDnldt5W9/img/maps/Kkjndfskfksbsdf.png",
"width": 4500,
"height": 3600
},
"dimensions": {
"width": 220,
"length": 192
},
"zones": [
{
"id": "Gvk9ZeDmPrV",
"name": "West Zone Z1"
}
]
}
]
}
]
},
...
]
}
# Create Location
Create a new location with given attributes.
# Endpoint
POST /locations
# Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | ✔ | Name of the location. Min. 5 characters. |
country_code | string | Country code. ISO 3166-1 alpha-2 country code. | |
city | string | City of the location. | |
address | string | Address of the location. | |
post_code | string | Post code of the location. | |
description | string | Description. | |
smart_login | int | Smart login enabled or not. 0: Disabled ( default ), 1: Enabled. | |
smart_login_frequency | int | Smart login frequency. Min. 1 | |
smart_login_frequency_type | int | Smart login frequency unit. 2: Hours, 3: Days |
# Response
TIP
HTTP/1.1 200 OK
{
"data": {
"id": "ZOpo383vB8X",
"name": "Convert Venue",
"description": "Optional description.",
"address": "115 East 23rd Street 5th Floor",
"post_code": "84500",
"city": "Dubai",
"state": null,
"country_code": "AE",
"login_page_name": null,
"login_page_id": null,
"post_login_page_name": null,
"post_login_page_id": null,
"external_location_id": null,
"lat": 25.6428852,
"lng": 55.1966358,
"is_trashed": false
}
}
Unprocessable Entity
HTTP/1.1 422 Unprocessable Entity
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"country_code": [
"The country code field is invalid. It must be ISO 3166-1 alpha-2 country code."
]
}
}
# Update Location
Update location information.
# Endpoint
PUT /locations/:id
# Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | ✔ | Name of the location. Min. 5 characters. |
country_code | string | Country code. ISO 3166-1 alpha-2 country code. | |
city | string | City of the location. | |
address | string | Address of the location. | |
post_code | string | Post code of the location. | |
description | string | Description. | |
smart_login | int | Smart login enabled or not. 0: Disabled ( default ), 1: Enabled. | |
smart_login_frequency | int | Smart login frequency. Min. 1 | |
smart_login_frequency_type | int | Smart login frequency unit. 2: Hours, 3: Days |
# Response
TIP
HTTP/1.1 200 OK
{
"data": {
"id": "ZOpo383vB8X",
"name": "Convert Venue",
"description": "Optional description.",
"address": "115 East 23rd Street 5th Floor",
"post_code": "84500",
"city": "Dubai",
"state": null,
"country_code": "AE",
"login_page_name": null,
"login_page_id": null,
"post_login_page_name": null,
"post_login_page_id": null,
"external_location_id": null,
"lat": 25.6428852,
"lng": 55.1966358,
"is_trashed": false
}
}
Unprocessable Entity
HTTP/1.1 422 Unprocessable Entity
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"country_code": [
"The country code field is invalid. It must be ISO 3166-1 alpha-2 country code."
]
}
}