Skip to main content

Event Actions

https://api.losant.com/applications/APPLICATION_ID/events/EVENT_ID

Below are the various requests that can be performed against the Event resource, as well as the expected parameters and the potential responses.

Delete

Deletes an event

Method And Url

DELETE https://api.losant.com/applications/APPLICATION_ID/events/EVENT_ID

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, event.*, or event.delete.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
EVENT_IDID associated with the event575ed0de7ae143cd83dc4aa5

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 DELETE \
https://api.losant.com/applications/APPLICATION_ID/events/EVENT_ID

Successful Responses

CodeTypeDescription
200SuccessIf event was successfully deleted

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if event was not found

Get

Retrieves information on an event

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/events/EVENT_ID

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, event.*, or event.get.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
EVENT_IDID associated with the event575ed0de7ae143cd83dc4aa5

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/events/EVENT_ID

Successful Responses

CodeTypeDescription
200EventEvent information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if event was not found

Patch

Updates information about an event

Method And Url

PATCH https://api.losant.com/applications/APPLICATION_ID/events/EVENT_ID

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, event.*, or event.patch.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97
EVENT_IDID associated with the event575ed0de7ae143cd83dc4aa5

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 Event Patch schema. For example, the following would be a valid body for this request:

{
"state": "acknowledged",
"comment": "Looking into this issue"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"state":"acknowledged","comment":"Looking into this issue"}' \
https://api.losant.com/applications/APPLICATION_ID/events/EVENT_ID

Successful Responses

CodeTypeDescription
200EventUpdated event information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if event is 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"

      Event

      Schema for a single Event

      Event Schema

      • {} 3 keys
        • "http://json-schema.org/draft-07/schema#"
        • "object"
        • {} 17 keys
          • {} 2 keys
            • {} 2 keys
              • {} 2 keys
                • {} 2 keys
                  • {} 2 keys
                    • {} 2 keys
                      • {} 2 keys
                        • {} 3 keys
                          • {} 2 keys
                            • {} 2 keys
                              • {} 3 keys
                                • {} 2 keys
                                  • {} 0 keys
                                    • {} 2 keys
                                      • {} 3 keys
                                        • {} 3 keys
                                          • {} 2 keys

                                        Event Example

                                        • {} 16 keys
                                          • "575ed0de7ae143cd83dc4aa5"
                                          • "575ed0de7ae143cd83dc4aa5"
                                          • "575ec8687ae143cd83dc4a97"
                                          • "2016-06-13T04:00:00.000Z"
                                          • "2016-06-13T04:00:00.000Z"
                                          • "user"
                                          • "575ed70c7ae143cd83dc4aa9"
                                          • "hello@example.com"
                                          • "info"
                                          • "new"
                                          • "Power levels critical"
                                          • "Power levels on device 432 have surpassed critical thresholds"
                                          • [] 0 items
                                            • "575ecf887ae143cd83dc4aa2"
                                            • "My Device"
                                            • {} 1 key

                                            Event Patch

                                            Schema for the body of an Event modification request

                                            Event Patch Schema

                                            • {} 4 keys
                                              • "http://json-schema.org/draft-07/schema#"
                                              • "object"
                                              • {} 4 keys
                                                • {} 2 keys
                                                  • {} 2 keys
                                                    • {} 0 keys
                                                      • {} 3 keys
                                                      • false

                                                    Event Patch Example

                                                    • {} 2 keys
                                                      • "acknowledged"
                                                      • "Looking into this issue"

                                                    Success

                                                    Schema for reporting a successful operation

                                                    Success Schema

                                                    • {} 3 keys
                                                      • "http://json-schema.org/draft-07/schema#"
                                                      • "object"
                                                      • {} 1 key
                                                        • {} 2 keys

                                                      Success Example

                                                      • {} 1 key
                                                        • true

                                                      Was this page helpful?


                                                      Still looking for help? You can also search the Losant Forums or submit your question there.