# Retrieve Contact Topics

> GET /contacts/:id/topics — retrieve a list of topic subscriptions for a contact.

`GET /contacts/:id/topics`

Retrieve a list of topic subscriptions for a contact. The contact is identified in the path by either its ID or its email address.

Either `id` or `email` must be provided.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | No | The Contact ID. |
| `email` | string | No | The Contact Email. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | No | Number of topics to retrieve. Maximum value: `100`. Minimum value: `1`. |
| `after` | string | No | The ID *after* which we'll retrieve more topics (for pagination). This ID will *not* be included in the returned list. Cannot be used with the `before` parameter. |
| `before` | string | No | The ID *before* which we'll retrieve more topics (for pagination). This ID will *not* be included in the returned list. Cannot be used with the `after` parameter. |

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.getTopics('e169aa45-1ecf-4183-9955-b1499d5701d3');
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

Mailblastr::Contacts.get_topics("e169aa45-1ecf-4183-9955-b1499d5701d3")
```

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

$mailblastr->contacts->getTopics('e169aa45-1ecf-4183-9955-b1499d5701d3');
```

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

mailblastr.Contacts.get_topics("e169aa45-1ecf-4183-9955-b1499d5701d3")
```

**Go**

```go
package main

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

func main() {
    req, _ := http.NewRequest("GET", "https://api.mailblastr.com/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/topics", nil)
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    out, _ := io.ReadAll(res.Body)
    fmt.Println(string(out))
}
```

**Rust**

```rust
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new()
        .get("https://api.mailblastr.com/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/topics")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .send()
        .await?;
    println!("{}", res.text().await?);
    Ok(())
}
```

**Java**

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mailblastr.com/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/topics"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

**.NET**

```csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.mailblastr.com/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/topics");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X GET 'https://api.mailblastr.com/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/topics' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
mailblastr contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3
```

### Response

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
      "name": "Product Updates",
      "description": "New features, and latest announcements.",
      "subscription": "opt_in"
    }
  ]
}
```
