const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/recipients', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"current_page": 1,
"data": [
{
"id": 296446,
"mailing_list_id": 514,
"session_id": null,
"name": "Jane Doe",
"address": "123 Main Street",
"address2": null,
"city": "Kansas City",
"province": "MO",
"postal_code": "64105",
"country": "US",
"dob": null,
"custom1": null,
"custom2": null,
"deliverability": null,
"can_deliver": true,
"created_at": "2020-04-06 01:56:48",
"updated_at": "2020-04-06 01:56:48"
}
],
"first_page_url": "https://develop-dashboard.thanks.io/api/recipients?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://develop-dashboard.thanks.io/api/recipients?page=1",
"next_page_url": null,
"path": "https://develop-dashboard.thanks.io/api/recipients",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
Search for recipients by email address.
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/recipients', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"current_page": 1,
"data": [
{
"id": 296446,
"mailing_list_id": 514,
"session_id": null,
"name": "Jane Doe",
"address": "123 Main Street",
"address2": null,
"city": "Kansas City",
"province": "MO",
"postal_code": "64105",
"country": "US",
"dob": null,
"custom1": null,
"custom2": null,
"deliverability": null,
"can_deliver": true,
"created_at": "2020-04-06 01:56:48",
"updated_at": "2020-04-06 01:56:48"
}
],
"first_page_url": "https://develop-dashboard.thanks.io/api/recipients?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://develop-dashboard.thanks.io/api/recipients?page=1",
"next_page_url": null,
"path": "https://develop-dashboard.thanks.io/api/recipients",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
OK
The response is of type object
.
Was this page helpful?