Skip to main content

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 ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
sortFieldNField to sort the results by. Accepted values are: order, method, route, id, creationDate, requestCount, lastUpdatedordersortField=order
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
filterFieldNField to filter the results by. Blank or not provided means no filtering. Accepted values are: method, routefilterField=method
filterNFilter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.filter=my*route
experienceGroupIdNFilter endpoints to those only in the specified groupexperienceGroupId=575ec8687ae143cd83dc4a97
requestCountDurationNIf set, a count of recent requests is included on each endpoint for the duration requested (milliseconds)requestCountDuration=86400000
versionNReturn the experience endpoints belonging to this versiondevelopversion=develop

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe 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

CodeTypeDescription
200Experience EndpointsCollection of experience endpoints

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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 ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe 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

CodeTypeDescription
201Experience EndpointSuccessfully created experience endpoint

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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 ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
statGroupingNField to group the statistics by. Accepted values are: statusCode, endpointId, version, domainstatusCodestatGrouping=statusCode
durationNDuration in milliseconds86400000duration=86400000
endNEnd of time range in milliseconds since epoch0end=0
resolutionNResolution in milliseconds3600000resolution=3600000
versionFilterNFilters the stats to a particular experience versionversionFilter=myVersion
domainFilterNFilters the stats to a particular experience domain or slugdomainFilter=mycustomdomain.com
statusCodeFilterNFilters the stats to a particular status codestatusCodeFilter=200
endpointIdFilterNFilters the stats to a particular endpointendpointIdFilter=575ec8687ae143cd83dc4a98

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe 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

CodeTypeDescription
200Experience Endpoint StatsStatistics for endpoint requests

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError 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.