NAV

Introduction

Welcome to the Wootric API documentation!

You can use our API to access and update your end users, responses, declines, and page views.

All responses from the API (including errors) are in JSON. All code examples are in cURL.

Authentication

To retrieve an access token using OAuth if you have one account on Wootric, use the following code:

curl -i https://api.wootric.com/oauth/token \
     -F grant_type=password \
     -F username=<youremailaddress> \
     -F password=<yourpassword>

To retrieve an access token using OAuth if you multiple accounts on Wootric, you would need to pass your account token as query paarameter to the URL as following:

curl -i https://api.wootric.com/oauth/token?account_token=NPS-XXXX \
     -F grant_type=password \
     -F username=<youremailaddress> \
     -F password=<yourpassword>

The above command returns the following JSON:

{
  "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 https://api.wootric.com/oauth/token \
     -F grant_type=refresh_token \
     -F refresh_token="<yourrefreshtoken>"

The above command returns the following JSON:

{
  "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 https://api.wootric.com/oauth/token \
     -F grant_type=client_credentials \
     -F client_id=<yourclientid> \
     -F client_secret=<yourclientsecret>

The above command returns the following JSON:

{
  "access_token":"<youraccesstoken>",
  "token_type":"bearer",
  "expires_in":7200,
  "scope":"public"  
}

Access tokens 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 the token to be included in all API requests regardless of grant_type of password or client_credentials. We recommend to send your token as HTTP Authorization Header, for example

curl -H "Authorization: Bearer <youraccesstoken>" https://api.wootric.com/v1/end_users

Token can be sent as query parameters as well but we do not recommend it for security purposes. For example

https://api.wootric.com/v1/end_users?access_token=myaccesstoken

Access tokens expire 2 hours after creation. New access_token can be obtained using refresh tokens as detailed in the cURL example to the right.

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 last updated
email string End user email
last_surveyed datetime Datetime representation of when the end user was last surveyed
external_created_at integer UNIX timestamp of when the end user was created externally
page_views_count integer Total number of page views
properties hash Properties (i.e. plan, product)

Get All End Users

curl "https://api.wootric.com/v1/end_users?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users"

The above command returns the following JSON:

[
  {
    "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 https://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, max 30
per_page (optional) integer 25 Number of records returned on each page, max 50
created (optional) hash {} Filter your end users by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
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)
sort_order (optional) string asc Order in which records are shown. Default is oldest first. Options are asc or desc

We recommend to iterate using created parameter if you need to get more data than what you get out of our pagination restriction.

Get a Specific End User

curl "https://api.wootric.com/v1/end_users/2?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/2"

The above command returns the following JSON:

  {
    "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 https://api.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 "https://api.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" "https://api.wootric.com/v1/end_users" -d "email=enduser@example.com&last_surveyed=1423732280&properties[company]=TestCompany&properties[city]=San Francisco"

The above command returns the following JSON:

  {
    "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 https://api.wootric.com/v1/end_users

URL Parameters

Parameter Description
email 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 "https://api.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" "https://api.wootric.com/v1/end_users/1" -d "email=enduser_new@example.com&properties[company]=NewCompany&properties[city]=New Reno"

The above command returns the following JSON:

  {
    "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 https://api.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 "https://api.wootric.com/v1/end_users/1?access_token=myaccesstoken"

or

curl -X DELETE -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1"

The above command returns the following JSON:

  {
    "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 https://api.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
end_user_id integer The ID of end user
survey_id integer ID of the survey to which the response belongs
score integer The response’s score
text text The response’s comment
completed boolean Specifies if a response has been completed
excluded_from_calculations boolean Specifies if a response should be excluded from calculations
ip_address text The response’s IP address
origin_url text The response’s origin url
created_at datetime Datetime representation of when the response was created
updated_at datetime Datetime representation of when the response was last updated
tags string array The responses’s tags
end_user.properties hash The end user properties at the moment the survey was taken

Get All Responses

curl "https://api.wootric.com/v1/responses?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/responses"

The above command returns the following JSON:

[
    {
        "id": 1,
        "end_user_id": 1,
        "survey_id": 1,
        "score": 0,
        "text": "Better performance would mean a higher score. Site is often slow.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 09:05:00 -0800",
        "updated_at": "2016-12-16 09:05:13 -0800",
        "tags": [
            "PERFORMANCE"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 2,
        "end_user_id": 2,
        "survey_id": 2,
        "score": 10,
        "text": "Great service.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 09:10:43 -0800",
        "updated_at": "2016-12-16 09:11:00 -0800",
        "tags": [],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Web",
                "purchase_date": 1473177888,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all responses for a user.

HTTP Request

GET https://api.wootric.com/v1/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 (optional) integer 1 Number of returned page, max 30
per_page (optional) integer 25 Number of records returned on each page, max 50
created hash {} Filter your responses by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

We recommend to iterate using created parameter if you need to get more data than what you get out of our pagination restriction.

Get All End User’s Responses

curl "https://api.wootric.com/v1/end_users/1/responses?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/responses"

The above command returns the following JSON:

[
    {
        "id": 1,
        "end_user_id": 1,
        "survey_id": 1,
        "score": 0,
        "text": "Better performance would mean a higher score. Site is often slow.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 09:05:00 -0800",
        "updated_at": "2016-12-16 09:05:13 -0800",
        "tags": [
            "PERFORMANCE"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 3,
        "end_user_id": 1,
        "survey_id": 3,
        "score": 5,
        "text": "Customer support STILL hasn't gotten back to me.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 10:30:02 -0800",
        "updated_at": "2016-12-16 10:31:00 -0800",
        "tags": [
            "CALL"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Web",
                "purchase_date": 1473177888,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all responses for end user.

HTTP Request

GET https://api.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, max 30
per_page integer 25 Number of records returned on each page, max 50
created hash {} Filter your responses by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

We recommend to iterate using created parameter if you need to get more data than what you get out of our pagination restriction.

Get All Promoters Responses

curl "https://api.wootric.com/v1/end_users/1/responses/promoters?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/responses/promoters"

The above command returns the following JSON:

[
    {
        "id": 6,
        "end_user_id": 1,
        "survey_id": 6,
        "score": 9,
        "text": "Nice app.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 13:05:01 -0800",
        "updated_at": "2016-12-16 13:06:11 -0800",
        "tags": [
            "UX"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Business User",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 7,
        "end_user_id": 1,
        "survey_id": 7,
        "score": 10,
        "text": "Awesome service! The whole world should know about you guys.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 14:20:22 -0800",
        "updated_at": "2016-12-16 14:21:10 -0800",
        "tags": [],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Business User",
                "pricing_plan": "Small Business",
                "product_plan": "Web",
                "purchase_date": 1473177888,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all promoters responses for end user.

HTTP Request

GET https://api.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, max 30
per_page integer 25 Number of records returned on each page, max 50
created hash {} Filter your responses by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

Get All Passives Responses

curl "https://api.wootric.com/v1/end_users/1/responses/passives?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/responses/passives"

The above command returns the following JSON:

[
    {
        "id": 4,
        "end_user_id": 1,
        "survey_id": 4,
        "score": 7,
        "text": "Cool site.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 11:05:01 -0800",
        "updated_at": "2016-12-16 11:05:13 -0800",
        "tags": [
            "UX"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 5,
        "end_user_id": 1,
        "survey_id": 5,
        "score": 8,
        "text": "Good service.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 12:00:02 -0800",
        "updated_at": "2016-12-16 12:01:00 -0800",
        "tags": [],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Business User",
                "pricing_plan": "Small Business",
                "product_plan": "Web",
                "purchase_date": 1473177888,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all passives responses for end user.

HTTP Request

GET https://api.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, max 30
per_page integer 25 Number of records returned on each page, max 50
created hash {} Filter your responses by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

Get All Detractors Responses

curl "https://api.wootric.com/v1/end_users/1/responses/detractors?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/responses/detractors"

The above command returns the following JSON:

[
    {
        "id": 1,
        "end_user_id": 1,
        "survey_id": 1,
        "score": 0,
        "text": "Better performance would mean a higher score. Site is often slow.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 09:05:00 -0800",
        "updated_at": "2016-12-16 09:05:13 -0800",
        "tags": [
            "PERFORMANCE"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 3,
        "end_user_id": 1,
        "survey_id": 3,
        "score": 5,
        "text": "Customer support STILL hasn't gotten back to me.",
        "completed": false,
        "excluded_from_calculations": false,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 10:30:02 -0800",
        "updated_at": "2016-12-16 10:31:00 -0800",
        "tags": [
            "CALL"
        ],
        "notes": [],
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Web",
                "purchase_date": 1473177888,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all detractors responses for end user.

HTTP Request

GET https://api.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, max 30
per_page integer 25 Number of records returned on each page, max 50
created hash {} Filter your responses by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

Get a Specific Response

curl "https://api.wootric.com/v1/end_users/2/responses/2?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/2/responses/2"

The above command returns the following JSON:

{
    "id": 2,
    "end_user_id": 2,
    "survey_id": 2,
    "score": 10,
    "text": "Great service.",
    "completed": false,
    "excluded_from_calculations": false,
    "ip_address": "127.0.0.1",
    "origin_url": "https://wootric.com",
    "created_at": "2016-12-16 09:10:43 -0800",
    "updated_at": "2016-12-16 09:11:00 -0800",
    "tags": [],
    "notes": [],
    "end_user": {
        "properties": {
            "persona": "Individual",
            "pricing_plan": "Small Business",
            "product_plan": "Web",
            "purchase_date": 1473177888,
            "revenue_amount": 5000
        }
    }
}

This endpoint retrieves a specific response.

HTTP Request

GET https://api.wootric.com/v1/end_users/<end_user_id>/responses/<id>

URL Parameters

Parameter Type Description
end_user_id integer The ID of the end user
id integer The ID of the decline to retrieve

Create Response

curl -X POST "https://api.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" "https://api.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 https://api.wootric.com/v1/end_users/<end_user_id>/responses

URL Parameters

Parameter Type Description
end_user_id integer The ID of the end user
score integer The end user response score (values from 0 to 10)
ip_address text IP address the response originated from
origin_url text URL the response originated from
text (optional) text The end user comment to the response
created_at (optional) integer (UNIX timestamp) If present, will set ‘created_at’ of newly created decline to provided value
end_user.properties (optional) hash An object containing the current properties for this end user. If supplied, the end user profile will be updated and the new properties will be associated to this response.

Update Response

curl -X PUT "https://api.wootric.com/v1/responses/1?access_token=myaccesstoken" -d "completed=true&excluded_from_calculations=false"

or

curl -X PUT -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/responses/1" -d "completed=true&excluded_from_calculations=false"

The above command returns and empty response with status 204.

This endpoint updates an existing response.

HTTP Request

PUT https://api.wootric.com/v1/responses/<id>

URL Parameters

Parameter Type Description
id integer The ID of the response to update
completed (optional) boolean Indicates if the response is complete
excluded_from_calculations (optional) boolean Indicates if the response is invalid
end_user.properties (optional) hash An object containing the new set of properties for this response. This will only update the properties that the end user had at this point in time. The current end user properties won’t be updated. Since this feature allows to edit historical data, it’s not enabled by default. Please contact us to enable it. A 423 error will be returned when attempting to use this feature if it’s not enabled.

Delete Response

curl -X DELETE "https://api.wootric.com/v1/end_users/1/responses/1?access_token=myaccesstoken"

or

curl -X DELETE -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/responses/1"

The above command returns and empty response with status 204.

This endpoint deletes an end user response.

HTTP Request

DELETE https://api.wootric.com/v1/end_users/<end_user_id>/responses/<response_id>

URL Parameters

Parameter Type Description
end_user_id integer The ID of the end user
response_id integer 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
survey_id integer ID of the survey to which the decline belongs
ip_address text The decline’s IP address
origin_url text The decline’s origin url
created_at datetime Datetime representation of when the decline was created
updated_at datetime Datetime representation of when the decline was last updated
end_user.properties hash The end user properties at the moment the survey was taken

Get All Declines

curl "https://api.wootric.com/v1/declines?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/declines"

The above command returns the following JSON:

[
    {
        "id": 1,
        "end_user_id": 1,
        "survey_id": 10,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 14:20:43 -0800",
        "updated_at": "2016-12-16 14:20:43 -0800",
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 2,
        "end_user_id": 2,
        "survey_id": 11,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 14:21:10 -0800",
        "updated_at": "2016-12-16 14:21:10 -0800",
        "end_user": {
            "properties": {
                "persona": "Business User",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all declines for the user.

HTTP Request

GET https://api.wootric.com/v1/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, max 30
per_page integer 25 Number of records returned on each page, max 50
created hash {} Filter your declines by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

We recommend to iterate using created parameter if you need to get more data than what you get out of our pagination restriction.

Get All End User’s Declines

curl "https://api.wootric.com/v1/end_users/1/declines?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/declines"

The above command returns the following JSON:

[
    {
        "id": 1,
        "end_user_id": 1,
        "survey_id": 10,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 14:20:43 -0800",
        "updated_at": "2016-12-16 14:20:43 -0800",
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    },
    {
        "id": 3,
        "end_user_id": 1,
        "survey_id": 12,
        "ip_address": "127.0.0.1",
        "origin_url": "https://wootric.com",
        "created_at": "2016-12-16 14:22:41 -0800",
        "updated_at": "2016-12-16 14:22:41 -0800",
        "end_user": {
            "properties": {
                "persona": "Individual",
                "pricing_plan": "Small Business",
                "product_plan": "Mobile",
                "purchase_date": 1473177881,
                "revenue_amount": 5000
            }
        }
    }
]

This endpoint retrieves all declines for end user.

HTTP Request

GET https://api.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, max 30
per_page integer 25 Number of records returned on each page, max 50
created hash {} Filter your declines by time of creation (UNIX timestamp type) - eq, lt, lte, gt, gte (created[gt]=UNIX_TIMESTAMP &created[lt]=UNIX_TIMESTAMP)
sort_order (optional) string desc Order in which records are shown. Default is newest first. Options are asc or desc

Get a Specific Decline

curl "https://api.wootric.com/v1/end_users/1/declines/1?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/declines/1"

The above command returns the following JSON:

{
    "id": 1,
    "end_user_id": 1,
    "survey_id": 10,
    "ip_address": "127.0.0.1",
    "origin_url": "https://wootric.com",
    "created_at": "2016-12-16 14:20:43 -0800",
    "updated_at": "2016-12-16 14:20:43 -0800",
    "end_user": {
        "properties": {
            "persona": "Individual",
            "pricing_plan": "Small Business",
            "product_plan": "Mobile",
            "purchase_date": 1473177881,
            "revenue_amount": 5000
        }
    }
}

This endpoint retrieves a specific decline.

HTTP Request

GET https://api.wootric.com/v1/end_users/<end_user_id>/declines/<id>

URL Parameters

Parameter Type Description
end_user_id integer The ID of the end user
id integer The ID of the decline to retrieve

Create Decline

curl -X POST "https://api.wootric.com/v1/end_users/1/declines?access_token=myaccesstoken"

or

curl -X POST -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/declines"

This endpoint creates a decline for the end user.

HTTP Request

POST https://api.wootric.com/v1/end_users/<end_user_id>/declines

URL Parameters

Parameter Type Description
end_user_id integer The ID of the end user
origin_url (optional) string URL of the decline origin
created_at (optional) integer (UNIX timestamp) If present, will set ‘created_at’ of newly created decline to provided value
end_user.properties (optional) hash An object containing the current properties for this end user. If supplied, the end user profile will be updated and the new properties will be associated to this decline.

Update Decline

curl -X PUT "https://api.wootric.com/v1/declines/1?access_token=myaccesstoken" -d "end_user[properties][persona]=Individual"

or

curl -X PUT -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/declines/1" -d "end_user[properties][persona]=Individual"

The above command returns and empty response with status 204.

This endpoint updates an existing decline.

HTTP Request

PUT https://api.wootric.com/v1/responses/<id>

URL Parameters

Parameter Type Description
id integer The ID of the response to update
end_user.properties (optional) hash An object containing the new set of properties for this decline. This will only update the properties that the end user had at this point in time. The current end user properties won’t be updated. Since this feature allows to edit historical data, it’s not enabled by default. Please contact us to enable it. A 423 error will be returned when attempting to use this feature if it’s not enabled.

Delete Decline

curl -X DELETE "https://api.wootric.com/v1/end_users/1/declines/1?access_token=myaccesstoken"

or

curl -X DELETE -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/declines/1"

The above command returns and empty response with status 204.

This endpoint deletes a decline for the end user.

HTTP Request

DELETE https://api.wootric.com/v1/end_users/<end_user_id>/declines/<decline_id>

URL Parameters

Parameter Type Description
end_user_id integer The ID of the end user
decline_id integer The ID of the decline to delete

End User Settings

End User Settings Object

A end user settings object has the following fields:

Attribute Type Description
id integer The ID of end user settings
end_user_id integer The ID of end user
created_at datetime Datetime representation of when the end user settings were created
updated_at datetime Datetime representation of when the end user settings was last updated
email_nps boolean Specifies whether end user should receive NPS survey through an email

Get Specific End User Settings

curl "https://api.wootric.com/v1/end_users/1/settings?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/settings"

The above command returns the following JSON:

  {
    "id":1,
    "end_user_id":2,
    "created_at":"2015-04-20 04:46:51-08:00",
    "updated_at":"2015-04-20 04:46:51-08:00",
    "email_nps":true
  }

This endpoint retrieves a specific end users settings.

HTTP Request

GET https://api.wootric.com/v1/end_users/<end_user_id>/settings

URL Parameters

Parameter Description
end_user_id The ID of the end user

Update End User Settings

curl -X PUT "https://api.wootric.com/v1/end_users/1/settings?access_token=myaccesstoken" -d "email_nps=false"

or

curl -X PUT -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/end_users/1/settings" -d "email_nps=false"

The above command returns the following JSON:

  {
    "end_user_id":1,
    "id":2,
    "email_nps":false,
    "created_at":"2015-04-20T04:55:58.741-08:00",
    "updated_at":"2015-04-20T04:55:58.755-08:00"
  }

This endpoint updates the end users settings with specified params.

HTTP Request

PUT https://api.wootric.com/v1/end_users/<end_user_id>/settings

URL Parameters

Parameter Description
end_user_id The ID of the end user to update
email_nps (optional) whether or not end user should receive NPS survey through an email

Metrics

NPS Object

An NPS object has the following fields:

Attribute Type Description
nps integer NPS for a given date range
responses integer Number of responses for a given date range
detractors integer Number of detractors for a given date range
passives integer Number of passives for a given date range
promoters integer Number of promoters for a given date range
response_rate integer Response rate percentage for a given date range
email_response_rate integer Email response rate percentage for a given date range

Get NPS summary

curl "https://api.wootric.com/v1/nps_summary?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/nps_summary"

# With params

curl "https://api.wootric.com/v1/nps_summary?access_token=myaccesstoken?date%5Bstart%5D='YYYY-MM-DD'&date%5Bend%5D='YYYY-MM-DD'"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/nps_summary?date%5Bstart%5D='YYYY-MM-DD'&date%5Bend%5D='YYYY-MM-DD'"

The above command returns the following JSON:

  {
    "nps": 55,
    "responses": 75,
    "detractors": 5,
    "passives": 24,
    "promoters": 46,
    "response_rate": 92,
    "email_response_rate": 0
  }

This endpoint retrieves the NPS summary for the specified date range. If no date range is specified, the API returns NPS summary for the last month.

HTTP Request

GET https://api.wootric.com/v1/nps_summary

URL Parameters

Parameter Type Default Description
date (optional) hash {} NPS summary by start date (optional) and end date (optional) (date[start]='YYYY-MM-DD'&date[end]='YYYY-MM-DD')

Segments

Segment Object

A Segment object has the following fields:

Attribute Type Description
name string Name of the segment
data_type string One of string, date or integer representing the segment data type
created_at datetime Datetime representation of when the segment was created

Get All Segments

curl "https://api.wootric.com/v1/segments?access_token=myaccesstoken"

or

curl -H "Authorization: Bearer myaccesstoken" "https://api.wootric.com/v1/segments"

The above command returns the following JSON:

[
  {
    "name": "persona",
    "data_type": "string",
    "created_at": "2017-02-01 12:12:50 -0800"
  },
  {
    "name": "pricing_plan",
    "data_type": "string",
    "created_at": "2017-02-01 12:12:50 -0800"
  },
  {
    "name": "product_plan",
    "data_type": "string",
    "created_at": "2017-02-01 12:12:50 -0800"
  },
  {
    "name": "purchase_date",
    "data_type": "date",
    "created_at": "2017-02-01 12:12:50 -0800"
  },
  {
    "name": "revenue_amount",
    "data_type": "integer",
    "created_at": "2017-02-01 12:12:50 -0800"
  }
]

This endpoint retrieves all segments for an account.

HTTP Request

GET https://api.wootric.com/v1/segments

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.