import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const response = await novu.subscribers.get("subscriberId");
console.log(response.data);
curl --request GET \
--url https://api.novu.co/v1/subscribers/{subscriberId} \
--header 'Authorization: <authorization>'
import requests
url = "https://api.novu.co/v1/subscribers/{subscriberId}"
headers = {"Authorization": "<authorization>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.novu.co/v1/subscribers/{subscriberId}', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.novu.co/v1/subscribers/{subscriberId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.novu.co/v1/subscribers/{subscriberId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import co.novu.common.base.Novu;
import co.novu.api.subscribers.responses.SingleSubscriberResponse;
public class Main {
public static void main(String[] args) {
String apiKey = "<NOVU_API_KEY>";
Novu novu = new Novu(apiKey);
String subscriberId = "<SUBSCRIBER_ID>";
SingleSubscriberResponse response = novu.getSubscriber(subscriberId);
}
}
{
"data": {
"_id": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"phone": "string",
"avatar": "string",
"locale": "string",
"subscriberId": "string",
"channels": [
{
"providerId": "slack",
"integrationIdentifier": "string",
"credentials": {
"webhookUrl": "string",
"channel": "string",
"deviceTokens": [
"string"
]
},
"_integrationId": "string"
}
],
"isOnline": "boolean",
"lastOnlineAt": "string",
"_organizationId": "string",
"_environmentId": "string",
"deleted": "boolean",
"createdAt": "string",
"updatedAt": "string",
"__v": "number"
}
}
Subscribers
Get subscriber
Get subscriber by your internal id used to identify the subscriber
GET
/
v1
/
subscribers
/
{subscriberId}
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const response = await novu.subscribers.get("subscriberId");
console.log(response.data);
curl --request GET \
--url https://api.novu.co/v1/subscribers/{subscriberId} \
--header 'Authorization: <authorization>'
import requests
url = "https://api.novu.co/v1/subscribers/{subscriberId}"
headers = {"Authorization": "<authorization>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.novu.co/v1/subscribers/{subscriberId}', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.novu.co/v1/subscribers/{subscriberId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.novu.co/v1/subscribers/{subscriberId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import co.novu.common.base.Novu;
import co.novu.api.subscribers.responses.SingleSubscriberResponse;
public class Main {
public static void main(String[] args) {
String apiKey = "<NOVU_API_KEY>";
Novu novu = new Novu(apiKey);
String subscriberId = "<SUBSCRIBER_ID>";
SingleSubscriberResponse response = novu.getSubscriber(subscriberId);
}
}
{
"data": {
"_id": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"phone": "string",
"avatar": "string",
"locale": "string",
"subscriberId": "string",
"channels": [
{
"providerId": "slack",
"integrationIdentifier": "string",
"credentials": {
"webhookUrl": "string",
"channel": "string",
"deviceTokens": [
"string"
]
},
"_integrationId": "string"
}
],
"isOnline": "boolean",
"lastOnlineAt": "string",
"_organizationId": "string",
"_environmentId": "string",
"deleted": "boolean",
"createdAt": "string",
"updatedAt": "string",
"__v": "number"
}
}
Enter your API key in the
Authorization field like the example shown below:E.g ApiKey 18d2e625f05d80eimport { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
const response = await novu.subscribers.get("subscriberId");
console.log(response.data);
curl --request GET \
--url https://api.novu.co/v1/subscribers/{subscriberId} \
--header 'Authorization: <authorization>'
import requests
url = "https://api.novu.co/v1/subscribers/{subscriberId}"
headers = {"Authorization": "<authorization>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.novu.co/v1/subscribers/{subscriberId}', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.novu.co/v1/subscribers/{subscriberId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.novu.co/v1/subscribers/{subscriberId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import co.novu.common.base.Novu;
import co.novu.api.subscribers.responses.SingleSubscriberResponse;
public class Main {
public static void main(String[] args) {
String apiKey = "<NOVU_API_KEY>";
Novu novu = new Novu(apiKey);
String subscriberId = "<SUBSCRIBER_ID>";
SingleSubscriberResponse response = novu.getSubscriber(subscriberId);
}
}
{
"data": {
"_id": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"phone": "string",
"avatar": "string",
"locale": "string",
"subscriberId": "string",
"channels": [
{
"providerId": "slack",
"integrationIdentifier": "string",
"credentials": {
"webhookUrl": "string",
"channel": "string",
"deviceTokens": [
"string"
]
},
"_integrationId": "string"
}
],
"isOnline": "boolean",
"lastOnlineAt": "string",
"_organizationId": "string",
"_environmentId": "string",
"deleted": "boolean",
"createdAt": "string",
"updatedAt": "string",
"__v": "number"
}
}
Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
Path Parameters
Response
Ok
The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems
The internal id novu generated for your subscriber, this is not the subscriberId matching your query. See subscriberId for that
Channels settings for subscriber
Show child attributes
Show child attributes
Was this page helpful?
⌘I