const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/mailing-lists', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"data": [
{
"id": 515,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/27/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":30,\"northeast\":{\"lat\":41.50233372463283,\"lng\":-73.95891380310059},\"southwest\":{\"lat\":41.50130521936773,\"lng\":-73.96028709411621}}",
"total_recipients": 30,
"processed": 1,
"created_at": "4 days ago",
"updated_at": "2020-03-27 02:24:23",
"leads_data": null,
"deleted_at": null
},
{
"id": 514,
"user_id": 2,
"sub_account_id": null,
"type": "manual",
"description": "Multiple Test",
"file": null,
"field_map": null,
"shape_data": null,
"total_recipients": 1,
"processed": 1,
"created_at": "2 weeks ago",
"updated_at": "2020-03-10 13:33:04",
"leads_data": null,
"deleted_at": null
},
{
"id": 513,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/06/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":23,\"northeast\":{\"lat\":41.49198222373539,\"lng\":-73.97047233581544},\"southwest\":{\"lat\":41.48561706807948,\"lng\":-73.97532176971437}}",
"total_recipients": 23,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-03-06 20:02:12",
"leads_data": null,
"deleted_at": null
},
{
"id": 512,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/06/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":4,\"northeast\":{\"lat\":41.49018204111472,\"lng\":-73.97163105010988},\"southwest\":{\"lat\":41.487417377546755,\"lng\":-73.9750213623047}}",
"total_recipients": 4,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-03-06 20:01:57",
"leads_data": null,
"deleted_at": null
},
{
"id": 511,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/06/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":39,\"northeast\":{\"lat\":41.49140359906281,\"lng\":-73.96489334106447},\"southwest\":{\"lat\":41.48455614800461,\"lng\":-73.97459220886232}}",
"total_recipients": 39,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-03-06 20:01:35",
"leads_data": null,
"deleted_at": null
}
],
"links": {
"first": "http://develop.dashboard.thanks.io/api/v2/mailing-lists?page=1",
"last": "http://develop.dashboard.thanks.io/api/v2/mailing-lists?page=21",
"prev": null,
"next": "http://develop.dashboard.thanks.io/api/v2/mailing-lists?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 21,
"path": "http://develop.dashboard.thanks.io/api/v2/mailing-lists",
"per_page": "5",
"to": 5,
"total": 103
}
}
sub_account is optional.
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/mailing-lists', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"data": [
{
"id": 515,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/27/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":30,\"northeast\":{\"lat\":41.50233372463283,\"lng\":-73.95891380310059},\"southwest\":{\"lat\":41.50130521936773,\"lng\":-73.96028709411621}}",
"total_recipients": 30,
"processed": 1,
"created_at": "4 days ago",
"updated_at": "2020-03-27 02:24:23",
"leads_data": null,
"deleted_at": null
},
{
"id": 514,
"user_id": 2,
"sub_account_id": null,
"type": "manual",
"description": "Multiple Test",
"file": null,
"field_map": null,
"shape_data": null,
"total_recipients": 1,
"processed": 1,
"created_at": "2 weeks ago",
"updated_at": "2020-03-10 13:33:04",
"leads_data": null,
"deleted_at": null
},
{
"id": 513,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/06/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":23,\"northeast\":{\"lat\":41.49198222373539,\"lng\":-73.97047233581544},\"southwest\":{\"lat\":41.48561706807948,\"lng\":-73.97532176971437}}",
"total_recipients": 23,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-03-06 20:02:12",
"leads_data": null,
"deleted_at": null
},
{
"id": 512,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/06/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":4,\"northeast\":{\"lat\":41.49018204111472,\"lng\":-73.97163105010988},\"southwest\":{\"lat\":41.487417377546755,\"lng\":-73.9750213623047}}",
"total_recipients": 4,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-03-06 20:01:57",
"leads_data": null,
"deleted_at": null
},
{
"id": 511,
"user_id": 2,
"sub_account_id": null,
"type": "map",
"description": "Mailing list (Map) created 03/06/2020",
"file": null,
"field_map": null,
"shape_data": "{\"type\":\"rectangle\",\"count\":39,\"northeast\":{\"lat\":41.49140359906281,\"lng\":-73.96489334106447},\"southwest\":{\"lat\":41.48455614800461,\"lng\":-73.97459220886232}}",
"total_recipients": 39,
"processed": 1,
"created_at": "3 weeks ago",
"updated_at": "2020-03-06 20:01:35",
"leads_data": null,
"deleted_at": null
}
],
"links": {
"first": "http://develop.dashboard.thanks.io/api/v2/mailing-lists?page=1",
"last": "http://develop.dashboard.thanks.io/api/v2/mailing-lists?page=21",
"prev": null,
"next": "http://develop.dashboard.thanks.io/api/v2/mailing-lists?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 21,
"path": "http://develop.dashboard.thanks.io/api/v2/mailing-lists",
"per_page": "5",
"to": 5,
"total": 103
}
}
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?