const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/recipients/296446', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"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",
"mailing_list": {
"id": 514,
"user_id": 2,
"sub_account_id": null,
"type": "manual",
"description": "Mailing List Test",
"file": null,
"field_map": null,
"shape_data": null,
"total_recipients": 2,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-04-06 01:56:48",
"leads_data": null,
"deleted_at": null
}
}
Gets a specific recipient by ID
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/recipients/296446', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"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",
"mailing_list": {
"id": 514,
"user_id": 2,
"sub_account_id": null,
"type": "manual",
"description": "Mailing List Test",
"file": null,
"field_map": null,
"shape_data": null,
"total_recipients": 2,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-04-06 01:56:48",
"leads_data": null,
"deleted_at": null
}
}
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?