> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.iot.telia.lt/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.iot.telia.lt/_mcp/server.

# List endpoint events

GET https://iot.telia.lt/api/v1/endpoint/{endpoint_id}/event

Returns the list of events, filtered, sorted and paged according to query parameters.

A full list of events is found in section "Retrieve Event Types" (`/api/v1/event/type`).

This API endpoint deviates from the specified conventions and may not return the same HTTP Codes as the higher layer call (`/api/v1/endpoint/{endpoint_id}`).
In case the requested `{endpoint_id}` doesn't exist or is not accessible for the user, **HTTP 200** will be returned with empty **\[]** as long as the provided `{endpoint_id}` is a number and all parameters are valid.

Please take that into consideration when building automation on top of the error behaviour of this endpoint.

Reference: https://docs.iot.telia.lt/developers/api/endpoint/endpoint-events-by-id

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Path parameters

- `endpoint_id` (integer, required) — Numeric ID of an endpoint

### Query parameters

- `page` (integer, optional) — Current page number
- `per_page` (integer, optional) — Defines the number of items per page
- `sort` (string, optional) — Sort properties according to a comma separated list of accepted fields. Valid fields are: * `id` - (**event id**) * `timestamp` - (**event timestamp**) * `source` - (**event source**) * `severity` - (**event severity**) * `alert` - (**alert status**) * `organisation` - (**organisation name**) * `user` - (**user id**) * `endpoint` - (**endpoint name**) * `tags` - (**endpoint tags**) * `ip_address` - (**endpoint ip_address**) * `iccid` - (**sim iccid**) * `imsi` - (**sim imsi**) * `type` - (**event type**)
- `q` (string, optional) — Filter parameter in `<filter>:<value>` format. Multiple filters must be a comma-separated list of the following fields: * `from` (**date**, format `YYYY-MM-DDTHH:mm:ssZ`, **only valid with until**) * `until` (**date**, format `YYYY-MM-DDTHH:mm:ssZ`, **only valid with from**) * `type` (**event\_type**, numerical) * `source` (**event\_type**, numerical, e.g. 0 = Network), 1 = Policy Control, 2 = API) * `severity` (**event\_severity**, numerical, e.g. 0 = Info, 1 = Warn), 2 = Critical) * `alert` (boolean, e.g. true, false) * `description` (**event description**, string) * `organisation` (**organisation name**, string) * `user` (**user name**, string) * `endpoint` (**endpoint name**, string) * `tags` (**endpoint tags**, string) * `tag_id` (**endpoint tag ID**, numerical, matches events whose endpoint has the tag. Tag IDs are listed in the endpoint's `tag_assignments`) * `ip_address` (**endpoint IP address**, valid IPv4/IPv6 address) * `imei` (**endpoint imei**, numerical string) * `iccid` (**sim iccid**, numerical string) * `imsi` (**sim imsi**, numerical string) * `timestamp` (**date**, format `YYYY-MM-DDTHH:mm:ssZ`, for querying events of 1 day, deprecated in future) * `iccid_with_luhn` (**sim iccid with Luhn**, numerical string) * `network` (**endpoint network**, string, e.g. Telekom) * `rat` (**event pdp context rat type**, numerical string, e.g. 6) * `country` (**endpoint country**, string, e.g. Germany) Some filters can accept up to 6 values which must be separated by the pipe symbol (`|`) or url-encoded as (`%7C`): * `iccid` (q: iccid:1234567890123456789|8988303000123456789) * `iccid_with_luhn` (q: iccid\_with\_luhn:12345678901234567891|89883030001234567891) * `endpoint` (q: endpoint:example\_endpoint\_name|another\_endpoint\_name) * `type` (q: type:example\_event\_type|another\_event\_type) * `network` (q: network:example\_network|another\_network) * `rat` (q: rat:example\_rat|another\_rat) * `country` (q: country:example\_country|another\_country) * `tag_id` (q: tag\_id:7|12, matches events whose endpoint has any of the tags)

## Response

### 200

Successfully returned a list of events

- `list of ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItems`

## Errors

### 400 Bad Request Error

**Bad Request** due to incorrect **Paging** Parameters, **Sorting** Parameter or incorrect `{endpoint_id}`

- `any`

### 403 Forbidden Error

Your role doesn't include the permission this endpoint requires. Most endpoints return `error_code`, `error_token`, and `message`. Some return only `status_code` and `message`.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `status_code` (integer, optional)
- `message` (string, optional)

### 422 Unprocessable Entity Error

**Unprocessable Entity** due to incorrect **Query** parameters

- `any`

## Types

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItems

- `timestamp` (string, optional)
- `alert` (boolean, optional)
- `description` (string, optional)
- `id` (integer, optional)
- `event_type` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEventType, optional)
- `event_source` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEventSource, optional)
- `event_severity` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEventSeverity, optional)
- `organisation` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsOrganisation, optional)
- `endpoint` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEndpoint, optional)
- `sim` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsSim, optional)
- `imsi` (ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsImsi, optional)

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEventType

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEventSource

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEventSeverity

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsOrganisation

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsEndpoint

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsSim

