Experience Endpoints Actions
https://api.losant.com/applications/APPLICATION_ID
/experience/endpoints
Below are the various requests that can be performed against the Experience Endpoints resource, as well as the expected parameters and the potential responses.
Get
Returns the experience endpoints for an application
Method And Url
GET https://api.losant.com/applications/APPLICATION_ID
/experience/endpoints
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Application.read
, all.Organization
, all.Organization.read
, all.User
, all.User.read
, experienceEndpoints.*
, or experienceEndpoints.get
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
Request Query Parameters
Name | Required | Description | Default | Example |
---|---|---|---|---|
sortField | N | Field to sort the results by. Accepted values are: order, method, route, id, creationDate, requestCount, lastUpdated | order | sortField=order |
sortDirection | N | Direction to sort the results by. Accepted values are: asc, desc | asc | sortDirection=asc |
filterField | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: method, route | filterField=method | |
filter | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | filter=my*route | |
experienceGroupId | N | Filter endpoints to those only in the specified group | experienceGroupId=575ec8687ae143cd83dc4a97 | |
requestCountDuration | N | If set, a count of recent requests is included on each endpoint for the duration requested (milliseconds) | requestCountDuration=86400000 | |
version | N | Return the experience endpoints belonging to this version | develop | version=develop |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/experience/endpoints
Successful Responses
Code | Type | Description |
---|---|---|
200 | Experience Endpoints | Collection of experience endpoints |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if application was not found |
Post
Create a new experience endpoint for an application
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID
/experience/endpoints
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Organization
, all.User
, experienceEndpoints.*
, or experienceEndpoints.post
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Request Body
The body of the request should be serialized JSON that validates against the Experience Endpoint Post schema. For example, the following would be a valid body for this request:
{
"route": "/my/route/{id}",
"method": "get",
"access": "public"
}
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"route":"/my/route/{id}","method":"get","access":"public"}' \
https://api.losant.com/applications/APPLICATION_ID/experience/endpoints
Successful Responses
Code | Type | Description |
---|---|---|
201 | Experience Endpoint | Successfully created experience endpoint |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if application was not found |
Stats
Get statistics about endpoint requests
Method And Url
GET https://api.losant.com/applications/APPLICATION_ID
/experience/endpoints/stats
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Application
, all.Application.read
, all.Organization
, all.Organization.read
, all.User
, all.User.read
, experienceEndpoints.*
, or experienceEndpoints.stats
.
Request Path Components
Path Component | Description | Example |
---|---|---|
APPLICATION_ID | ID associated with the application | 575ec8687ae143cd83dc4a97 |
Request Query Parameters
Name | Required | Description | Default | Example |
---|---|---|---|---|
statGrouping | N | Field to group the statistics by. Accepted values are: statusCode, endpointId, version, domain | statusCode | statGrouping=statusCode |
duration | N | Duration in milliseconds | 86400000 | duration=86400000 |
end | N | End of time range in milliseconds since epoch | 0 | end=0 |
resolution | N | Resolution in milliseconds | 3600000 | resolution=3600000 |
versionFilter | N | Filters the stats to a particular experience version | versionFilter=myVersion | |
domainFilter | N | Filters the stats to a particular experience domain or slug | domainFilter=mycustomdomain.com | |
statusCodeFilter | N | Filters the stats to a particular status code | statusCodeFilter=200 | |
endpointIdFilter | N | Filters the stats to a particular endpoint | endpointIdFilter=575ec8687ae143cd83dc4a98 |
Request Headers
Name | Required | Description | Default |
---|---|---|---|
Authorization | Y | The token for authenticating the request, prepended with Bearer |
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/experience/endpoints/stats
Successful Responses
Code | Type | Description |
---|---|---|
200 | Experience Endpoint Stats | Statistics for endpoint requests |
Error Responses
Code | Type | Description |
---|---|---|
400 | Error | Error if malformed request |
404 | Error | Error if application was not found |
Schemas
Error
Schema for errors returned by the API
Error Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 2 keys
- ▶{} 1 key
- ▶{} 1 key
Error Example
- ▶{} 2 keys
- "NotFound"
- "Application was not found"
Experience Endpoint
Schema for a single Experience Endpoint
Experience Endpoint Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 19 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 1 key
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 2 keys
Experience Endpoint Example
- ▶{} 10 keys
- "58c1de6c8f812590d8e82980"
- "58c1de6c8f812590d8e82980"
- "575ec8687ae143cd83dc4a97"
- "2016-06-13T04:00:00.000Z"
- "2016-06-13T04:00:00.000Z"
- "/my/route/{id}"
- true
- "get"
- "group"
- ▶[] 1 item
Experience Endpoint Post
Schema for the body of an Experience Endpoint creation request
Experience Endpoint Post Schema
- ▶{} 5 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 10 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 1 key
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 3 keys
- ▶{} 1 key
- ▶{} 1 key
- false
- ▶[] 2 items
Experience Endpoint Post Example
- ▶{} 3 keys
- "/my/route/{id}"
- "get"
- "public"
Experience Endpoint Stats
Schema for stats for an experience's endpoints
Experience Endpoint Stats Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 1 key
Experience Endpoint Stats Example
- ▶{} 2 keys
- ▶[] 2 items
- ▶[] 2 items
Experience Endpoints
Schema for a collection of Experience Endpoints
Experience Endpoints Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 10 keys
- ▶{} 2 keys
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 1 key
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 1 key
Experience Endpoints Example
- ▶{} 8 keys
- ▶[] 1 item
- 1
- 4
- 1
- 0
- "name"
- "asc"
- "575ec8687ae143cd83dc4a97"
Was this page helpful?
Still looking for help? You can also search the Losant Forums or submit your question there.