Get started
API Endpoint https://api.getportal.ai/
To use this API, you need to generate an API key.
Autenticated
# Authorization : Bearer {{ ACCESS_TOKEN }}
All API calls are authenticated using the API token, generated by SignUp or SignIn. Your token must be included in the HTTP authorization header, preceded by the literal string "Bearer" with a single space separating the two strings. Any API call made without the correct authorization header will return a 401 'Unauthorized.'
Generate Api Key
https://api.getportal.ai/signin
curl --request POST 'https://api.getportal.ai/signin' \ --header 'Content-Type: application/json' \ --data-raw '{ "email": "email@email.com", "password": "password", }'
Description
Result example : { "access_token":"b5c66117d3eceab8ec66", "type_subscription":"User" } Example of how to use the token : X-Authorization : "Bearer b5c66117d3eceab8ec66"
Create new token for Autenticated Calls, the resulting token of the call will be preceded by the literal string "Bearer" with a single space separating the two strings
BODY PARAMETERS
Field | Type | Description |
---|---|---|
String | Required | |
password | String | Required |
Locations :
Related to all locations
Post addLocation
https://api.getportal.ai/addLocation
curl --request POST 'https://api.getportal.ai/addLocation' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Name Location",
"plan": 0,
"country": "IT",
"address_street": "Street Number",
"address_city": "City",
"address_province": "Province",
"address_zip": "CODE"
}'
Add a new location
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
name | String | (Required) name of location |
plan | integer | Required |
country | String | (Required) Country code of location |
address_street | String | (Required) Complete Address |
address_city | String | (Required) City |
address_province | String | (Required) Province |
address_zip | Integer | (Required) Zip Code |
Get LocationsId
curl --location --request GET 'http://api.getportal.ai/LocationsId' \ --header 'X-Authorization: Bearer Code'
Returns all location ID
Description
Result example :
[
1,
2,
3
]
Get locations
curl --location --request GET 'https://api.getportal.ai/locations' \ --header 'X-Authorization: Bearer Code'
Return a complete detailed information about all locations and devices
Description
Result example :
{
"total": 3,
"results": [
{
"id": 1,
"name": "Name Location",
"address_street": "Street 13",
"address_city": "City",
"SSID_WIFI": "SSID",
"PASS_WIFI": "PSW",
"wait_time": 415,
"opening_time": "07:00:00",
"closing_time": "22:20:00",
"rest_day": "Saturday,Sunday",
"staff": 8,
"staff_assignement_clients": 40,
"device": [
{
"id": 1,
"location_id": 1,
"safe_capacity": 40,
"serial": "0000000000",
"model": "demo",
"name": "Name Doorway",
"DepthNear": "600",
"DepthFar": "3200",
"Threshold": "125",
"LineEntry": "130",
"LineExit": "100",
"BlobAreaMin": "20",
"BlobAreaMax": "20000",
"CropAreaTop": "0",
"CropAreaBottom": "240",
"CropAreaLeft": "0",
"CropAreaRight": "320",
"CPUTemperature": null,
"Firmware": null,
"FPS": null,
"MACAddress": null,
"LastReboot": null
}
],
"target_capacity": 2000,
"legal_capacity": 6000,
"size_area": 20000
},
{
"id": 2,
"name": "Name Location",
"address_street": "Street 13",
"address_city": "City",
"SSID_WIFI": "SSID",
"PASS_WIFI": "PSW",
"wait_time": 415,
"opening_time": "07:00:00",
"closing_time": "22:20:00",
"rest_day": "Saturday,Sunday",
"staff": 8,
"staff_assignement_clients": 40,
"device": [
{
"id": 2,
"location_id": 2,
"safe_capacity": 40,
"serial": "0000000000",
"model": "demo",
"name": "Name Doorway",
"DepthNear": "600",
"DepthFar": "3200",
"Threshold": "125",
"LineEntry": "130",
"LineExit": "100",
"BlobAreaMin": "20",
"BlobAreaMax": "20000",
"CropAreaTop": "0",
"CropAreaBottom": "240",
"CropAreaLeft": "0",
"CropAreaRight": "320",
"CPUTemperature": null,
"Firmware": null,
"FPS": null,
"MACAddress": null,
"LastReboot": null
}
],
"target_capacity": 2000,
"legal_capacity": 6000,
"size_area": 20000
}
]
}
Get averageLocations
curl --location --request GET
'http://api.getportal.ai/averageLocations?event=''&start_time=''&end_time='''\
--header 'X-Authorization: Bearer Code'
Return the people's average related to a specific time range
Request Headers
X-Authorization
Result example :
{
"results": [
{
"id": 1,
"everage": 71
},
{
"id": 2,
"everage": 96
},
{
"id": 6,
"everage": 73
}
]
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
event | String | (Required) The value can be : today| lastday| week| mount| range. |
start_time | Date | (Required) Formate date YYY-MM-DD |
end_time | Date | (Required) Formate date YYY-MM-DD |
Get listLocationsBasic
curl --location --request GET 'https://api.getportal.ai/listLocationsBasic' \
--header 'X-Authorization: Bearer Code'
Return a basic information about all locations
Request Headers
X-Authorization
Result example :
{
"total": 3,
"results": [
{
"id": 1,
"name": "Name Location",
"address_city": "City",
"staff": 8,
"staff_assignement_clients": 40,
"device": 1,
"target_capacity": 2000,
"legal_capacity": 6000
},
{
"id": 2,
"name": "Name Location",
"address_city": "City",
"staff": 9,
"staff_assignement_clients": 48,
"device": 1,
"target_capacity": 4000,
"legal_capacity": 5000
}
]
}
Get alerts
curl --location --request GET 'https://api.getportal.ai/alerts' \
--header 'X-Authorization: Bearer Code'
Return all the alerts
Request Headers
X-Authorization
Result example :
{
"alerts_device": [
{
"location_id": 1,
"sensor_name": "Doorway",
"id": 1,
"sensor_id": 1,
"alert_email": "mail@mail.it",
"alert_sms": "",
"notify_freq": 0,
"target_capacity": 2,
"status": "true"
}
],
"alerts": [
{
"location_name": "Location",
"id": 4,
"location_id": 6,
"alert_email": "mail@mail.it",
"alert_sms": "+393333333333",
"notify_freq": 0,
"target_capacity": 38,
"status": "false"
}
]
}
Post deleteDisplay
curl --location --request POST 'https://api.getportal.ai/deleteDisplay' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "location",
"id": "id",
"token": "token"
}'
Delete the current display related to location or device assigned by token
Request Headers
X-Authorization
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
type | String | (Required) The value can be : location| device. |
id | integer | (Required) |
token | String | (Required) |
Get densityDisplay
curl --location --request GET 'http://api.getportal.ai/density' \
--header 'X-Authorization: Bearer Code'
Return all the settings related to the created displays
Request Headers
X-Authorization
Result example :
{
"densitylocations": [
{
"created_at": "04-05-2021",
"location_id": 1,
"location_name": "Cafe Portal",
"legal_capacity": 333,
"safe_capacity": 33,
"display_name": "Vetrina",
"display_type": "tablet",
"message": "",
"wait_time": 507,
"wait": 1,
"percentage": 0,
"reset_counter": 0,
"token": "d12117cb097b38e8c1a952cf3e3de4216e8f850adbbe6ff0a574b9c2fa46159e"
}
],
"densitysesnsor": [
{
"created_at": "20-05-2021",
"sensor_id": 14,
"sensor_name": "Porta Secondaria",
"legal_capacity": 100,
"safe_capacity": 50,
"display_name": "Ingresso Vetrina X",
"display_type": "desktop",
"message": "Vi auguriamo buon acquisto \nwww.sitointernet.com",
"wait_time": 514,
"wait": 1,
"percentage": 1,
"reset_counter": 1,
"token": "917457a8b7cc2317b306b736671aa7cf67a1e3405e3c47667b7f50157deb37f3"
}
],
"nodensitylocation": "nodensitylocation"
}
User :
information about user
Get userInfo
curl --location --request GET 'https://api.getportal.ai/userInfo' \
--header 'X-Authorization: Bearer Code'
General info user
Request Headers
X-Authorization
Result example :
{
"id": 1,
"email": "mail@mail.it",
"password": "T45GF54TY6",
"first_name": "Portal",
"last_name": "Demo",
"active": 1,
"type_subscription": "Demo",
"last_activity": null,
"created_at": "2021-05-03T12:32:43.000000Z",
"updated_at": "2021-05-11T09:58:44.000000Z"
}
post changeEmail
curl --location --request POST 'https://api.getportal.ai/changeEmail' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"current_email": "mail@gmail.com",
"new_email": ""
}'
Change the current email
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
current_email | String | (Required) |
new_email | String | (Required) |
del userLogout
curl --location --request DELETE 'https://api.getportal.ai/userLogout' \
--header 'X-Authorization: Bearer Code' \
Log out all the current logged user
Request Headers
X-Authorization
Get BillingList
curl --location --request GET 'https://api.getportal.ai/billingList' \
--header 'X-Authorization: Bearer Code'
Wip
Request Headers
X-Authorization
Result example :
Get ReportsMail
curl --location --request GET 'https://api.getportal.ai/reportsMail' \
--header 'X-Authorization: Bearer Code'
log out all the current logged user to report
Request Headers
X-Authorization
Result example :
{
"report": [
{
"id": 18,
"user_id": 1,
"mail": "mail@gmail.com",
"frequency": "Daily",
"status": "true"
},
{
"id": 19,
"user_id": 1,
"mail": "mail@gmail.com",
"frequency": "Weekly",
"status": "true"
},
{
"id": 20,
"user_id": 1,
"mail": "mail@gmail.com",
"frequency": "Monthly",
"status": "true"
}
]
}
post addReportsMail
curl --location --request POST 'https://api.getportal.ai/addReportsMail' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "mail@mail.com",
"frequency": "daily"
}'
Add a new email report with the related frequency
Request Headers
X-Authorization
Result example :
{
"user_id": 1,
"mail": "mail@mail.com",
"frequency": "daily",
"updated_at": "2021-06-11T08:24:10.000000Z",
"created_at": "2021-06-11T08:24:10.000000Z",
"id": 21
}
BODY PARAMETERS
Field | Type | Description |
---|---|---|
String | (Required) | |
frequency | String | (Required) The value can be : daily| weekly| monthly. |
post reportsMailEvent
curl --location --request POST 'https://api.getportal.ai/reportsMailEvent?event=&report_id=' \
--header 'X-Authorization: Bearer Code' \
Turn on/off and delete the notification activated
Request Headers
X-Authorization
Result example :
{
"user_id": 1,
"mail": "mail@mail.com",
"frequency": "daily",
"updated_at": "2021-06-11T08:24:10.000000Z",
"created_at": "2021-06-11T08:24:10.000000Z",
"id": 21
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
event | String | (Required) event : delete|onoff |
report_id | integer | (Required) |
Single location :
https://api.getportal.ai/loc/{{LOCATION_ID}}/* where {{LOCATION_ID}} = location_id Scope a single location
post role
curl --location --request POST 'https://api.getportal.ai/loc/{{LOCATION_ID}}/role' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "mail@mail.it",
"role": "subuser"
}'
Assignend the role or subuser
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
String | (Required) | |
role | String | (Required) can be : subuser|owner. |
name | String | (Required) |
post addDeviceQR
curl --location --request POST 'https://api.getportal.ai/loc/{{LOCATION_ID}}/addDeviceQR' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"SSID_WIFI": "SSID_WIFI",
"PASS_WIFI": "PASS_WIFI",
"name": "name device"
}'
Set the device through QRcode approach , return the string generated by QRCode
Request Headers
X-Authorization
Result example :
"SSID_WIFI,PASS_WIFI,1,1, ,name device"
BODY PARAMETERS
Field | Type | Description |
---|---|---|
SSID_WIFI | String | (Required) |
PASS_WIFI | String | (Required) |
name | String | (Required) |
post sendDeviceQR
curl --location --request POST 'https://api.getportal.ai/loc/{{LOCATION_ID}}/sendDeviceQR' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "mail@mail.com",
"name": "Name device"
}'
Send the QRCode image to email
Request Headers
X-Authorization
Result example :
"qr img png"
BODY PARAMETERS
Field | Type | Description |
---|---|---|
String | (Required) | |
name | String | (Required) |
get location
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/location' \
--header 'X-Authorization: Bearer Code' \
Return the detail of the location
Request Headers
X-Authorization
Result example :
{
"id": 1,
"name": "Cafe Portal",
"country": "IT",
"address_street": "Via Tagliamento 13",
"address_city": "FIRENZE",
"address_province": "FIRENZE",
"address_zip": "50126",
"SSID_WIFI": "SSID_WIFI",
"PASS_WIFI": "PASS_WIFI",
"opening_time": "07:00:00",
"closing_time": "22:20:00",
"rest_day": "",
"staff": 8,
"staff_assignement_clients": 40
}
put editLocation
curl --location --request PUT 'https://api.getportal.ai/loc/{{LOCATION_ID}}/editLocation' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"name": "Cafe Portal",
"country": "IT",
"address_street": "Via Tagliamento 13",
"address_city": "FIRENZE",
"address_province": "FIRENZE",
"address_zip": "50126",
"opening_time": "07:00:00",
"closing_time": "22:20:00",
"rest_day": "",
"staff": 8,
"staff_assignement_clients": 40
}'
Modify the detail of the location
Request Headers
X-Authorization
Result example :
{
"id": 1,
"name": "Cafe Portal",
"country": "IT",
"address_street": "Via Tagliamento 13",
"address_city": "FIRENZE",
"address_province": "FIRENZE",
"address_zip": "50126",
"SSID_WIFI": "SSID_WIFI",
"PASS_WIFI": "PASS_WIFI",
"opening_time": "07:00:00",
"closing_time": "22:20:00",
"rest_day": "",
"staff": 8,
"staff_assignement_clients": 40
}
BODY PARAMETERS
Field | Type | Description |
---|---|---|
name | String | (Optional) |
country | String | (Optional) |
address_street | String | (Optional) |
address_city | String | (Optional) |
address_province | String | (Optional) |
opening_time | Time | (Optional) |
closing_time | Time | (Optional) |
rest_day | String | (Optional) |
staff | String | (Optional) |
staff_assignement_clients | String | (Optional) |
post setCapacity
curl --location --request POST 'https://api.getportal.ai/loc/{{LOCATION_ID}}/setCapacity' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"legal_capacity": "200",
"target_capacity": "100",
"size_area": "1200"
}'
Set the legal and target capacity
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
legal_capacity | Integer | (Optional) |
target_capacity | Integer | (Optional) |
size_area | Integer | (Optional) |
get addressLocation
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/addressLocation' \
--header 'X-Authorization: Bearer Code' \
return the address and polar coordinate
Request Headers
X-Authorization
Result example :
{
"id": 1,
"name_location": "Name Location",
"address": "City Street 13 State",
"lat": 43.750955,
"lng": 11.306095,
"current_people": 225
}
get status
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/status' \
--header 'X-Authorization: Bearer Code' \
return the current people inside the store
Request Headers
X-Authorization
Result example :
{
"current_people": 220
}
get reports
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/reports' \
--header 'X-Authorization: Bearer Code' \
return an alternative list of location details
Request Headers
X-Authorization
Result example :
{
"legal_capacity": 6000,
"target_capacity": 2000,
"size_area": 20000,
"opening_time": "07:00",
"closing_time": "22:20",
"rest_day": "",
"staff": 8,
"sensor": 1
}
get eventsL
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/eventsL?event=&start_time=&end_time=&start_range_time=&end_range_time=&showDays=&timezone=' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
return an alternative list of location event
Request Headers
X-Authorization
Result example :
{
"results": [
{
"hour": "00:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "01:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "02:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "03:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "04:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "05:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "06:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "07:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "08:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "09:00",
"location_id": 1,
"location_name": "Cafe Portal",
"Peak": 316
},
{
"hour": "10:00",
"Entries": 239,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "11:00",
"Entries": 142,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "12:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "13:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "14:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "15:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "16:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "17:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "18:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "19:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "20:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "21:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "22:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
},
{
"hour": "23:00",
"Entries": 0,
"location_id": 1,
"location_name": "Cafe Portal"
}
]
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
event | String | (Required) The value can be : today| lastday| week| mount| 2mount| 3mount| 6mount| range. |
start_time | Date | (Optional) YYYY-MM-DD |
end_time | Date | (Optional) YYYY-MM-DD |
start_range_time | Integer | (Optional) 0 to 24 |
end_range_time | Integer | (Optional) 0 to 24 |
showDays | String | (Optional) showDays : Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday |
timezone | String | (Optional) Europe/Rome |
get eventsLocationLine
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/eventsLocationLine?event=&start_time=&end_time=&start_range_time=&end_range_time=&showDays=&timezone=' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
Return a complete list of event useful for draw a line chart
Request Headers
X-Authorization
Result example :
{
"id": "Cafe Portal",
"data": [
{
"x": "00:00",
"y": 0
},
{
"x": "01:00",
"y": 0
},
{
"x": "02:00",
"y": 0
},
{
"x": "03:00",
"y": 0
},
{
"x": "04:00",
"y": 0
},
{
"x": "05:00",
"y": 0
},
{
"x": "06:00",
"y": 0
},
{
"x": "07:00",
"y": 0
},
{
"x": "08:00",
"y": 0
},
{
"x": "09:00",
"y": 316
},
{
"x": "10:00",
"y": 239
},
{
"x": "11:00",
"y": 216
},
{
"x": "12:00",
"y": 33
},
{
"x": "13:00",
"y": 0
},
{
"x": "14:00",
"y": 0
},
{
"x": "15:00",
"y": 0
},
{
"x": "16:00",
"y": 0
},
{
"x": "17:00",
"y": 0
},
{
"x": "18:00",
"y": 0
},
{
"x": "19:00",
"y": 0
},
{
"x": "20:00",
"y": 0
},
{
"x": "21:00",
"y": 0
},
{
"x": "22:00",
"y": 0
},
{
"x": "23:00",
"y": 0
}
]
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
event | String | (Required) The value can be : today| lastday| week| mount| 2mount| 3mount| 6mount| range. |
start_time | Date | (Optional) YYYY-MM-DD |
end_time | Date | (Optional) YYYY-MM-DD |
start_range_time | Integer | (Optional) 0 to 24 |
end_range_time | Integer | (Optional) 0 to 24 |
showDays | String | (Optional) showDays : Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday |
timezone | String | (Optional) Europe/Rome |
get eventsLHeatMap
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/eventsLHeatMap?event=' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
return a complete list of events useful for draw a heat map chart
Request Headers
X-Authorization
Result example :
{
"index": [
"Mon 12",
"Tue 13",
"Wed 14",
"Thu 15",
"Fri 16",
"Mon 19",
"Tue 20",
"Wed 21",
"Thu 22",
"Fri 23",
"Mon 26",
"Tue 27",
"Wed 28",
"Thu 29",
"Fri 30",
"Mon 03",
"Tue 04",
"Wed 05",
"Thu 06",
"Fri 07",
"Mon 10",
"Tue 11",
"Wed 12"
],
"results": [
{
"hour": "13:00",
"Mon 12": 0,
"Tue 13": 0,
"Wed 14": 0,
"Thu 15": 0,
"Fri 16": 0,
"Mon 19": 0,
"Tue 20": 0,
"Wed 21": 0,
"Thu 22": 0,
"Fri 23": 0,
"Mon 26": 0,
"Tue 27": 0,
"Wed 28": 0,
"Thu 29": 0,
"Fri 30": 0,
"Mon 03": 0,
"Tue 04": 290,
"Wed 05": 277,
"Thu 06": 353,
"Fri 07": 300,
"Mon 10": 339,
"Tue 11": 258,
"Wed 12": 322
},
{
"hour": "14:00",
"Mon 12": 0,
"Tue 13": 0,
"Wed 14": 0,
"Thu 15": 0,
"Fri 16": 0,
"Mon 19": 0,
"Tue 20": 0,
"Wed 21": 0,
"Thu 22": 0,
"Fri 23": 0,
"Mon 26": 0,
"Tue 27": 0,
"Wed 28": 0,
"Thu 29": 0,
"Fri 30": 0,
"Mon 03": 0,
"Tue 04": 341,
"Wed 05": 306,
"Thu 06": 323,
"Fri 07": 315,
"Mon 10": 313,
"Tue 11": 308,
"Wed 12": 314
},
{
"hour": "15:00",
"Mon 12": 0,
"Tue 13": 0,
"Wed 14": 0,
"Thu 15": 0,
"Fri 16": 0,
"Mon 19": 0,
"Tue 20": 0,
"Wed 21": 0,
"Thu 22": 0,
"Fri 23": 0,
"Mon 26": 0,
"Tue 27": 0,
"Wed 28": 0,
"Thu 29": 0,
"Fri 30": 0,
"Mon 03": 0,
"Tue 04": 364,
"Wed 05": 313,
"Thu 06": 332,
"Fri 07": 333,
"Mon 10": 323,
"Tue 11": 315,
"Wed 12": 350
}
],
"peak": {
"valuepeak": 388,
"daypeak": "Thu 06 May",
"timepeak": "20:00"
}
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
event | String | (Required) The value can be : today| lastday| week| mount| 2mount| 3mount| 6mount| range. |
get lastweekDaysweek
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/lastweekDaysweek' \
--header 'X-Authorization: Bearer Code' \
return a list of event and peak filtered by day related to last week
Request Headers
X-Authorization
Result example :
{
"results": [
{
"day": "Friday 04",
"Entries": 3264,
"location_id": 1
},
{
"day": "Saturday 05",
"Entries": 3412,
"location_id": 1
},
{
"day": "Sunday 06",
"Entries": 0,
"location_id": 1
},
{
"day": "Monday 07",
"Entries": 3516,
"location_id": 1
},
{
"day": "Tuesday 08",
"Entries": 3517,
"location_id": 1
},
{
"day": "Wednesday 09",
"Entries": 3281,
"location_id": 1
},
{
"day": "Thursday 10",
"Entries": 3289,
"location_id": 1
}
],
"max": 3868
}
get todayYesterday
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/todayYesterday' \
--header 'X-Authorization: Bearer Code' \
Return the compared value related to current people from yesterday and today in decimal and in percentage
Request Headers
X-Authorization
Result example :
{
"today": 3078,
"yesterday": 3455,
"diff_people": -377,
"percentage": -10
}
get weekLastweek
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/weekLastweek' \
--header 'X-Authorization: Bearer Code' \
return the compared value related to current people from last week and current week in decimal and in percentage
Request Headers
X-Authorization
Result example :
{
"last7days": 20447,
"currentweek_forcast": 14747,
"diff_people": -5700,
"percentage": -27
}
get forecastDaysweek
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/forecastDaysweek' \
--header 'X-Authorization: Bearer Code' \
return the forecasted value related to current people from last week and current week in decimal and in percentage
Request Headers
X-Authorization
Result example :
get liveFeedSpace
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/liveFeedSpace' \
--header 'X-Authorization: Bearer Code' \
return the detail about current people
Request Headers
X-Authorization
Result example :
{
"current_people": 532,
"entry": 1200,
"avg": 171,
"target_capacity": 2000,
"full": 26
}
get devices
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/devices' \
--header 'X-Authorization: Bearer Code' \
return a complete list of devices with details
Request Headers
X-Authorization
Result example :
{
"email": "portaldemo@getportal.ai",
"user_id": 1,
"location_id": 1,
"SSID_WIFI": null,
"PASS_WIFI": null,
"devices": [
{
"id": 1,
"safe_capacity": 40,
"name": "Porta Principale",
"DepthNear": "600",
"DepthFar": "3200",
"Threshold": "125",
"LineEntry": "130",
"LineExit": "100",
"BlobAreaMin": "20",
"BlobAreaMax": "20000",
"CropAreaTop": "0",
"CropAreaBottom": "240",
"CropAreaLeft": "0",
"CropAreaRight": "320",
"CPUTemperature": null,
"Firmware": null,
"FPS": null,
"MACAddress": null,
"LastReboot": null
}
]
}
get staffChart
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/staffChart' \
--header 'X-Authorization: Bearer Code' \
return a complete list of staff details last seven days
Request Headers
X-Authorization
Result example :
{
"start": "Fri 04 Jun",
"end": "Fri 11 Jun",
"data": [
{
"date": "Fri 04",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Sat 05",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Sun 06",
"Staff/Hour": 0,
"People/Hour": 0
},
{
"date": "Mon 07",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Tue 08",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Wed 09",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Thu 10",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Fri 11",
"Staff/Hour": 3,
"People/Hour": 1
}
]
}
get staff_chartPrediction
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/staff_chartPrediction' \
--header 'X-Authorization: Bearer Code' \
return a complete list of staff details forecasted
Request Headers
X-Authorization
Result example :
{
"end": "Sat 19 Jun",
"start": "Sat 12 Jun",
"data": [
{
"date": "Sat 12",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Sun 13",
"Staff/Hour": 0,
"People/Hour": 0
},
{
"date": "Mon 14",
"Staff/Hour": 5,
"People/Hour": 1
},
{
"date": "Tue 15",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Wed 16",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Thu 17",
"Staff/Hour": 6,
"People/Hour": 1
},
{
"date": "Fri 18",
"Staff/Hour": 5,
"People/Hour": 1
}
]
}
post addAlertLocation
curl --location --request PUT 'https://api.getportal.ai/loc/{{LOCATION_ID}}/addAlertLocation' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"alert_email" : "mail@gmail.com",
"alert_sms" : "33333333333",
"notify_freq" : "5",
"target_capacity" : "20"
}'
Set a new alert
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
alert_email | String | (Optional) |
alert_sms | String | (Optional) |
notify_freq | String | (Required) |
target_capacity | String | (Required) |
post addensityLocation
curl --location --request PUT 'https://api.getportal.ai/loc/{{LOCATION_ID}}/addensityLocation' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"treshold_people":120,
"safe_capacity":200,
"display_name":"vetrina",
"display_type":"desktop",
"message":"message",
"wait": 1,
"percentage": 1
}'
Add a new occupancy display
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
treshold_people | Integer | (Required) |
safe_capacity | Integer | (Required) |
display_name | String | (Required) |
display_type | String | (Required) |
message | String | (Required) |
wait | Integer | (Required) |
percentage | Integer | (Required) |
Single Device :
https://api.getportal.ai/loc/{{LOCATION_ID}}/dev/{{DEVICE_ID}}/* where {{LOCATION_ID}} = location_id // where {{DEVICE_ID}} = device_id Scope a single device
get device
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/dev/{{DEVICE_ID}}/device' \
--header 'X-Authorization: Bearer Code' \
Return a complete details of device
Request Headers
X-Authorization
Result example :
{
"id": 1,
"user_id": 1,
"location_id": 1,
"firmware_id": null,
"safe_capacity": 40,
"serial": "0000000000",
"model": "demo",
"name": "Porta Principale",
"status": "active",
"private_key": "3599dba1ce82f6f43e6e2d08c8ea6d7202487e1269c0fd9a9f1f4589b204a3de",
"first_activity": "2021-05-03 15:14:28",
"last_activity": "2021-06-11 14:19:33",
"last_ip": "10.0.0.2",
"DepthNear": "600",
"DepthFar": "3200",
"Threshold": "125",
"LineEntry": "130",
"LineExit": "100",
"BlobAreaMin": "20",
"BlobAreaMax": "20000",
"CropAreaTop": "0",
"CropAreaBottom": "240",
"CropAreaLeft": "0",
"CropAreaRight": "320",
"CPUTemperature": null,
"Firmware": null,
"FPS": null,
"MACAddress": null,
"LastReboot": null,
"created_at": "2021-05-03T13:14:28.000000Z",
"updated_at": "2021-06-11T12:19:33.000000Z",
"SSID_WIFI": "SSID_WIFI",
"PASS_WIFI": "PASS_WIFI"
}
post setDevice
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/dev/{{DEVICE_ID}}/setDevice' \
--header 'X-Authorization: Bearer Code' \
--data-raw '{
"name": "porta destra",
"safe_capacity" : "100"
}'
set the safe capacity and
Request Headers
X-Authorization
Result example :
get eventsD
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/dev/{{DEVICE_ID}}/eventsD?event=&start_time=&end_time=&start_range_time=&end_range_time=&showDays=&timezone=' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
return an alternative list of device event
Request Headers
X-Authorization
Result example :
{
"results": [
{
"day": "07",
"Entries": 3513,
"sensor_id": 1,
"sensor_name": "Porta Principale"
},
{
"day": "08",
"sensor_id": 1,
"sensor_name": "Porta Principale",
"Peak": 3517
},
{
"day": "09",
"Entries": 3279,
"sensor_id": 1,
"sensor_name": "Porta Principale"
},
{
"day": "10",
"Entries": 3289,
"sensor_id": 1,
"sensor_name": "Porta Principale"
},
{
"day": "11",
"Entries": 3373,
"sensor_id": 1,
"sensor_name": "Porta Principale"
},
{
"day": "12",
"Entries": 3300,
"sensor_id": 1,
"sensor_name": "Porta Principale"
},
{
"day": "13",
"Entries": 0,
"sensor_id": 1,
"sensor_name": "Porta Principale"
},
{
"day": "14",
"Entries": 791,
"sensor_id": 1,
"sensor_name": "Porta Principale"
}
]
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
event | String | (Required) The value can be : today| lastday| week| mount| 2mount| 3mount| 6mount| range. |
start_time | Date | (Optional) YYYY-MM-DD |
end_time | Date | (Optional) YYYY-MM-DD |
start_range_time | Integer | (Optional) 0 to 24 |
end_range_time | Integer | (Optional) 0 to 24 |
showDays | String | (Optional) showDays : Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday |
timezone | String | (Optional) Europe/Rome |
post addAlertDevice
curl --location --request PUT 'https://api.getportal.ai/loc/{{LOCATION_ID}}/dev/{{DEVICE_ID}}/addAlertDevice' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"alert_email" : "mail@gmail.com",
"alert_sms" : "33333333333",
"notify_freq" : "5",
"target_capacity" : "20"
}'
add a new alerts to device
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
alert_email | String | (Optional) |
alert_sms | String | (Optional) |
notify_freq | String | (Required) |
target_capacity | String | (Required) |
post addensityDevice
curl --location --request PUT 'https://api.getportal.ai/loc/{{LOCATION_ID}}/dev/{{DEVICE_ID}}/addensityDevice' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"treshold_people":120,
"safe_capacity":200,
"display_name":"vetrina",
"display_type":"desktop",
"message":"message",
"wait": 1,
"percentage": 1
}'
add a new display to the device
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
treshold_people | Integer | (Required) |
safe_capacity | Integer | (Required) |
display_name | String | (Required) |
display_type | String | (Required) |
message | String | (Required) |
wait | Integer | (Required) |
percentage | Integer | (Required) |
Integration sales
The Sales Portal module within Platform allows to integrate the data generated by the compatible cash register (currently DinamoRetail, SDSotf). Using the authenticated call SALES_RECEIPT
The SALES_RECEIPT call requires the following parameters :
Notes:
It is important to identify the location on which to activate the service, so it is important to make sure that the ID corresponds with the associated store (check city, address or anything else useful).
get static_token
curl --location --request GET 'https://api.getportal.ai/loc/{{LOCATION_ID}}/static_token' \
--header 'X-Authorization: Bearer Code' \
--header 'Content-Type: application/json' \
--data-raw '{
"cash_integration_type": "DinamoRetail"
}'
Result example :
{
"static_token_sales": "Bearer 2ujd39udj39r4hc9h49hg93hd93h934"
}
The STATIC_TOKEN call generates a static token linked to a unique location.
It is important to pass as a parameter the string cash_integration_type which intends the unique name of the cash register, for example DinamoRetail.
Request Headers
X-Authorization
BODY PARAMETERS
Field | Type | Description |
---|---|---|
cash_integration_type | String | (Required) The value can be : DinamoRetail,SD-Soft |
POST sales_receipt
curl --location --request POST 'https://api.getportal.ai/sales_receipt' \
--header 'Content-Type: application/json' \
--data-raw '{
"static_token": "Bearer 2ujd39udj39r4hc9h49hg93hd93h934",
"location_id": 33 ,
"data": [
{
"date": "2022-01-01",
"hour": "17:20:44",
"seller_id": "00000046",
"seller_name": "Name Seller",
"amount": 136.0,
"net_amount": 111.48,
"currency": "EUR",
"payment_method": "cash",
"sale_items": [
{
"name": "Name Item",
"quantity": 1.0,
"category": "Category Item"
},
{
"name": "Name Item",
"quantity": 1.0,
"category": "Category Item"
}
]
},
{
"date": "2022-01-01",
"hour": "17:20:44",
"seller_id": "00000046",
"seller_name": "Name Seller",
"amount": 106.0,
"net_amount": 101.48,
"currency": "EUR",
"payment_method": "credit card",
"sale_items": [
{
"name": "Name Item",
"quantity": 1.0,
"category": "Category Item"
}
]
}
]
}'
Result example success:
{
"message": "successfully"
}
Result example error:
{
"error": "Unauthorized location"
}
Once generated :
We are ready to use SALES_RECEIPT that allows to record the receipts on the DB Portal.
In a single call can be sent simultaneously several receipts containing one or more items
BODY PARAMETERS
Field | Type | Description |
---|---|---|
static_token | String | Required |
location_id | Integer | Required |
data | Array | (Required) Inside the data object reside one or more receipts |
date | Date | Required |
hour | Time | Required |
seller_id | String | Required |
seller_name | String | Required |
amount | Float | Required |
net_amount | Float | Required |
payment_method | String | Required |
sale_items | Array | (Required) Inside the sale_items object reside one or more items |
name | String | Required |
quantity | Integer | Required |
category | String | Required |
Unauthenticated
Post recoverypassword
curl --location --request POST 'https://api.getportal.ai/recoverypassword' \
--data-raw '{
"email": "mail@mail.com"
}'
Recovery your password
BODY PARAMETERS
Field | Type | Description |
---|---|---|
String | (Required) |