### ApiV1EndpointEndpointIdEventGetResponsesContentApplicationJsonSchemaItemsImsi

## Examples

### Default - No Filters or Sorting

**Response**

```json
[
  {
    "timestamp": "2020-07-20T12:07:09.000Z",
    "alert": true,
    "description": "PDP Context deleted.",
    "id": 69535,
    "event_type": {
      "description": "Delete PDP Context",
      "id": 4
    },
    "event_source": {
      "id": 0,
      "name": "Network"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 2,
      "name": "Organisation_Name"
    },
    "endpoint": {
      "id": 1,
      "imei": null,
      "ip_address": "10.199.6.39",
      "name": "Monitoring201",
      "tag_assignments": [
        {
          "id": 1,
          "name": "Monitoring",
          "tag_color": {
            "id": 3
          }
        }
      ],
      "tags": "Monitoring"
    },
    "sim": {
      "iccid": "8988317000000000000",
      "iccid_with_luhn": "89883170000000000001",
      "id": 110,
      "production_date": "2019-12-17T13:26:13.000Z"
    },
    "imsi": {
      "id": 110,
      "import_date": "2019-12-17T13:26:08.000Z",
      "imsi": "901430000000114"
    }
  }
]
```

**SDK Code**

```python Default - No Filters or Sorting
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Default - No Filters or Sorting
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Default - No Filters or Sorting
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Default - No Filters or Sorting
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Default - No Filters or Sorting
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Default - No Filters or Sorting
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Default - No Filters or Sorting
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Default - No Filters or Sorting
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Filter by Time Range

**Response**

```json
[
  {
    "timestamp": "2020-07-21T07:59:45.000Z",
    "alert": false,
    "description": "Data session ended.",
    "id": 69540,
    "event_type": {
      "description": "Delete PDP Context",
      "id": 4
    },
    "event_source": {
      "id": 0,
      "name": "Network"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 2,
      "name": "Organisation_Name"
    },
    "endpoint": {
      "id": 1,
      "imei": null,
      "ip_address": "10.199.6.39",
      "name": "Monitoring201",
      "tag_assignments": [
        {
          "id": 1,
          "name": "Monitoring",
          "tag_color": {
            "id": 3
          }
        }
      ],
      "tags": "Monitoring"
    },
    "sim": {
      "iccid": "8988317000000000000",
      "iccid_with_luhn": "89883170000000000001",
      "id": 110,
      "production_date": "2019-12-17T13:26:13.000Z"
    },
    "imsi": {
      "id": 110,
      "import_date": "2019-12-17T13:26:08.000Z",
      "imsi": "901430000000114"
    }
  }
]
```

**SDK Code**

```python Filter by Time Range
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

