Introduction
Welcome to the Wootric API documentation!
You can use our API to access your end users, responses, declines and page views.
JSON will be returned in all responses from the API including errors. We currently have code examples using curl, you can view code examples in the dark area to the right.
Authentication
Access token can be retrieved using either grant_type of “password” with your account email and password, or grant_type of “client_credentials” with your application client_id and client_secret.
Wootric expects for the access token key to be included in all API requests that looks like the following for grant_type of “password”:
http://api.staging.wootric.com/v1/end_users.json?access_token=myaccesstoken
If you are using grant_type of “client_credentials” you need to send the access token as a request header:
Authorization: Bearer <myaccesstoken>
Access token expires 2 hours after creation. New Access tokens can be obtained using refresh tokens which is detailed in the CURL example to the right.
To retrieve an access token using oauth, use this code:
curl -i http://api.staging.wootric.com/oauth/token \
-F grant_type=password \
-F username=<youremailaddress>\
-F password=<yourpassword>
The above command returns JSON structured like this:
{
"access_token":"<youraccesstoken>",
"token_type":"bearer",
"expires_in":7200,
"refresh_token":"<yourrefreshtoken>",
"scope":"public"
}
To retrieve a new access token after it has expired, use this code:
curl -i http://api.staging.wootric.com/oauth/token \
-F grant_type=refresh_token \
-F refresh_token="<yourrefreshtoken>"
The above command returns JSON structured like this:
{
"access_token":"<yournewaccesstoken>",
"token_type":"bearer",
"expires_in":7200,
"refresh_token":"<yournewrefreshtoken>",
"scope":"public"
}
To retrieve an access token using credentials, use this code:
curl -X POST http://api.staging.wootric.com/oauth/token \
-F grant_type=client_credentials \
-F client_id=<yourclientid> \
-F client_secret=<yourclientsecret>
The above command returns JSON structured like this:
{
"access_token":"<youraccesstoken>",
"token_type":"bearer",
"expires_in":7200,
"scope":"public"
}
End Users
End User Object
A end user object has the following fields:
Attribute | Type | Description |
---|---|---|
id | integer | The id of end user |
created_at | datetime | Datetime representation of when the end user was created |
updated_at | datetime | Datetime representation of when the end user was lately updated |
string | End user email | |
last_surveyed | datetime | Datetime representation of when the end user was lately surveyed |
external_created_at | integer | |
user_id | integer | The id of user |
page_views_count | integer | Total number of page views |
properties | hash | Properties (i.e. plan, product) |
Get All End Users
curl "http://api.staging.wootric.com/v1/end_users?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users"
The above command returns JSON structured like this:
[
{
"id": 1,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"email": "nps@example.com",
"last_surveyed": null,
"external_created_at": null,
"user_id": 16,
"page_views_count" : 1,
"properties": {"plan": "Small Business", "product": "Example"}
},
{
"id": 2,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-04 12:43:44",
"email": "nps2@example.com",
"last_surveyed": null,
"external_created_at": null,
"user_id": 16,
"page_views_count" : 3,
"properties": {"plan": "Enterprise", "product": "The Company"}
}
]
This endpoint retrieves all end users.
HTTP Request
GET http://api.wootric.com/v1/end_users
Scope Parameters
Scope parameters filter your end users and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page (optional) | integer | 1 | Number of returned page |
per_page (optional) | integer | 25 | Number of records returned on each page |
created (optional) | hash | {} | Hash with properties used to filter your end users by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
email (optional) | string | None | Filter end users by email (will return an array containing a single end user object if the end user with provided email exists) |
Get a Specific End User
curl "http://api.wootric.com/v1/end_users/2?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/2"
The above command returns JSON structured like this:
{
"id": 2,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-04 12:43:44",
"email": "nps2@example.com",
"last_surveyed": null,
"external_created_at": null,
"user_id": 16,
"page_views_count" : 3,
"properties": {"plan": "Enterprise", "product": "The Company"}
}
This endpoint retrieves a specific end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the end user to retrieve |
Create End User
curl -X POST "http://api.staging.wootric.com/v1/end_users?access_token=myaccesstoken" -d "email=enduser@example.com;last_surveyed=1423732280;properties[company]=TestCompany&properties[city]=San Francisco"
or
curl -X POST -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users" -d "email=enduser@example.com;last_surveyed=1423732280;properties[company]=TestCompany&properties[city]=San Francisco"
The above command returns JSON structured like this:
{
"id": 1,
"email": "enduser@example.com",
"last_surveyed": "2015-02-12T06:29:27.000-08:00",
"external_created_at": null,
"created_at" : "2015-02-12T06:29:27.000-08:00",
"updated_at" : "2015-02-12T06:29:27.000-08:00",
"user_id": 1,
"page_views_count": 0,
"properties": "{'company':'TestCompany', 'city':'San Francisco'}"
}
This endpoint creates the end user.
HTTP Request
POST http://api.staging.wootric.com/v1/end_users
URL Parameters
Parameter | Description |
---|---|
End User’s Email Address | |
last_surveyed (optional) | Date of last survey for the end user (UNIX Timestamp) |
external_created_at (optional) | Date of creation of the end user in external application (UNIX Timestamp) |
properties (optional) | Hash of additional properties |
Update End User
curl -X PUT "http://api.staging.wootric.com/v1/end_users/1?access_token=myaccesstoken" -d "email=enduser_new@example.com;properties[company]=NewCompany&properties[city]=New Reno"
or
curl -X PUT -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1" -d "email=enduser_new@example.com;properties[company]=NewCompany&properties[city]=New Reno"
The above command returns JSON structured like this:
{
"id": 1,
"email": "enduser_new@example.com",
"last_surveyed": "2015-02-12T06:29:27.000-08:00",
"external_created_at": null,
"created_at" : "2015-02-12T06:29:27.000-08:00",
"updated_at" : "2015-02-12T06:29:27.000-08:00",
"user_id": 1,
"page_views_count": 0,
"properties": "{'company':'NewCompany', 'city':'New Reno'}"
}
This endpoint updates the end user with specified params.
HTTP Request
PUT http://api.staging.wootric.com/v1/end_users/<END_USER_ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user to update |
email (optional) | End User’s Email Address |
last_surveyed (optional) | Date of last survey for the end user (UNIX Timestamp) |
external_created_at (optional) | Date of creation of the end user in external application (UNIX Timestamp) |
properties (optional) | Hash of additional properties |
Delete End User
curl -X DELETE "http://api.staging.wootric.com/v1/end_users/1?access_token=myaccesstoken"
or
curl -X DELETE -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1"
The above command returns JSON structured like this:
{
"id": 1,
"email": "enduser@example.com",
"last_surveyed": "2015-02-12T06:29:27.000-08:00",
"external_created_at": null,
"created_at" : "2015-02-12T06:29:27.000-08:00",
"updated_at" : "2015-02-12T06:29:27.000-08:00",
"user_id": 1,
"page_views_count": 0,
"properties": "{'company':'TestCompany', 'city':'San Francisco'}"
}
This endpoint deletes the end user.
HTTP Request
DELETE http://api.staging.wootric.com/v1/end_users/<END_USER_ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user to delete |
Responses
Response Object
A response object has the following fields:
Attribute | Type | Description |
---|---|---|
id | integer | The id of response |
created_at | datetime | Datetime representation of when the response was created |
updated_at | datetime | Datetime representation of when the response was lately updated |
score | integer | The response’s score |
text | text | The response’s comment |
ip_address | text | The response’s IP address |
origin_url | text | The response’s origin url |
end_user_id | integer | The id of end user |
user_id | integer | The if of user |
Get All Responses
curl "http://api.staging.wootric.com/v1/responses?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/responses"
The above command returns JSON structured like this:
[
{
"id": 1,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"score": 10,
"text": "Great Service",
"ip_address": "192.168.0.1",
"origin_url" : "http://www.great-service.com",
"end_user_id": 1,
"user_id": 16
},
{
"id": 2,
"created_at" : "2014-11-01 17:38:50",
"updated_at" : "2014-11-01 17:38:50",
"score": 0,
"text": "Please fix those bugs",
"ip_address": "127.0.0.1",
"origin_url" : "http://www.fix-bugs.com",
"end_user_id": 2,
"user_id": 16
}
]
This endpoint retrieves all responses for a user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/responses
Scope Parameters
Scope parameters filter your responses and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your responses by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get All End User’s Responses
curl "http://api.staging.wootric.com/v1/end_users/1/responses?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/responses"
The above command returns JSON structured like this:
[
{
"id": 1,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"score": 10,
"text": "Great Service",
"ip_address": "192.168.0.1",
"origin_url" : "http://www.great-service.com",
"end_user_id": 1,
"user_id": 16
},
{
"id": 2,
"created_at" : "2014-11-01 17:38:50",
"updated_at" : "2014-11-01 17:38:50",
"score": 0,
"text": "Please fix those bugs",
"ip_address": "127.0.0.1",
"origin_url" : "http://www.fix-bugs.com",
"end_user_id": 1,
"user_id": 16
}
]
This endpoint retrieves all responses for end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/responses
Scope Parameters
Scope parameters filter your responses and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your responses by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get All Promoters Responses
curl "http://api.staging.wootric.com/v1/end_users/1/responses/promoters?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/responses/promoters"
The above command returns JSON structured like this:
[
{
"id": 1,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"score": 10,
"text": "Great Service",
"ip_address": "192.168.0.1",
"origin_url" : "http://www.great-service.com",
"end_user_id": 1,
"user_id": 16
},
{
"id": 3,
"created_at" : "2014-11-01 17:38:50",
"updated_at" : "2014-11-01 17:38:50",
"score": 9,
"text": "Nice app",
"ip_address": "127.0.0.1",
"origin_url" : "http://www.nice-app.com",
"end_user_id": 1,
"user_id": 16
}
]
This endpoint retrieves all promoters responses for end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/responses/promoters
Scope Parameters
Scope parameters filter your promoters responses and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your promoters responses by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get All Passives Responses
curl "http://api.staging.wootric.com/v1/end_users/1/responses/passives?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/responses/passives"
The above command returns JSON structured like this:
[
{
"id": 21,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"score": 8,
"text": "Cool Site",
"ip_address": "192.168.0.1",
"origin_url" : "http://www.cool-site.com",
"end_user_id": 1,
"user_id": 16
},
{
"id": 23,
"created_at" : "2014-11-01 17:38:50",
"updated_at" : "2014-11-01 17:38:50",
"score": 7,
"text": "Good Service",
"ip_address": "127.0.0.1",
"origin_url" : "http://www.good-service.com",
"end_user_id": 1,
"user_id": 16
}
]
This endpoint retrieves all passives responses for end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/responses/passives
Scope Parameters
Scope parameters filter your passives responses and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your passives responses by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get All Detractors Responses
curl "http://api.staging.wootric.com/v1/end_users/1/responses/detractors?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/responses/detractors"
The above command returns JSON structured like this:
[
{
"id": 101,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"score": 3,
"text": "It doesn't work",
"ip_address": "192.168.0.1",
"origin_url" : "http://www.doesnt-work.com",
"end_user_id": 1,
"user_id": 16
},
{
"id": 2,
"created_at" : "2014-11-01 17:38:50",
"updated_at" : "2014-11-01 17:38:50",
"score": 0,
"text": "Please fix those bugs",
"ip_address": "127.0.0.1",
"origin_url" : "http://www.fix-bugs.com",
"end_user_id": 1,
"user_id": 16
}
]
This endpoint retrieves all detractors responses for end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/responses/detractors
Scope Parameters
Scope parameters filter your detractors responses and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your detractors responses by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get a Specific Response
curl "http://api.staging.wootric.com/v1/end_users/1/responses/2?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/responses/2"
The above command returns JSON structured like this:
{
"id": 2,
"created_at" : "2014-11-01 17:38:50",
"updated_at" : "2014-11-01 17:38:50",
"score": 0,
"text": "Please fix those bugs",
"ip_address": "127.0.0.1",
"origin_url" : "http://www.fix-bugs.com",
"end_user_id": 1,
"user_id": 16
}
This endpoint retrieves a specific response.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/responses/<ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
ID | The ID of the decline to retrieve |
Create Response
curl -X POST "http://api.staging.wootric.com/v1/end_users/1/responses?access_token=myaccesstoken" -d "score=5;text=test response;ip_address=192.168.0.1;origin_url=http://example.com"
or
curl -X POST -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/responses" -d "score=5;text=test response;ip_address=192.168.0.1;origin_url=http://example.com"
This endpoint creates a response for the end user.
HTTP Request
POST http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/responses
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
SCORE | The end user response score (values from 0 to 10) |
ORIGIN_URL | URL the response originated from |
text (optional) | The end user comment to the response |
created_at (optional) | UNIX timestamp, if present, will set ‘created_at’ of newly created response to provided value |
Delete Response
curl -X DELETE "http://api.staging.wootric.com/v1/end_users/1/respones/1?access_token=myaccesstoken"
or
curl -X DELETE -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/respones/1"
The above command returns JSON structured like this:
{
"id": 1,
"created_at" : "2015-02-12T06:29:27.000-08:00",
"updated_at" : "2015-02-12T06:29:27.000-08:00",
"score": 5,
"text": "test response",
"ip_address": "192.168.0.1",
"origin_url": "http://example.com"
}
This endpoint deletes a page view for the end user.
HTTP Request
DELETE http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/respones/<RESPONSE_ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
RESPONSE_ID | The ID of the response to delete |
Declines
Decline Object
A decline object has the following fields:
Attribute | Type | Description |
---|---|---|
id | integer | The id of decline |
end_user_id | integer | The id of end user |
created_at | datetime | Datetime representation of when the decline was created |
updated_at | datetime | Datetime representation of when the decline was lately updated |
user_id | integer | The id of user |
Get All Declines
curl "http://api.staging.wootric.com/v1/end_users/1/declines?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/declines"
The above command returns JSON structured like this:
[
{
"id": 1,
"end_user_id": 1,
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59",
"user_id": 16
},
{
"id": 2,
"end_user_id": 1,
"created_at" : "2014-07-25 14:09:41",
"updated_at" : "2014-07-25 14:09:41",
"user_id": 16
}
]
This endpoint retrieves all declines for end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/declines
Scope Parameters
Scope parameters filter your declines and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your declines by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get a Specific Declines
curl "http://api.staging.wootric.com/v1/end_users/1/declines/2?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/declines/2"
The above command returns JSON structured like this:
{
"id": 2,
"end_user_id": 1,
"created_at" : "2014-07-25 14:09:41",
"updated_at" : "2014-07-25 14:09:41",
"user_id": 16
}
This endpoint retrieves a specific decline.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/declines/<ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
ID | The ID of the decline to retrieve |
Create Decline
curl -X POST "http://api.staging.wootric.com/v1/end_users/1/declines?access_token=myaccesstoken"
or
curl -X POST -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/declines"
This endpoint creates a decline for the end user.
HTTP Request
POST http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/declines
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
created_at (optional) | UNIX timestamp, if present, will set ‘created_at’ of newly created decline to provided value |
Delete Decline
curl -X DELETE "http://api.staging.wootric.com/v1/end_users/1/declines/1?access_token=myaccesstoken"
or
curl -X DELETE -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/declines/1"
The above command returns JSON structured like this:
{
"id": 1,
"end_user_id": 1,
"created_at" : "2015-02-13T01:44:51.578-08:00",
"updated_at" : "2015-02-13T01:44:51.578-08:00",
"user_id": 1
}
This endpoint deletes a decline for the end user.
HTTP Request
DELETE http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/declines/<DECLINE_ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
DECLINE_ID | The ID of the decline to delete |
Page Views
Page View Object
A page view object has the following fields:
Attribute | Type | Description |
---|---|---|
id | integer | The id of page view |
end_user_id | integer | The id of end user |
url | text | The URL of page |
at | datetime | Datetime representation of when the page was visited |
created_at | datetime | Datetime representation of when the page view was created |
updated_at | datetime | Datetime representation of when the page view was lately updated |
Get All Page Views
curl "http://api.staging.wootric.com/v1/end_users/1/page_views?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/page_views"
The above command returns JSON structured like this:
[
{
"id": 1,
"end_user_id": 1,
"url" : "http://www.great-service.com",
"at" : "2014-12-01 18:36:50",
"created_at" : "2014-12-01 18:36:59",
"updated_at" : "2014-12-01 18:36:59"
},
{
"id": 2,
"end_user_id": 1,
"url" : "http://www.great-service.com",
"at" : "2014-12-14 02:13:05",
"created_at" : "2014-12-14 02:13:15",
"updated_at" : "2014-12-14 02:13:15"
}
]
This endpoint retrieves all page views for end user.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/1/page_views
Scope Parameters
Scope parameters filter your page views and can also be chained together by passing multiple scope parameters in an array.
Parameter | Type | Default | Description |
---|---|---|---|
page | integer | 1 | Number of returned page |
per_page | integer | 25 | Number of records returned on each page |
created | hash | {} | Hash with properties used to filter your page views by time it can be used with params (UNIX timestamp type) - eq, lt, lte, gt, gte |
Get a Specific Page View
curl "http://api.staging.wootric.com/v1/end_users/1/page_views/2?access_token=myaccesstoken"
or
curl -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/page_views/2"
The above command returns JSON structured like this:
{
"id": 2,
"end_user_id": 1,
"url" : "http://www.great-service.com",
"at" : "2014-12-14 02:13:05",
"created_at" : "2014-12-14 02:13:15",
"updated_at" : "2014-12-14 02:13:15"
}
This endpoint retrieves a specific page view.
HTTP Request
GET http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/page_views/<ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
ID | The ID of the page view to retrieve |
Create Page View
curl -X POST "http://api.staging.wootric.com/v1/end_users/1/page_views?access_token=myaccesstoken" -d "at=1423751367;url=http://example.com"
or
curl -X POST -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/page_views" -d "at=1423751367;url=http://example.com"
The above command returns JSON structured like this:
{
"id": 1,
"end_user_id": 1,
"at": "2015-02-12T06:29:27.000-08:00",
"url": "http://example.com",
"created_at" : "2015-02-12T06:29:27.000-08:00",
"updated_at" : "2015-02-12T06:29:27.000-08:00"
}
This endpoint creates a page view for the end user.
HTTP Request
POST http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/page_views
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
at (optional) | When the page was viewed (UNIX timestamp) |
url (optional) | URL of the page viewed |
Delete Page View
curl -X DELETE "http://api.staging.wootric.com/v1/end_users/1/page_views/1?access_token=myaccesstoken"
or
curl -X DELETE -H "Authorization: Bearer myaccesstoken" "http://api.staging.wootric.com/v1/end_users/1/page_views/1"
The above command returns JSON structured like this:
{
"id": 1,
"end_user_id": 1,
"at": "2015-02-12T06:29:27.000-08:00",
"url": "http://example.com",
"created_at" : "2015-02-12T06:29:27.000-08:00",
"updated_at" : "2015-02-12T06:29:27.000-08:00"
}
This endpoint deletes a page view for the end user.
HTTP Request
DELETE http://api.staging.wootric.com/v1/end_users/<END_USER_ID>/page_views/<PAGE_VIEW_ID>
URL Parameters
Parameter | Description |
---|---|
END_USER_ID | The ID of the end user |
PAGE_VIEW_ID | The ID of the page view to delete |
Errors
The Wootric API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request – Your request is incorrect |
401 | Unauthorized – Your access token is wrong |
404 | Not Found – The specified resource could not be found |
500 | Internal Server Error – We had a problem with our server. Try again later. |