Introduction
The Wishpond API lets you track users’ activities across your website, backend systems, and the Wishpond pages. You can also use it access your lists, visitors, leads, their attributes and events available in your Wishpond account.
We’ve developed a Javascript API and an HTTP API. We’ll demonstrate its use in this guide.
Authentication
To get your credential keys, you must log into your Wishpond account, a modal with your credentials should appear after the login. If not, you should click on your account name in the top right corner and then click on API Keys.
There should be 3 keys:
- Merchant ID: Used for Tracking API
- Tracking Key: Used for the Tracking API
- API Key: Used for the Leads, Visitors and List API
Rate Limit
> Response After Rate Limit Exceeded:
{ "error": "Rate Limit Exceeded" }
The Wishpond API rate limit is 100 requests per minute.
If the rate limit is exceeded, subsequent requests will receive a response code of 429 until 60 seconds has elapsed since the initial request.
Tracking
Getting Started
> Wishpond Tracking Code
<script>
(function(d, s, id) {
window.Wishpond = window.Wishpond || {};
Wishpond.merchantId = 'YOUR_MERCHANT_ID';
Wishpond.writeKey = 'YOUR_TRACKING_KEY';
var js, wpjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//cdn.wishpond.net/connect.js";
wpjs.parentNode.insertBefore(js, wpjs);
}(document, 'script', 'wishpond-connect'));
</script>
The tracking API lets you track your users and their activity. When you include the Wishpond javascript tracking code on the html of your website, it will automatically start tracking your users using an anonymous ID. This anonymous ID will be saved on their browser and will track them across websites.
If you know the identity of your user, at any time you can identify your user using your own identifier or cid. All of that user’s anonymous activity will be attached to the new, identified user. This anonymous ID will also be aliased to this identifier, so any further anonymous tracking calls will be associated to the identified user.
To use the javascript tracking library, you must include the Wishpond Tracking Code inside of your website.
Identify
curl http://track.wishpond.com/api/v1/identify \
-u "YOUR_MERCHANT_ID:YOUR_TRACKING_KEY" \
-d '
{
"cid": "v1a0v94ahb4a5fa4",
"attributes": {
"email": "jimothy@equestriansupplies.com",
"name": "Jimothy Jimmins",
"occupation": "CEO",
"age": 44
},
"context": {
"ip": "75.51.12.54"
}
}'
var attributes = {
name: "Jimanda Jimmins",
age: 39
};
Wishpond.Tracker.identify("jimandajimmins@example.com", attributes);
The identify method lets you provide information that identifies a user. Attributes tracked with this method will define what you will see in the user’s profile.
HTTP Request
POST http://track.wishpond.com/api/v1/identify
Limitations
Attribute keys are limited to 64 characters, while its value is limited at 256 characters.
Query Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
cid | string | yes | This is the user’s identifier. | |
attributes | hash | yes | These are the attributes that will identify the user. The key is a string, but the value can be any primitive. | |
context | hash | Any additional information you’d like to track about these attributes. | ||
timestamp | string | Current time | The time these attributes were set (UTC). | |
source | string | Useful for tracking where the attributes were set. |
Finding the cid
Wishpond.Tracker.getAnonId().then(function(data) {
// ...
});
If you want to find the cid
of the user, you can run the getAnonId
function.
Within the function block you can do what you want with the data
, assign it to a variable, print it to the console with console.log(data)
etc.
Setting the Attributes
var attributes = {
email: 'jimothy@example.com',
name: 'Jimothy Tenkins',
age: 32
};
Wishpond.Tracker.setAttributes(attributes)
You can add or change the attributes of the lead or visitor. What you add here will be added user’s profile. If the user is a visitor, the visitor will be converted into a lead. If the user exists, this will update the user’s attributes. The setAttributes
function operates same as identify
, with the exception of not having to pass in the cid
. Setting the attributes triggers an identify
event.
Reset
Wishpond.Tracker.reset();
You can stop tracking a user with the reset method. This is useful if the user identity has changed, for example on logout. A new anonymous ID will be generated the next time you either identify a user or track an event.
Tracking events
The track method will let you associate events to the user. This is useful when tracking what your user is doing on your website or application.
curl http://track.wishpond.com/api/v1/track \
-u "YOUR_MERCHANT_ID:YOUR_TRACKING_KEY" \
-d '
{
"cid": "user_id",
"event": "upgraded",
"properties":
{
"value": "expensive_plan",
"price": 9001
}
}'
var properties = {
value: "expensive_plan",
price: 9001
};
Wishpond.Tracker.track("upgraded", properties);
The tracking pixel will automatically track page visits
HTTP Request
POST http://track.wishpond.com/api/v1/track
Limitations
The event value is limited to 32 characters, while the value inside properties.value is limited at 256 characters.
URL Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
cid | string | yes | The user’s identifier. | |
event | string | yes | The name of the event. e.g.: ‘signed_up’, 'upgraded’. | |
properties | hash | The properties associated with the event. (Can only match workflows on the value property at the moment) |
||
context | hash | Any additional information associated with the event. | ||
timestamp | string | Current time | The time this event happened (UTC). | |
source | string | Useful for tracking where the events were set. |
Tracking Form Submissions
This feature requires JQuery to be loaded on your website
You can easily track form submissions on your own forms by using these simple HTML attributes.
To track form submissions, you just need to add the data-wishpond-form="Form name"
attribute to your form and the form submission, along with all of its inputs, will be sent as a form_submission
event on the tracked user.
The data-wishpond-ignore
attribute will make us ignore the input element completely.
Form submissions
<form data-wishpond-form="Simple form">
Email <input type="email" name="email" />
Company <input type="text" data-wishpond-ignore="true" name="company" />
Feedback <textarea name="feedback"></textarea>
Password <input type="password" name="password" />
<input type="submit" value="Submit" />
</form>
In the case of this example, you would get a form_submission
event along with the user’s email and feedback in the event properties.
These attributes will not be tracked as user attributes. To accomplish that, follow the User attributes
part below.
User attributes
<form data-wishpond-form="Simple form">
Email <input type="email" name="email" data-wishpond-attribute="email" />
Phone Number <input type="text" name="phone" data-wishpond-attribute="phone_number" />
Feedback <textarea name="feedback"></textarea>
<input type="submit" value="Submit" />
</form>
This will capture your lead data and send it directly to wishpond when not using a Wishpond Campaign
If you want to use some of the data in your form to identify the user, you need to set the data-wishpond-attribute="attribute_name"
attribute on the input element. Note that the form still needs the data-wishpond-form
to track the attributes inside of it.
In the case of this example, the email and phone number attributes will be set as email
and phone_number
respectively.
URL Parser
Upon visiting a URL. The URL Parser takes the URL from the browser’s address bar and fires off attributes for the lead based on the parameters in the URL. The cid
is set in the browser if it exists. Then fires off identify attributes for that cid
, or the default one.
For Example: If you visit a URL like the one below.
http://www.examplelandingpage.com/?wpnd_cid=123&wpnd_first_name=Jimothy&wpnd_last_name=Jimmerson¬_an_attr=Hello
The URL Parser will fire off these identify attributes {first_name: "Jimothy", last_name: "Jimmerson"}
for cid 123
.
Leads
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/leads?page=1&per_page=10"
> Sample Response:
{
"leads": [
{
"id": "b867dc398592c3ef",
"email": "someone@test.com",
"status": "active",
"created_at": "2015-07-04T00:49:06.420Z",
"updated_at": "2015-07-16T01:29:00.970Z",
"lead_score": 0,
"subscribed": true,
"cid": "b867dc398592c3ef",
"mid": "263531",
"dynamic_attributes": {
"first_name": "jimothy",
"last_name": "macdougal"
}
}
],
"meta": {
"current_page": 1,
"total_entries": 1,
"total_pages": 1,
"total_leads": 1,
"total_visitors":64
}
}
You can query leads at the following endpoint:
https://api.wishpond.com/api/v1/leads
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of leads returned per page | pagination | 0-200 |
status | Filters by lead status | filter | active, suppressed |
Filters by emails starting with this parameter | filter | Any string | |
cid | Filters the leads by the client identifier | filter | Any string |
range_start | Filter by leads created after date | filter | Format: '2017-03-13T07:00:00.000Z’ |
range_end | Filter by leads created before date | filter | Format: '2017-03-13T07:00:00.000Z’ |
order_key | Sorts by property | sort | email, created_at |
order_type | Sort direction | sort | asc, desc |
Create
> Example Request:
curl -X POST https://api.wishpond.com/api/v1/leads/ \
-H "X-Api-Token:YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"lead": {
"email":"panda@wishpond.com",
"first_name":"Mei",
"last_name":"Xiang",
"Favorite food": "Bamboo"
}
}'
> Sample Response:
{
"lead": {
"id":"53c55dab7b414020",
"cid":"53c55dab7b414020",
"mid":"696791",
"email":"panda@wishpond.com",
"status":"active",
"created_at":"2016-04-25T20:33:00.282Z",
"updated_at":"2016-04-25T20:33:00.281Z",
"lead_score":0,
"subscribed":true,
"dynamic_attributes": {
"first_name":"Mei",
"last_name":"Xiang",
"Favorite food": "Bamboo"
}
}
}
You can create a lead by making a POST request to the leads endpoint:
POST https://api.wishpond.com/api/v1/leads
In the example on the right, only 4 attributes (email, first_name, last_name, Favorite food) were passed to the lead, but you can pass as many attributes as you want.
Show
> Example Request:
curl https://api.wishpond.com/api/v1/leads/:lead_id \
-H "X-Api-Token:YOUR_API_KEY"
> Sample Response:
{
"lead": {
"id": "b867dc398592c3ef",
"email": "someone@test.com",
"status": "active",
"created_at": "2015-07-04T00:49:06.420Z",
"updated_at": "2015-07-16T01:29:00.970Z",
"lead_score": 0,
"subscribed": true,
"cid": "b867dc398592c3ef",
"mid": "263531",
"dynamic_attributes": {
"first_name": "jimothy",
"last_name": "macdougal"
}
}
}
You can get data for a specific lead by just appending the lead’s id to the leads endpoint:
https://api.wishpond.com/api/v1/leads/:lead_id
Update
> Example Request:
curl -X PUT https://api.wishpond.com/api/v1/leads/:lead_id \
-H "X-Api-Token:YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"lead":
{
"first_name": "Bai",
"last_name": "Yun",
"Company": "Zoo Park"
},
"list":
{
"id": "56e9e92b61353800128d0900",
"action":"add"
}
}'
> Sample Response:
{
"lead": {
"id":"53c55dab7b414020",
"cid":"53c55dab7b414020",
"mid":"696791",
"email":"panda@wishpond.com",
"status":"active",
"created_at":"2016-04-25T20:33:00.282Z",
"updated_at":"2016-04-25T20:33:00.281Z",
"lead_score":0,
"subscribed":true,
"dynamic_attributes": {
"first_name":"Bai",
"last_name":"Yun",
"Company": "Zoo Park"
}
}
}
You can update a lead by making a PUT request to the lead endpoint:
PUT https://api.wishpond.com/api/v1/leads/:lead_id
Add/Remove lead to list
To add/remove a lead to/from a list you need to include the following in your the request.
{ "list": { "id": :list_id, "action":"add/remove" } }
Eg: Suppose you want to add a lead to list_id: '123456789’
{ "list": { "id": '123456789', "action":"add" } }
Check full example on the right →
You can also do an update call either with the list parameters only or lead params only.
You can get the ids for your lists from the Lists API.
Delete
> Example Request:
curl -X DELETE https://api.wishpond.com/api/v1/leads/:lead_id \
-H "X-Api-Token:YOUR_API_KEY"
>Sample Response:
{
"deleted": "true"
}
You can delete a lead and all of its events by making a DELETE request to the lead endpoint:
DELETE https://api.wishpond.com/api/v1/leads/:lead_id
WARNING: This action is final and will permanently delete all data associated with this lead.
Events
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/leads/:lead_id/events?page=1&per_page=10"
> Sample Response:
{
"events": [
{
"id":"5720e31d5a9c6100063c2f64",
"key":"completed_workflow",
"value":"5716a9f4366563000c5a8600",
"properties":
{
"value":"5716a9f4366563000c5a8600"
},
"source":null,
"event_context":null,
"created_at":"2016-04-27T16:04:45.000Z",
"cid":"54ff7d741b89308d"
},
{
"id":"5720e31d87de800006e54526",
"key":"Downloaded e-book",
"value":"56ce01f16536630010330400",
"properties":
{
"value":"marketing for dummies"
},
"source":"web",
"event_context":
{
"price": "22"
},
"created_at":"2016-04-27T16:04:45.000Z",
"cid":"54ff7d741b89308d"
},
],
"meta":
{
"current_page":1,
"total_entries":21,
"total_pages":1
}
}
Events tracked by the track
method can be queried at this endpoint:
https://api.wishpond.com/api/v1/leads/:lead_id/events
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of events returned per page | pagination | 0-200 |
Search
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/leads?email=your@email.com"
> Sample Response:
{
"leads": [
{
"id": "03c3d53acff0dff8",
"cid": "03c3d53acff0dff8",
"mid": "57806",
"email": "your@email.com",
"status": "active",
"created_at": "2015-07-04T09:30:58.823Z",
"updated_at": "2016-12-16T23:24:57.000Z",
"lead_score": 0,
"subscribed": true,
"dynamic_attributes":
{
"first_name":"Jimothy"
},
"sourced_at": "2014-06-11T18:23:13.000Z"
}
],
"meta": {
"current_page": 1,
"total_entries": 1,
"total_pages": 1,
"lead_limit": 10000,
"total_leads": 8465,
"total_visitors": 9568,
"total_limited_leads": 0
}
}
Using the following endpoint, you can search for a specific lead using their email:
https://api.wishpond.com/api/v1/leads
Parameter | Description | Type | Allowed |
---|---|---|---|
Lead email | string | Any string |
Lists
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
https://api.wishpond.com/api/v1/leads/:lead_id/lists
> Sample Response
{
"lists": [
{
"id": "559c4aef626f744c838c1800",
"type": "static",
"name": "test",
"date_added": "2014-06-11T00:14:17.000Z",
"status": "active"
}
]
}
Using the following endpoint, you can get the lists that a lead belongs to:
https://api.wishpond.com/api/v1/leads/:lead_id/lists
Visitors
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/visitors?page=1&per_page=10"
> Sample Response:
{
"visitors": [
{
"id":"uwykgpro7fi8hsz9",
"cid":"uwykgpro7fi8hsz9",
"mid":"696791",
"email":null,
"status":"active",
"created_at":"2016-04-27T21:40:06.000Z",
"updated_at":"2016-04-27T21:40:32.000Z",
"lead_score":0,
"subscribed":true,
"dynamic_attributes":{}
},
{
"id":"jrrjlfh2en91utff",
"cid":"jrrjlfh2en91utff",
"mid":"696791",
"email":null,
"status":"active",
"created_at":"2016-04-27T21:39:58.000Z",
"updated_at":"2016-04-27T21:40:07.000Z",
"lead_score":0,
"subscribed":true,
"dynamic_attributes":{}
}
],
"meta":
{
"current_page":1,
"total_entries":68,
"total_pages":3,
"lead_limit":-1,
"total_leads":3,
"total_visitors":68
}
}
You can query visitors at the following endpoint:
https://api.wishpond.com/api/v1/visitors
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of leads returned per page | pagination | 0-200 |
Show
> Example Request:
curl https://api.wishpond.com/api/v1/visitors/:visitor_id \
-H "X-Api-Token:YOUR_API_KEY"
> Sample Response:
{
"visitor": {
"id":"jrrjlfh2en91utff",
"cid":"jrrjlfh2en91utff",
"mid":"696791",
"email":null,
"status":"active",
"created_at":"2016-04-27T21:39:58.000Z",
"updated_at":"2016-04-27T21:40:07.000Z",
"lead_score":0,
"subscribed":true,
"dynamic_attributes":{}}
}
You can get data for a specific visitor by just appending the visitor’s id to the visitors endpoint:
https://api.wishpond.com/api/v1/visitors/:visitor_id
Delete
> Example Request:
curl -X DELETE https://api.wishpond.com/api/v1/visitors/:visitor_id \
-H "X-Api-Token:YOUR_API_KEY"
>Sample Response:
{
"deleted": "true"
}
You can delete a visitor and all of its events by making a DELETE request to the visitor endpoint:
DELETE https://api.wishpond.com/api/v1/visitors/:visitor_id
WARNING: This action is final and will permanently delete all data associated with this visitor.
Events
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/visitors/:visitor_id/events?page=1&per_page=10"
> Sample Response:
{
"events": [
{
"id":"57213199b589e800065a41e7",
"key":"lead_added",
"value":null,
"properties":{},
"source":null,
"event_context":null,
"created_at":"2016-04-27T21:39:06.000Z",
"cid":"hj9f1ozaxh29ayvw"
},
{
"id":"57213177b589e800065a40b1",
"key":"viewed_campaign",
"value":1540676.0,
"properties":
{
"ip_address":"174.6.127.45",
"page_title":"Landing Page",
"referrer":"",
"value":1540676.0
},
"source":"web",
"event_context":null,
"created_at":"2016-04-27T21:39:03.363Z",
"cid":"hj9f1ozaxh29ayvw"
},
{
"id":"57213177b589e800065a40b0",
"key":"visited_url",
"value":"https://shoesonline.wishpond.com/priyaland/",
"properties":{"ip_address":"174.6.127.45",
"page_title":"Landing Page",
"referrer":"",
"value":"https://shoesonline.wishpond.com/priyaland/"},
"source":"web",
"event_context":null,
"created_at":"2016-04-27T21:39:03.333Z",
"cid":"hj9f1ozaxh29ayvw"
}
],
"meta":
{
"current_page":1,"total_entries":4,"total_pages":1
}
}
Events tracked by the track
method can be queried at this endpoint:
https://api.wishpond.com/api/v1/visitors/:visitor_id/events
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of events returned per page | pagination | 0-200 |
Lists
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
https://api.wishpond.com/api/v1/visitors/:visitor_id/lists
> Sample Response:
{
"lists": [
{
"id": "559c4aef626f744c838c1800",
"type": "static",
"name": "test",
"date_added": "2014-06-11T00:14:17.000Z",
"status": "active"
}
]
}
Using the following endpoint, you can get the lists that a visitor belongs to:
https://api.wishpond.com/api/v1/visitors/:visitor_id/lists
Lists
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/lists?page=1&per_page=10"
> Sample Response:
{
"lists": [
{
"id": "55c278bc626f747ad70c0100",
"type": "static",
"external_id": "1025886",
"name": "My First List",
"lead_count": 0,
"last_lead_activity": null,
"created_at": "2015-08-05T20:57:32.273Z",
"stat": {
"_id": {
"$oid": "55c278bc626f747ad70d0100"
},
"day_bucket": {},
"hour_bucket": {},
"month_bucket": {}
},
"name_with_count": "My First List (0)",
"status": "active"
},
{
"id": "55b91baf6a616d3613020000",
"type": "smart",
"external_id": "1013721",
"name": "My Second List",
"lead_count": 0,
"last_lead_activity": null,
"created_at": "2015-07-29T18:30:07.987Z",
"stat": {
"_id": {
"$oid": "55b91baf6a616d3613030000"
},
"day_bucket": {},
"hour_bucket": {},
"month_bucket": {}
},
"name_with_count": "My Second List (0) ",
"status": "live"
}
],
"meta": {
"current_page": 1,
"total_entries": 2,
"total_pages": 1,
"total_leads": 9313,
"total_visitors":64
}
}
You can query lists at the following endpoint:
https://api.wishpond.com/api/v1/lists
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of leads returned per page | pagination | 0-200 |
name | Get lists starting with this parameter | filter | Any string |
type | Get lists of the specified type | filter | static, smart |
**The list status will be 'active’ for list’s type static, and 'live’ for list’s type smart.
Create
You can create lists at the following endpoint:
POST https://api.wishpond.com/api/v1/lists
Parameter | Description | Type | Required |
---|---|---|---|
name | Name of the list | string | yes |
> Example Request:
curl -X POST \
-H "X-Api-Token:YOUR_API_KEY" \
-d "list[name]=My First List" \
https://api.wishpond.com/api/v1/lists
> Sample Response:
{
"list": {
"id": "55c278bc626f747ad70c0100",
"type": "static",
"name": "My First List",
"created_at": "2015-08-05T20:57:32.273Z",
"stat": {
"_id": {
"$oid": "55c278bc626f747ad70d0100"
},
"day_bucket": {},
"hour_bucket": {},
"month_bucket": {}
},
"sub_rules": [],
"status": "active",
"lead_count": 0,
"external_id": "1025886"
}
}
Show
> Example Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
https://api.wishpond.com/api/v1/lists/:list_id
> Sample Response:
{
"list": {
"id": "55c278bc626f747ad70c0100",
"type": "static",
"name": "My First List",
"created_at": "2015-08-05T20:57:32.273Z",
"stat": {
"_id": {
"$oid": "55c278bc626f747ad70d0100"
},
"day_bucket": {},
"hour_bucket": {},
"month_bucket": {}
},
"sub_rules": [],
"status": "active",
"lead_count": 0,
"external_id": "1025886"
}
}
You can get a single list by appending the list’s id at the end of the lists endpoint:
https://api.wishpond.com/api/v1/lists/:list_id
Update
You can update a list at the following endpoint:
PUT https://api.wishpond.com/api/v1/lists/:list_id
Parameter | Description | Type | Required |
---|---|---|---|
name | Name of the list | string | yes |
> Example Request:
curl -X PUT \
-H "X-Api-Token:YOUR_API_KEY" \
-d "list[name]=potato" \
https://api.wishpond.com/api/v1/lists/:list_id
> Sample Response:
{
"list": {
"id": "55c278bc626f747ad70c0100",
"type": "static",
"name": "potato",
"created_at": "2015-08-05T20:57:32.273Z",
"stat": {
"_id": {
"$oid": "55c278bc626f747ad70d0100"
},
"day_bucket": {},
"hour_bucket": {},
"month_bucket": {}
},
"sub_rules": [],
"status": "active",
"lead_count": 0,
"external_id": "1025886"
}
}
Delete
> Example Request:
curl -X DELETE https://api.wishpond.com/api/v1/leads/:list_id \
-H "X-Api-Token:YOUR_API_KEY"
>Sample Response:
{
"deleted": "true"
}
You can delete a list at the following endpoint:
DELETE https://api.wishpond.com/api/v1/lists/:list_id
Leads
> Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/lists/:list_id/leads?page=1&per_page=10"
> Sample Response:
{
"leads": [
{
"id": "55aa14783965660005126f78",
"email": "some@test.com",
"status": "active",
"created_at": "2015-07-04T00:49:06.420Z",
"updated_at": "2015-07-16T01:29:00.970Z",
"listed_attributes": {
"created_at": "2015-07-04T00:49:06.420Z",
"updated_at": "2015-07-16T01:29:00.970Z",
"lead_score": 0,
"subscribed": true
},
"lead_score": 0,
"subscribed": true,
"first_name": "brian f",
"cid": "b867dc398592c3ef",
"mid": "263531"
},
{
"id": "55aa14643965660005126c6a",
"email": "another@test.com",
"status": "active",
"created_at": "2015-07-04T00:51:02.487Z",
"updated_at": "2015-07-16T01:29:00.429Z",
"listed_attributes": {
"created_at": "2015-07-04T00:51:02.487Z",
"updated_at": "2015-07-16T01:29:00.429Z",
"lead_score": 0,
"subscribed": true
},
"lead_score": 0,
"subscribed": true,
"first_name": "sadha",
"cid": "169eab15f123bc62",
"mid": "263531"
}
],
"meta": {
"current_page": 1,
"total_entries": 2,
"total_pages": 1,
"total_leads": 2,
"total_visitors":64
}
}
You can get the list’s leads at the following endpoint:
https://api.wishpond.com/api/v1/lists/:list_id/leads
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of leads returned per page | pagination | 0-200 |
Visitors
> Request:
curl -H "X-Api-Token:YOUR_API_KEY" \
"https://api.wishpond.com/api/v1/lists/:list_id/visitors?page=1&per_page=10"
> Sample Response:
{
"visitors":[
{
"id":"70b5c5a3cc09fa6d",
"cid":"70b5c5a3cc09fa6d",
"mid":"696791",
"email":null,
"status":"active",
"created_at":"2016-03-16T23:17:11.000Z",
"updated_at":"2016-03-16T23:18:51.000Z",
"lead_score":0,
"subscribed":true,
"dynamic_attributes":{}
}
],
"meta":
{
"current_page":1,
"total_entries":1,
"total_pages":1,
"lead_limit":-1,
"total_leads":3,
"total_visitors":1
}
}
You can get the list’s visitors at the following endpoint:
https://api.wishpond.com/api/v1/lists/:list_id/visitors
Parameter | Description | Type | Allowed |
---|---|---|---|
page | Page number | pagination | Integers above 0 |
per_page | Number of leads returned per page | pagination | 0-200 |
`
Errors
The Wishpond API uses the following error codes:
Error Code | Meaning |
---|---|
401 | Unauthorized – Either your MerchantID or Tracking Key are wrong |
403 | Forbidden – This user does not have access to this resource |
404 | Not Found – Could not find method requested |
422 | Unprocessable Entity - We can’t process what you gave us. Take a look at the errors in the response to know more. |
429 | Too Many Requests – You’re over the rate limit window. Try your request again later. |
500 | Internal Server Error – There was an issue processing your request. Get in contact with us at support@wishpond.com |
503 | Service Unavailable – Our servers decided to take a nap. We’ll wake it up for you, try your requests later or contact us. |