querystring = {"q":"from:2020-07-20T08:00:00Z,until:2020-07-21T08:00:00Z"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by Time Range
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Filter by Time Range
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Filter by Time Range
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Filter by Time Range
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by Time Range
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Filter by Time Range
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by Time Range
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event?q=from%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Filter by Event Type

**Response**

```json
[
  {
    "timestamp": "2020-07-16T14:23:11.000Z",
    "alert": false,
    "description": "PDP Context created.",
    "id": 68901,
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "id": 0,
      "name": "Network"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 2,
      "name": "Organisation_Name"
    },
    "endpoint": {
      "id": 1,
      "imei": null,
      "ip_address": "10.199.6.39",
      "name": "Monitoring201",
      "tag_assignments": [
        {
          "id": 1,
          "name": "Monitoring",
          "tag_color": {
            "id": 3
          }
        }
      ],
      "tags": "Monitoring"
    },
    "sim": {
      "iccid": "8988317000000000000",
      "iccid_with_luhn": "89883170000000000001",
      "id": 110,
      "production_date": "2019-12-17T13:26:13.000Z"
    },
    "imsi": {
      "id": 110,
      "import_date": "2019-12-17T13:26:08.000Z",
      "imsi": "901430000000114"
    }
  }
]
```

**SDK Code**

```python Filter by Event Type
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

querystring = {"q":"type:3"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by Event Type
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Filter by Event Type
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Filter by Event Type
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Filter by Event Type
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by Event Type
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Filter by Event Type
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by Event Type
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Filter by Time Range and Event Type

**Response**

```json
[
  {
    "timestamp": "2020-07-20T15:32:18.000Z",
    "alert": false,
    "description": "PDP Context created.",
    "id": 69120,
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "id": 0,
      "name": "Network"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 2,
      "name": "Organisation_Name"
    },
    "endpoint": {
      "id": 1,
      "imei": null,
      "ip_address": "10.199.6.39",
      "name": "Monitoring201",
      "tag_assignments": [
        {
          "id": 1,
          "name": "Monitoring",
          "tag_color": {
            "id": 3
          }
        }
      ],
      "tags": "Monitoring"
    },
    "sim": {
      "iccid": "8988317000000000000",
      "iccid_with_luhn": "89883170000000000001",
      "id": 110,
      "production_date": "2019-12-17T13:26:13.000Z"
    },
    "imsi": {
      "id": 110,
      "import_date": "2019-12-17T13:26:08.000Z",
      "imsi": "901430000000114"
    }
  }
]
```

**SDK Code**

```python Filter by Time Range and Event Type
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

