> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/6.14/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/6.14/api-reference/whitelist_api.md).

# Whitelist API

The Whitelist API provides capabilities to provision/deprovision and lookup of
IMEI(s).

## Methods

### Imei.Whitelist.Add

Adds the given IMEI(s) to TPOSS whitelist.

Following parameters could be passed:

| Name | Type | Requirement | Note |
|---|---|---|---|
| AuthKey | AuthKey | required | Pre-shared authentication key. |
| FeId | String | required | Static frontend identifier which should be unique to the system.
| FeSId | String | required | Dynamic frontend session identifier which should be reset upon system startup.
| IMEIs | String | required | List of IMEIs that should be added |

Example of request:

```
    $ curl -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d
      '{
          "id": "1",
          "jsonrpc": "2.0",
          "method":"Imei.Whitelist.Add",
          "params": {
            "AuthKey": "secret",
            "FeId":"TPUIBrowser",
            "FeSId": "TPUIBrowser",
            "IMEIs": ["012345678901207", "012345678901217"]
          }
      }' http://127.0.0.1:12000
```

The API returns total amount of arrived IMEIs in the request and amount of successfully
added to whitelist.

Example of response:

```
      {
          "id": "101",
          "jsonrpc": "2.0",
          "result": {
              "Added" => 2,
              "Total" => 2
          }
      }
```

### Imei.Whitelist.Delete

Deletes the given IMEI(s) from the TPOSS whitelist.

Following parameters could be passed:

| Name | Type | Requirement | Note |
|---|---|---|---|
| AuthKey | AuthKey | required | Pre-shared authentication key. |
| FeId | String | required | Static frontend identifier which should be unique to the system.
| FeSId | String | required | Dynamic frontend session identifier which should be reset upon system startup.
| IMEIs | String | required | List of IMEIs that should be added |

Example of request:

```
    $ curl -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE -d
      '{
           "id": "1",
           "jsonrpc": "2.0",
           "method":"Imei.Whitelist.Delete",
           "params": {
             "AuthKey": "secret",
             "FeId":"TPUIBrowser",
             "FeSId": "TPUIBrowser",
             "IMEIs": ["012345678901207", "012345678901217"]
           }
      }' http://127.0.0.1:12000
```

The API returns total amount of arrived IMEIs in the request and amount of successfully
deleted from whitelist.

Example of response:

```
      {
          "id": "101", "jsonrpc": "2.0",
          "result": {
              "Deleted" => 2,
              "Total" => 2
          }
      }
```

### Imei.Whitelist.Get

Retrives IMEI(s) from the TPOSS whitelist by the given `Limit` and `Offset`.

The following parameters could be passed:

| Name | Type | Requirement | Note |
|---|---|---|---|
| AuthKey | AuthKey | required | Pre-shared authentication key. |
| FeId | String | required | Static frontend identifier which should be unique to the system.
| FeSId | String | required | Dynamic frontend session identifier which should be reset upon system startup.
| Limit | String | required | Limit for the result set size |
| Offset | String | required | Number of results to be skipped in the result set. |

Example of request:

```
    $ curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET -d
      '{
           "id": "1",
           "jsonrpc": "2.0",
           "method":"Imei.Whitelist.Get",
           "params": {
               "AuthKey": "secret",
               "FeId":"TPUIBrowser",
               "FeSId": "TPUIBrowser",
               "Limit": 10,
               "Offset": 20
           }
      }' http://127.0.0.1:12000
```

The API returns the list of IMEI(s) from the TPOSS whitelist by the given `Limit` and `Offset`.

Example of response:

```
      {
          "id": "101", "jsonrpc": "2.0",
          "result": {
              "Limit" => 2,
              "Offset" => 5,
              "IMEIs" => ["012345678901207", "012345678901217"]}
      }
```
