Next Place Prediction API Reference
The Sherpa.ai Next Place Prediction API is a REST API that provides developers with a framework and toolbox to formulate any request for Sherpa.ai, by using standard syntax technologies like HTTP Rest Services with a predefined set of URLs.
API Endpoints
All Sherpa.ai Next Place Prediction API endpoints will be served on https://api.sherpa.ai/v2
Name | Path | Description |
---|---|---|
Next Place | /items/routes | Next place |
Traking position | /tracking/positions | Tracking position |
Datasets | /tracking/uploadDataset | Upload dataset |
Header Parameters
All the API calls have common parameters in the header.
Request Header | Mandatory | Description |
---|---|---|
Authorization | ✓ | An authentication type followed by an access token. ex: Basic 73dbb14a-50d9-4277-897e-6cb48258d258 See Authentication section. |
Accept-Language | {lang}-{country} • lang: The ISO 639-1 language code in lowercase. • country: The country/region code as an uppercase ISO-3166 2-letter code. ex: en-GB, en-US, es-ES, es-MX | |
Time-Zone | ✓ | User’s time zone, in GMT +/- time or long format. ex: GMT+1:00, Europe/Berlin |
Accept | The response format of the body. If required, the response will be in application/json format by default.In some cases, we will require other formats, which will be specified in each method description. | |
Content-Type | The request format of the body. In most cases, it will be application/json . Otherwise, it will be specified in each method description. |
The specific header parameters will be defined in each API call.
Sherpa Request Info
Besides the specific information to be sent to each endpoint, Sherpa Request Info will gather the request context as a request header field.
The fields in RequestInfo are optional. However, each additional piece of data helps Sherpa.ai fetch a more tailored response and profile the user better, so including as many fields as possible is recommended.
For example, by setting the lat and lon fields to specify user location, Sherpa.ai can use that information to respond to queries related to restaurants or movies nearby.
Field | Type | Description |
---|---|---|
lat | Double | Latitude |
lon | Double | Longitude |
country_code | String | The country/region code as an uppercase ISO-3166 2-letter code |
destination | Object | The location where the user is headed |
Destination
Name | Path | Description |
---|---|---|
lat | Double | Latitude |
lon | Double | Longitude |
label | String | ex: Home |
Parameters
Each endpoint method will have a parameter table with explanatory information, along with an example. In this table, information will be provided for each field, like 'source', 'mandatory', 'type', and 'description'.
- Field
Parameter field -
Source
Where the parameter has to be placed- Query
Parameter is part of the URL -
Body
The parameter is set inside the body payloads part of a POST/PUT type method request. These parameters will be in JSON format and will require the corresponding header to be set:-H "content-type: application/json"
- Query
- Mandatory
Whether parameter is mandatory or not - Type
Value type [String, Integer, etc.] - Description
Additional information