Hellopeter

API Documentation

Complete reference for the Hellopeter Business API v5.

Back to Integrations

Introduction

The Hellopeter Business API is structured using standard HTTP RESTful principles based on predictable resource-oriented URLs. It accepts form-encoded request payloads and returns JSON-encoded responses, uses standard HTTP response codes and verbs.

The API uses standard error codes consistent with REST so that you can programmatically react to our API responses. For example, if you make a call to the /reviews resource and pass in a permalink, when you receive an HTTP status code of 404, it means that either the permalink is incorrect OR that the review was subsequently removed from our platform.

Over time, we will make more resources available via our API making it even easier for your business to fully integrate our platform into your CRM.

Our intention is to make the full review management process that you're familiar with in our Business Portal, as accessible from our API.

Base URL
https://api.hellopeter.com/v5/api

Our API is only accessible to businesses who have a valid API Key. Generate one from the Integrations page.

Authentication

Every API call requires authentication using a unique API Key that you can manage from the Hellopeter Business Portal. The very first time you use the API, you would need to generate a key. To do this, once logged into your business profile, navigate to the Integrations → API menu-item and click on the GENERATE NEW KEY button.

If you already have an API Key and you need to change it, simply click the REGENERATE KEY button. This is especially useful if you know or suspect that your API Key has been compromised.

Where to pass the API Key

The API Key needs to be set as an HTTP Header using the apiKey field.

Example using the apiKey field
curl --location --request GET 'https://api.hellopeter.com/v5/api/reviews' \
  --header 'Accept: application/vnd.api+json' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: 12345'

Pagination

Pagination meta data is available on successful GET requests to list resources i.e when making a successful GET request to a resource without passing a unique identifier to the URL as a parameter and this will return two objects:

  1. meta - the meta data related to pagination
  2. data - an array of objects based on the resource requested

The meta data contains all the values commonly associated with RESTful pagination so that you can programmatically navigate the entire list of the returned resource objects.

Meta Data Fields

FieldDescription
totalRecordsThe total number of records found in the requested resource given the supplied parameters
perPageThe maximum number of returned objects for the requested resource - default value is 10
previousPageThe absolute URL to get the previous page of results
currentAn integer representing the current page number or position in the pagination list
nextPageThe absolute URL to get the next page of results
lastPageAn integer representing the last page number or position in the pagination list
fromAn integer representing the start position of the entry from the list of results
toAn integer representing the end position of the entry the list of results
Example meta response object
{
  "data": [],
  "meta": {
    "totalRecords": "12",
    "perPage": "10",
    "previousPage": "null",
    "current": "1",
    "nextPage": "https://api.hellopeter.com/v5/api/reviews?page=2",
    "lastPage": "2",
    "from": "1",
    "to": "10"
  }
}

Reviews

The reviews resource only allows GET requests to be performed. One can perform an HTTP GET request to retrieve a paginated list of reviews or one could request the detail for a single review.

When requesting to get the detail for a single review, you have to pass in the review permalink as a parameter to the reviews resource.

Please note

Review credits are consumed with every review that is successfully retrieved via the API. A review credit will not be consumed when one has already been used for the review OR when the review is a conversion from a review invite.

Endpoints

GET
/reviews

Retrieve a paginated list of reviews

GET
/reviews/{permalink}

Retrieve a single review by its permalink

Example requesting a single review
curl --location --request GET 'https://api.hellopeter.com/v5/api/reviews/an-example-review-56789' \
  --header 'Accept: application/vnd.api+json' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: 12345'

Parameter Fields

The API provides the option to add filters to the reviews list. You have the option to pass any or all of the following filters as parameters to the /reviews resource. Should you choose not to pass any filters, all reviews will be returned.

FieldDescription
statusThe status of the review, which could be one of the following - unreplied, unread, unreplied_comment. Pass the values comma separated if filtering by multiple statuses
channelThe Channel where the review was published, which could be one of the following - HELLOPETER, FACEBOOK, GOOGLE. Pass the values comma separated if filtering by multiple channels
startAdd a starting point to return all reviews created from this date. Valid format is - YYYY-MM-DD
endAdd an ending point to return all reviews created to this date. Valid format is - YYYY-MM-DD
pageThe specific page number of the pagination

Fetching a single review will have some additional fields compared to fetching a list of reviews. When fetching a single review, you would also get detail for internal notes, branches, tags and the replies associated to the review. You can request these fields on the list endpoint by passing the fields parameter. Possible values are: replies, notes, tags, branches.

Response Fields

