NPS-Hero Public API Documentation

Welcome to the NPS-Hero Public API documentation. This API provides access to key endpoints that allow you to seamlessly integrate NPS feedback collection into your applications. Whether you are an indie hacker, a startup, or a small business, NPS-Hero simplifies the process of collecting, managing, and analyzing Net Promoter Score (NPS) feedback.

NPM Package

Instead of using the API directly, you can also use our NPM package or Javascript Library to integrate NPS-Hero into your application.

Key Features

Easy integration: Use our API to connect your feedback collection system in minutes.

Usage and Fair Use Policy

This API is designed to be used under NPS-Hero’s Fair Use Policy. By using this API, you agree to adhere to the limits and guidelines. Abusive or excessive use may result in limitations or suspension of access.

Support

For more detailed guidance on how to get started with our API, visit our Developer Docs or contact support at support@nps-hero.com.

Copyright

© 2024 NPS-Hero. All rights reserved. This API and its documentation are the property of NPS-Hero. Unauthorized use is prohibited. Visit www.nps-hero.com for more details.

Servers

Endpoints

Parameters

NameDescription
npsHeroQuestionnaireId *
string
(path)

The questionnaire ID

Responses

CodeDescription
204

No Content (CORS preflight successful)

Headers:

NameDescriptionType
Access-Control-Allow-Origin

Allowed origins

string
Access-Control-Allow-Methods

Allowed methods

string
Access-Control-Allow-Headers

Allowed headers

string
Access-Control-Max-Age

Cache duration for preflight response

integer
Example: 86400

Parameters

NameDescription
npsHeroQuestionnaireId *
string
(path)

The ID of the questionnaire

Request body

{
  customOrUserIdentifier: string,
  reference: string
}

Responses

CodeDescription
200

A successful response

Media type
Controls Accept header.
{
  id: string,
  customerid: string,
  message: string,
  successmessage: string,
  placeholdertext: string,
  feedbackheader: string,
  active: true,
  scoreneutral: 0,
  scorepromoter: 0,
  emailsubject: string,
  emailbody: string,
  logourl: string,
  name: string,
  email_active: true,
  emailopener: string,
  imageurl: string
}

Parameters

NameDescription
npsHeroQuestionnaireId *
string
(path)

The questionnaire ID

Responses

CodeDescription
204

No Content (CORS preflight successful)

Headers:

NameDescriptionType
Access-Control-Allow-Origin

Allowed origins

string
Access-Control-Allow-Methods

Allowed methods

string
Access-Control-Allow-Headers

Allowed headers

string
Access-Control-Max-Age

Cache duration for preflight response

integer
Example: 86400

This endpoint submits feedback for a specific questionnaire and customer. It also checks if the feedback has been previously submitted by the customOrUserIdentifier and reference.

Parameters

NameDescription
npsHeroQuestionnaireId *
string
(path)

The ID of the questionnaire

npsHeroCustomerId *
string
(path)

The ID of the customer

Request body

{
  customoruseridentifier: string,
  reference: string,
  feedback: string,
  vote: 0,
  dismissed: true
}

Responses

CodeDescription
200

A successful response containing submission details

Media type
Controls Accept header.
{
  id: 3fa85f64-5717-4562-b3fc-2c963f66afa6,
  customerid: 3fa85f64-5717-4562-b3fc-2c963f66afa6,
  questionnaireid: 3fa85f64-5717-4562-b3fc-2c963f66afa6,
  customoruseridentifier: string,
  referenceid: string,
  dismissed: true,
  created: 2024-09-25T12:13:51.770Z,
  vote: 0,
  feedback: string
}

Parameters

NameDescription
npsHeroCustomerId *
string
(path)

The npsHeroCustomerId

Responses

CodeDescription
204

No Content (CORS preflight successful)

Headers:

NameDescriptionType
Access-Control-Allow-Origin

Allowed origins

string
Access-Control-Allow-Methods

Allowed methods

string
Access-Control-Allow-Headers

Allowed headers

string
Access-Control-Max-Age

Cache duration for preflight response

integer
Example: 86400

Parameters

NameDescription
npsHeroCustomerId *
string
(path)

The npsHeroCustomerId of the customer receiving the webhook

Request body

{
  email: string,
  questionnaireid: string,
  reference: string,
  customIdentifier: string
}

Responses

CodeDescription
200

A successful response indicating the webhook was processed

Media type
Controls Accept header.
{
  message: string
}
400

Invalid request - missing required fields

Media type
{
  error: string
}