GetMeasure API version 2.0.0
This document presents the way to use the API “GetMeasure” V2. This REST API is developed in order to get measures from data warehouse. All examples given on this document are obtained with the demo version.
Remark:
- For your use, please, adapt the queries with your access (adequate URL).
/rpc
Get list of sites
get /rpc/get_site
Get list of sites
Headers
- Authorization: required(string)
Example:
Bearer your_token
HTTP status code 200
OK
Body
Media type: application/json
Type: any
Example:
[
{
"id_site": 850001,
"op_code": "850001",
"client_code": "850001",
"site_name": "Site 1"
}
]
HTTP status code 404
Unauthorized
Body
Media type: application/json
Type: any
Example:
{
"code": "PGRST301",
"details": null,
"hint": null,
"message": "JWSError (CompactDecodeError Invalid number of parts: Expected 3 parts; got 2)"
}
Get list of measures (entity analyzed) attached to a site
get /rpc/get_entity_analyzed
Get list of measures (entity analyzed) attached to a site
Headers
- Authorization: required(string)
Example:
Bearer your_token
Query Parameters
- id_site: required(integer)
Site from you want to get entities analyzed
Example:
850001
HTTP status code 200
OK
Body
Media type: application/json
Type: any
Example:
[
{
"id_entity_analyzed": 850001070001,
"entity_analyzed_name": "Porte 1",
"entity_analyzed_description": "Porte 1"
},
{
"id_entity_analyzed": 850001070002,
"entity_analyzed_name": "Porte 2",
"entity_analyzed_description": "Porte 2"
},
{
"id_entity_analyzed": 850001070003,
"entity_analyzed_name": "Porte 3",
"entity_analyzed_description": "Porte 3"
}
]
HTTP status code 404
Unauthorized
Body
Media type: application/json
Type: any
Example:
{
"code": "PGRST301",
"details": null,
"hint": null,
"message": "JWSError (CompactDecodeError Invalid number of parts: Expected 3 parts; got 2)"
}
Recovery of measurements associated with a site identified by an id over a period aggregated by step and labels
get /rpc/get_measure_by_site
Recovery of measurements associated with a site identified by an id over a period aggregated by step and labels
Headers
- Authorization: required(string)
Example:
Bearer your_token
Query Parameters
- id_site: required(integer)
Site from you want to get measures
Example:
850001
HTTP status code 200
OK
Body
Media type: application/json
Type: any
Example:
[
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-10-15T09:00:00",
"entrees": 241,
"sorties": 128,
"passage": 0,
"interest": 0,
"interest_duration": 0
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-10-15T09:00:00",
"entrees": 132,
"sorties": 1,
"passage": 0,
"interest": 0,
"interest_duration": 0
},
{
"id_entity_analyzed": "850001070003",
"date_time": "2023-10-15T09:00:00",
"entrees": 118,
"sorties": 19,
"passage": 0,
"interest": 0,
"interest_duration": 0
}
]
Recovery of measurements associated with a site identified by an id over a period aggregated by step. Get measures for all labels or a subset of labels
get /rpc/get_measure_by_site_and_label
Recovery of measurements associated with a site identified by an id over a period aggregated by step. Get measures for all labels or a subset of labels
Headers
- Authorization: required(string)
Example:
Bearer your_token
Query Parameters
- id_site: required(integer)
Site from you want to get measures
Example:
850001 - date_start: required(string)
end start of the period concerned by the measures' search
Example:
2023-08-15 09:00:00 - date_end: required(string)
description
Example:
2023-10-15 09:59:59 - step: required(string)
Step by what you want to aggregate parameters. Possible values = hour, day, week, month or year
Example:
month - labels: (string)
list of wanted labels.Possible values= Car, Bike, Moto, VUL, BUS, SemiRemorque, VIR, Porteur, Fourgon. If you don't set the labels parameter, you will get all labels.
Example:
{Car, Moto}
HTTP status code 200
OK
Body
Media type: application/json
Type: any
Example:
[
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-08-01T00:00:00",
"entrees": 65039,
"sorties": 50480,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Car"
},
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-09-01T00:00:00",
"entrees": 142621,
"sorties": 110243,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Car"
},
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-10-01T00:00:00",
"entrees": 72216,
"sorties": 53225,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Car"
},
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-08-01T00:00:00",
"entrees": 1535,
"sorties": 1359,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Moto"
},
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-09-01T00:00:00",
"entrees": 3494,
"sorties": 3016,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Moto"
},
{
"id_entity_analyzed": "850001070001",
"date_time": "2023-10-01T00:00:00",
"entrees": 1663,
"sorties": 1444,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Moto"
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-08-01T00:00:00",
"entrees": 36664,
"sorties": 484,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Car"
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-09-01T00:00:00",
"entrees": 77420,
"sorties": 1170,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Car"
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-10-01T00:00:00",
"entrees": 38418,
"sorties": 625,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Car"
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-08-01T00:00:00",
"entrees": 2175,
"sorties": 67,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Moto"
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-09-01T00:00:00",
"entrees": 4895,
"sorties": 146,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Moto"
},
{
"id_entity_analyzed": "850001070002",
"date_time": "2023-10-01T00:00:00",
"entrees": 2364,
"sorties": 67,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Moto"
}
]
Recovery of measurements associated with an analysis entity identified by an id over a period aggregated by step and labels
get /rpc/get_measure_by_entity
Recovery of measurements associated with an analysis entity identified by an id over a period aggregated by step and labels
Headers
- Authorization: required(string)
Example:
Bearer your_token
Query Parameters
- id_entity_analyzed: required(integer)
Entity analyzed from you want to get measures
Example:
850001070003 - date_start: required(string)
end start of the period concerned by the measures' search
Example:
2023-10-12 00:00:00 - date_end: required(string)
end date of the period concerned by the measures' search
Example:
2023-10-15 23:59:59 - step: required(string)
Step by what you want to aggregate parameters. Possible values = hour, day, week, month or year
Example:
day
HTTP status code 200
OK
Body
Media type: application/json
Type: any
Example:
[
{
"date_time": "2023-10-12T00:00:00",
"entrees": 2993,
"sorties": 804,
"passage": 0,
"interest": 0,
"interest_duration": 0
},
{
"date_time": "2023-10-13T00:00:00",
"entrees": 2888,
"sorties": 762,
"passage": 0,
"interest": 0,
"interest_duration": 0
},
{
"date_time": "2023-10-14T00:00:00",
"entrees": 2705,
"sorties": 665,
"passage": 0,
"interest": 0,
"interest_duration": 0
},
{
"date_time": "2023-10-15T00:00:00",
"entrees": 1957,
"sorties": 407,
"passage": 0,
"interest": 0,
"interest_duration": 0
}
]
Recovery of measurements associated with an analysis entity identified by an id over a period aggregated by step. Get measures for all labels or a subset of labels
get /rpc/get_measure_by_entity_and_label
Recovery of measurements associated with an analysis entity identified by an id over a period aggregated by step. Get measures for all labels or a subset of labels
Headers
- Authorization: required(string)
Example:
Bearer your_token
Query Parameters
- id_entity_analyzed: required(integer)
Entity analyzed from you want to get measures
Example:
850001070003 - date_start: required(string)
end start of the period concerned by the measures' search
Example:
2023-10-01 00:00:00 - date_end: required(string)
end date of the period concerned by the measures' search
Example:
2023-10-15 23:59:59 - step: required(string)
Step by what you want to aggregate parameters. Possible values = hour, day, week, month or year
Example:
week - labels: (string)
list of wanted labels.Possible values= Car, Bike, Moto, VUL, BUS, SemiRemorque, VIR, Porteur, Fourgon. If you don't set the labels parameter, you will get all labels.
Example:
{Bike}
HTTP status code 200
OK
Body
Media type: application/json
Type: any
Example:
[
{
"date_time": "2023-09-25T00:00:00",
"entrees": 98,
"sorties": 9,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Bike"
},
{
"date_time": "2023-10-02T00:00:00",
"entrees": 324,
"sorties": 56,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Bike"
},
{
"date_time": "2023-10-09T00:00:00",
"entrees": 290,
"sorties": 46,
"passage": 0,
"interest": 0,
"interest_duration": 0,
"label": "Bike"
}
]