Source: https://fyno.docs.pageloop.ai/api-reference/manage-user-subscriptions-preferences/get-wsid-version-subscriptions-preference

# Get user preference

GET `https://api.fyno.io/v1/{WSID}/{version}/subscriptions/preference`

This API enables you to get all the subscriptions topics (with sections) defined in your workspace along with the opted-in/opted-out preference of a particular user.

## Authorization

#### Authorization (header, string, required)

Enter your API Key. If you don't have it already, you can create one from the API Keys page within your Fyno account

## Path Parameters

#### WSID (path, string, required)

Enter your workspace ID. You can obtain this value from the API Keys page within your Fyno account.

#### version (path, enum (string), required) — allowed: live, test

Specify the version for which you would like to manage the user profile.

## Query Parameters

#### distinct\_id (query, string, required)

Enter the distinct ID that you currently use to identify the user.

#### event\_list (query, enum (boolean)) — allowed: True, False

Set this value to 'true' to receive list of notification events attached to each subscription topic.

## Response

#### 200

Preference fetched successfully

#### meta (object, required)

#### properties

#### all (object, required)

#### result (object, required)

#### properties

#### Section1 (array of object, required)

#### 400

Distinct ID is not provided

#### \_message (string, required)

#### status (string, required)

#### 401

API Key or Workspace ID is invalid. User is unauthorised.

#### \_message (string, required)

#### status (string, required)

#### Request

```bash cURL
curl -X GET 'https://api.fyno.io/v1/{WSID}/{version}/subscriptions/preference' \
  -H 'Authorization: Bearer <token>'
```

```javascript JavaScript
const res = await fetch('https://api.fyno.io/v1/{WSID}/{version}/subscriptions/preference', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <token>',
  },
});
const data = await res.json();
```

```python Python
import requests

res = requests.get(
    'https://api.fyno.io/v1/{WSID}/{version}/subscriptions/preference',
    headers={'Authorization': 'Bearer <token>'}
)
data = res.json()
```

#### Response

```json 200
{
  "meta": {
    "all": {
      "preference": {
        "discord": "\u2026",
        "email": "\u2026",
        "inapp": "\u2026",
        "push": "\u2026",
        "slack": "\u2026",
        "sms": "\u2026",
        "teams": "\u2026",
        "voice": "\u2026",
        "whatsapp": "\u2026"
      },
      "updated_at": {
        "discord": "\u2026",
        "email": "\u2026",
        "inapp": "\u2026",
        "push": "\u2026",
        "slack": "\u2026",
        "sms": "\u2026",
        "teams": "\u2026",
        "voice": "\u2026",
        "webpush": "\u2026",
        "whatsapp": "\u2026"
      }
    }
  },
  "result": {
    "Section1": [
      {
        "channel_config": "\u2026",
        "description": "\u2026",
        "is_global_opted_out": "\u2026",
        "name": "\u2026",
        "notification_events": "\u2026",
        "preference": "\u2026",
        "subscription_id": "\u2026",
        "updated_at": "\u2026"
      }
    ]
  }
}
```

```json 400
{
  "_message": "distinct_id is required to list preference!",
  "status": "error"
}
```

```json 401
{
  "_message": "Invalid API details",
  "status": "error"
}
```