querystring = {"q":"type:3,from:2020-07-20T08:00:00Z,until:2020-07-21T08:00:00Z"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by Time Range and Event Type
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Filter by Time Range and Event Type
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Filter by Time Range and Event Type
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Filter by Time Range and Event Type
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by Time Range and Event Type
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Filter by Time Range and Event Type
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by Time Range and Event Type
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Filter by ICCID

**Response**

```json
[
  {
    "timestamp": "2020-06-10T09:15:22.000Z",
    "alert": true,
    "description": "SIM card activated.",
    "id": 65234,
    "event_type": {
      "description": "SIM Activation",
      "id": 12
    },
    "event_source": {
      "id": 2,
      "name": "API"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 2,
      "name": "Organisation_Name"
    },
    "endpoint": {
      "id": 1,
      "imei": "864345678889324",
      "ip_address": "10.199.8.15",
      "name": "TestDevice",
      "tag_assignments": [
        {
          "id": 4,
          "name": "Production",
          "tag_color": {
            "id": 5
          }
        }
      ],
      "tags": "Production"
    },
    "sim": {
      "iccid": "1234567890123456789",
      "iccid_with_luhn": "12345678901234567890",
      "id": 215,
      "production_date": "2020-01-15T10:00:00.000Z"
    },
    "imsi": {
      "id": 215,
      "import_date": "2020-01-15T10:00:00.000Z",
      "imsi": "901430000000215"
    }
  }
]
```

**SDK Code**

```python Filter by ICCID
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

querystring = {"q":"iccid:1234567890123456789"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by ICCID
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Filter by ICCID
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Filter by ICCID
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Filter by ICCID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by ICCID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Filter by ICCID
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by ICCID
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event?q=iccid%3A1234567890123456789")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Filter by multiple ICCIDs

**Response**

```json
[
  {
    "timestamp": "2020-07-20T10:15:30.000+0000",
    "alert": false,
    "description": "Data session started",
    "id": 123459,
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "description": "Network",
      "id": 0
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "sim": {
      "iccid": "1234567890123456789",
      "iccid_with_luhn": "12345678901234567891",
      "id": 1234
    }
  },
  {
    "timestamp": "2020-07-20T10:15:30.000+0000",
    "alert": false,
    "description": "Data session started",
    "id": 123456,
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "description": "Network",
      "id": 0
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "sim": {
      "iccid": "8988303000123456789",
      "iccid_with_luhn": "89883030001234567891",
      "id": 1234
    }
  }
]
```

**SDK Code**

```python Filter by multiple ICCIDs
import requests

url = "https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event"

querystring = {"q":"iccid:1234567890123456789|8988303000123456789"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by multiple ICCIDs
const url = 'https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Filter by multiple ICCIDs
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Filter by multiple ICCIDs
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Filter by multiple ICCIDs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by multiple ICCIDs
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Filter by multiple ICCIDs
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by multiple ICCIDs
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/:endpoint_id/event?q=iccid%3A1234567890123456789%7C8988303000123456789")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Multiple Filters - Tags and Organization

**Response**

```json
[
  {
    "timestamp": "2020-05-12T16:42:33.000Z",
    "alert": false,
    "description": "Configuration updated.",
    "id": 62145,
    "event_type": {
      "description": "Configuration Change",
      "id": 8
    },
    "event_source": {
      "id": 2,
      "name": "API"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Test Organisation"
    },
    "endpoint": {
      "id": 1,
      "imei": null,
      "ip_address": "10.199.2.45",
      "name": "TaggedDevice",
      "tag_assignments": [
        {
          "id": 7,
          "name": "tag1",
          "tag_color": {
            "id": 2
          }
        }
      ],
      "tags": "tag1"
    },
    "sim": {
      "iccid": "8988317000000000456",
      "iccid_with_luhn": "89883170000000004567",
      "id": 145,
      "production_date": "2019-08-20T13:26:13.000Z"
    },
    "imsi": {
      "id": 145,
      "import_date": "2019-08-20T13:26:08.000Z",
      "imsi": "901430000000145"
    }
  }
]
```

**SDK Code**

```python Multiple Filters - Tags and Organization
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

querystring = {"q":"tags:tag1,organisation:123"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Multiple Filters - Tags and Organization
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Multiple Filters - Tags and Organization
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Multiple Filters - Tags and Organization
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Multiple Filters - Tags and Organization
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Multiple Filters - Tags and Organization
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Multiple Filters - Tags and Organization
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Multiple Filters - Tags and Organization
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event?q=tags%3Atag1%2Corganisation%3A123")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Sort by Timestamp and ID (Descending)

**Response**

```json
[
  {
    "timestamp": "2020-08-15T18:45:00.000Z",
    "alert": false,
    "description": "Session terminated.",
    "id": 72341,
    "event_type": {
      "description": "Delete PDP Context",
      "id": 4
    },
    "event_source": {
      "id": 0,
      "name": "Network"
    },
    "event_severity": {
      "description": "INFO",
      "id": 0
    },
    "organisation": {
      "id": 2,
      "name": "Organisation_Name"
    },
    "endpoint": {
      "id": 1,
      "imei": null,
      "ip_address": "10.199.6.39",
      "name": "Monitoring201",
      "tag_assignments": [
        {
          "id": 1,
          "name": "Monitoring",
          "tag_color": {
            "id": 3
          }
        }
      ],
      "tags": "Monitoring"
    },
    "sim": {
      "iccid": "8988317000000000000",
      "iccid_with_luhn": "89883170000000000001",
      "id": 110,
      "production_date": "2019-12-17T13:26:13.000Z"
    },
    "imsi": {
      "id": 110,
      "import_date": "2019-12-17T13:26:08.000Z",
      "imsi": "901430000000114"
    }
  }
]
```

**SDK Code**

```python Sort by Timestamp and ID (Descending)
import requests

url = "https://iot.telia.lt/api/v1/endpoint/12345/event"

querystring = {"sort":"-timestamp,id"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Sort by Timestamp and ID (Descending)
const url = 'https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Sort by Timestamp and ID (Descending)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Sort by Timestamp and ID (Descending)
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Sort by Timestamp and ID (Descending)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Sort by Timestamp and ID (Descending)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Sort by Timestamp and ID (Descending)
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Sort by Timestamp and ID (Descending)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/12345/event?sort=-timestamp%2Cid")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```