• Quick Start
  • Send Survey
  • Get Contact
  • Remove Contact
  • Delete Contact (GDPR)
  • Get Unsubscribed
  • Get Responses
  • Get NPS
  • Sent Statistics
  • Historical Stats
  • Deactivate All
  • Bulk Add with CSV
  • Inapp Surveys
  • Bulk Add/Send

Change Log

  • Changes

API Quick Start

Upon signing up you will be provided with everything you need to get started using the AskNicely API, including an AskNicely subdomain (e.g. demo.asknice.ly) and API key.

API Keys

  • AskNicely only requires a single API key N/A to authenticate your request.
  • Every AskNicely user is assigned their own API key, if you want to isolate API requests, create a new user.

Authenticating

  • Include your API key in any URL as request parameter e.g. https://DEMO.asknice.ly/api/v1/getnps?X-apikey=N/A
  • Or in a POST header as X-apikey: N/A to authenticate your request.

Contact Rules (Found on the Send page)

  • The API will only obey the first contact rule found on the send page
    • i.e. "Wait at least X days before contacting a customer again"
  • The API ignores the second rule
    • i.e. "For newly added contacts, wait X days…"

Errors

API requests that are invalid will receive a JSON error, like:
{
    "success": false,
    "msg": "We could not find the api key, or it was not set []"
}

Rate Limits

You can keep track of your current request rate by looking at the following Response Headers:
RateLimit-Req10s-Limit:200
RateLimit-Req10s-Remaining:197
RateLimit-Req60s-Limit:1000
 RateLimit-Req60s-Remaining:997

If a rate limit is hit, a HTTP 429 response is returned.
A blocked API request would contain a clear JSON response in the body as well as the Retry-After: Response Header.

{
    "success": false,
    "msg": "Rate limit hit: reduce the rate of requests and retry",
    "type": "req-10s",
    "count": 201,
    "limit": 200
}

Please note that there is a different a rate limit applied for calls to /contact/trigger! If you hit this limit, consider sending your data in bulk to /contacts/add.
A blocked API request would contain a clear JSON response in the body as well as the Retry-After: Response Header.

RateLimit-Req10s-Limit:100
RateLimit-Req60s-Limit:500