> 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 user events

GET https://iot.telia.lt/api/v1/user/{user_id}/event

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

Only an administrator or observer may be allowed to see events of other users, provided they belong to an organisation he/she has access to.

Any user can retrieve their own events at `/api/v1/user/my/event`.

This API endpoint deviates from the specified conventions and may not return the same HTTP Codes as the higher layer call (`/api/v1/user/{user_id|my}`).

In case the requested `{user_id}` does not exist or is not accessible for the user, **HTTP 200** will be returned with empty **\[]** as long as the provided `{user_id}` is a number and all parameters are valid.

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

Reference: https://docs.iot.telia.lt/developers/api/user-management/user-event-page-per-page-sort-by-user-id-and-q-get

## 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

- `user_id` (double, required) — User ID

### 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: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 User events

- `list of ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItems`

## Errors

### 400 Bad Request Error

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

- `any`

### 403 Forbidden Error

**Forbidden** due to incorrect user role or lack of access

- `any`

### 422 Unprocessable Entity Error

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

- `any`

## Types

### ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItems

- `id` (integer, required)
- `alert` (boolean, required)
- `description` (string, required)
- `timestamp` (string, required)
- `event_type` (ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsEventType, required)
- `event_source` (ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsEventSource, required)
- `event_severity` (ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsEventSeverity, required)
- `organisation` (ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsOrganisation, required)
- `user` (ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsUser, required)

### ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsEventType

### ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsEventSource

### ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsEventSeverity

### ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsOrganisation

### ApiV1UserUserIdEventGetResponsesContentApplicationJsonSchemaItemsUser

## Examples

### Default (no filtering or sorting)

**Response**

```json
[
  {
    "id": 11,
    "alert": false,
    "description": "Failed authentication request from 'ford.prefect@hitchhikerguide.net', Reason: invalid password from IP 1.2.3.4",
    "timestamp": "2017-05-08T10:56:25.000Z",
    "event_type": {
      "description": "User authentication failed",
      "id": 6
    },
    "event_source": {
      "description": "API",
      "id": 2
    },
    "event_severity": {
      "description": "Warn",
      "id": 1
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Default (no filtering or sorting)
import requests

url = "https://iot.telia.lt/api/v1/user/my/event"

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

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

print(response.json())
```