FieldDescription
permalinkThe unique permalink used to identify the review
userThe Display name of the reviewer
ratingThe Star Rating of the review
npsThe Net Promoter Score category
npsScoreAn integer value ranging from 0 to 10 for the Net Promoter Score
channelThe Channel medium of which the review was published - either HELLOPETER, FACEBOOK or GOOGLE
statusThe status of the review which could be one of the following - UNREAD, REPLIED, UNREPLIED, UNREPLIED_COMMENT, REPORTED or ERROR
titleThe title of the Review
bodyThe body of the Review
responseReceivedA boolean value indicating whether or not a response was received
responseTimestampA timestamp of the very first reply to this review
timeToRespondAn integer representing the number of minutes that has lapsed between when the review was published and when the first reply was written by the business
createdAtThe timestamp for when the review was created
imagesAn array of URLs containing any uploaded images as part of the review
customerDataCustomer Data, this object will contain the name, phone, email, ID Number and reference number of the customer
notesAny internal notes left by business users (single review only)
repliesAll replies, both from the consumer and the business, belonging to the review (single review only)
branchesThe branches associated with the review (single review only)
tagsAll tags added to the review (single review only)
Example single review response
{
  "permalink": "3-star-baddf43947cac263f2ea4923135fb554ba648880-3098948",
  "user": "Batman G",
  "rating": "3",
  "nps": "null",
  "npsScore": "null",
  "channel": "HELLOPETER",
  "status": "REPLIED",
  "title": "3 star",
  "body": "3 star",
  "responseReceived": "true",
  "responseTimestamp": "2021-12-09 10:06:29",
  "timeToRespond": "2",
  "created_at": "2021-12-09T08:03:50.0000002",
  "images": [],
  "customerData": {
    "name": "Batman G",
    "phone": "0823333333",
    "email": "bat@man.com",
    "idNumber": "8001232323232",
    "refNumber": "Not provided",
    "error": "null"
  },
  "notes": [],
  "replies": [
    {
      "private": "false",
      "created_at": "2021-12-09 10:06:29",
      "edited_at": "2021-12-09 10:06:29",
      "id": "12345",
      "body": "this is a another private reply",
      "user_id": "12345",
      "first_name": "Business-API",
      "last_name": "Plug nation",
      "from_business": "true"
    }
  ],
  "branches": [],
  "tags": []
}

Replies

The replies resource is a sub-resource of Reviews i.e to perform any HTTP action relating to replies, you would need to supply the review permalink as a parameter for the reply intent - whether that is to create, update or delete a reply.

When requesting to get the detail for a single review, you have to pass in the review permalink as a parameter to the reviews resource.

Endpoints

GET
/reviews/{permalink}/replies

Get all replies for a single review

POST
/reviews/{permalink}/replies

Create a new reply on a review

PUT
/reviews/{permalink}/replies/{replyId}

Edit an existing reply

DELETE
/reviews/{permalink}/replies/{replyId}

Delete a reply

Quick Reference

How to get replies for a single review?

Pass the replies resource after the permalink of the review.

How to create a Reply?

Perform an HTTP POST to the /replies resource and pass a payload that contains a 'reply' object, which in turn has a boolean field to mark it is 'private' and a 'body' field with the reply content.

How to edit a Reply?

Perform an HTTP PUT to the /replies/<replyId> resource and pass a payload that contains a 'reply' object, which in turn has a boolean field to mark it is 'private' and a 'body' field with the reply content.

How to delete a Reply?

Perform an HTTP DELETE to the /replies/<replyId> resource. No payload is required.

Request Body (POST / PUT)

FieldDescription
reply.bodyThe content of the reply
reply.privateA boolean indicating whether the reply is public or private

Response Fields

FieldDescription
idThe ID of the reply
bodyThe body of the reply
privateA boolean indicating whether the reply is public or private
user_idThe user ID of the user who created the reply
first_nameThe first name of the user who created the reply
last_nameThe last name of the user who created the reply
from_businessA boolean indicating whether the reply was from your business OR from the reviewer
created_atA timestamp showing when the reply was created
edited_atA timestamp showing when the reply was last edited

Examples

Fetching replies
curl --location --request GET '/reviews/an-example-review-56789/replies' \
  --header 'Accept: application/vnd.api+json' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: 12345'
Creating a reply
curl --location --request POST '/reviews/fwefwe-3098949/replies' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: 12345' \
  --data-raw '{"reply": { "body": "this is a test public reply", "private" : false }}'
Editing a reply
curl --location --request PUT '/reviews/fwefwe-3098949/replies/12345' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: 12345' \
  --data-raw '{"reply": { "body": "this is a test public reply", "private" : false }}'
Deleting a reply
curl --location --request DELETE '/reviews/fwefwe-3098949/replies/12345' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: 12345'