```javascript Default (no filtering or sorting)
const url = 'https://iot.telia.lt/api/v1/user/my/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 filtering or sorting)
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user/my/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 filtering or sorting)
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user/my/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 filtering 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/user/my/event")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Default (no filtering or sorting)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Default (no filtering or sorting)
using RestSharp;

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

```swift Default (no filtering or sorting)
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user/my/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()
```

### Sort by timestamp and ID

**Response**

```json
[
  {
    "id": 15,
    "alert": true,
    "description": "User login successful",
    "timestamp": "2020-07-21T14:30:00.000Z",
    "event_type": {
      "description": "User authentication successful",
      "id": 5
    },
    "event_source": {
      "description": "API",
      "id": 2
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  },
  {
    "id": 12,
    "alert": false,
    "description": "User logged out",
    "timestamp": "2020-07-20T09:15:00.000Z",
    "event_type": {
      "description": "User logout",
      "id": 7
    },
    "event_source": {
      "description": "API",
      "id": 2
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Sort by timestamp and ID
import requests

url = "https://iot.telia.lt/api/v1/user/my/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
const url = 'https://iot.telia.lt/api/v1/user/my/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
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user/my/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
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user/my/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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Sort by timestamp and ID
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/user/my/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
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user/my/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()
```

### Filter by time range

**Response**

```json
[
  {
    "id": 14,
    "alert": false,
    "description": "User accessed dashboard",
    "timestamp": "2020-07-20T10:45:00.000Z",
    "event_type": {
      "description": "User action",
      "id": 8
    },
    "event_source": {
      "description": "API",
      "id": 2
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Filter by time range
import requests

url = "https://iot.telia.lt/api/v1/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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 time range and event type

**Response**

```json
[
  {
    "id": 16,
    "alert": false,
    "description": "Create PDP Context",
    "timestamp": "2020-07-20T11:30:00.000Z",
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "description": "Network",
      "id": 0
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Filter by time range and event type
import requests

url = "https://iot.telia.lt/api/v1/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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
[
  {
    "id": 20,
    "alert": false,
    "description": "SIM activated",
    "timestamp": "2020-07-15T08:00:00.000Z",
    "event_type": {
      "description": "SIM activation",
      "id": 10
    },
    "event_source": {
      "description": "API",
      "id": 2
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Filter by ICCID
import requests

url = "https://iot.telia.lt/api/v1/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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/user/my/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 tag and organization

**Response**

```json
[
  {
    "id": 18,
    "alert": false,
    "description": "Endpoint created with tag",
    "timestamp": "2020-07-10T12:00:00.000Z",
    "event_type": {
      "description": "Endpoint created",
      "id": 12
    },
    "event_source": {
      "description": "API",
      "id": 2
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Filter by tag and organization
import requests

url = "https://iot.telia.lt/api/v1/user/my/event"

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

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

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

print(response.json())
```

```javascript Filter by tag and organization
const url = 'https://iot.telia.lt/api/v1/user/my/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 Filter by tag and organization
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user/my/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 Filter by tag and organization
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user/my/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 Filter by tag 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/user/my/event?q=tags%3Atag1%2Corganisation%3A123")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by tag and organization
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Filter by tag and organization
using RestSharp;

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

```swift Filter by tag and organization
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user/my/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()
```

### Filter Create PDP Context events only

**Response**

```json
[
  {
    "id": 22,
    "alert": false,
    "description": "Create PDP Context for endpoint",
    "timestamp": "2020-07-22T09:00:00.000Z",
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "description": "Network",
      "id": 0
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Filter Create PDP Context events only
import requests

url = "https://iot.telia.lt/api/v1/user/my/event"

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

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

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

print(response.json())
```

```javascript Filter Create PDP Context events only
const url = 'https://iot.telia.lt/api/v1/user/my/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 Create PDP Context events only
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user/my/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 Create PDP Context events only
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user/my/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 Create PDP Context events only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Filter Create PDP Context events only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Filter Create PDP Context events only
using RestSharp;

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

```swift Filter Create PDP Context events only
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user/my/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 and sort combined

**Response**

```json
[
  {
    "id": 17,
    "alert": false,
    "description": "Create PDP Context - most recent",
    "timestamp": "2020-07-20T18:45:00.000Z",
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "description": "Network",
      "id": 0
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  },
  {
    "id": 16,
    "alert": false,
    "description": "Create PDP Context - earlier",
    "timestamp": "2020-07-20T11:30:00.000Z",
    "event_type": {
      "description": "Create PDP Context",
      "id": 3
    },
    "event_source": {
      "description": "Network",
      "id": 0
    },
    "event_severity": {
      "description": "Info",
      "id": 0
    },
    "organisation": {
      "id": 123,
      "name": "Seeley & Co."
    },
    "user": {
      "id": 42,
      "name": "Ford Prefect",
      "username": "ford.prefect@hitchhikerguide.net"
    }
  }
]
```

**SDK Code**

```python Filter and sort combined
import requests

url = "https://iot.telia.lt/api/v1/user/my/event"

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

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

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

print(response.json())
```

```javascript Filter and sort combined
const url = 'https://iot.telia.lt/api/v1/user/my/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z&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 Filter and sort combined
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user/my/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z&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 Filter and sort combined
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user/my/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z&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 Filter and sort combined
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Filter and sort combined
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Filter and sort combined
using RestSharp;

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

```swift Filter and sort combined
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user/my/event?q=type%3A3%2Cfrom%3A2020-07-20T08%3A00%3A00Z%2Cuntil%3A2020-07-21T08%3A00%3A00Z&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()
```