API Documentation
Complete reference for the Hellopeter Business API v5.
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.
https://api.hellopeter.com/v5/apiOur 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.
The API Key needs to be set as an HTTP Header 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:
meta- the meta data related to paginationdata- 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
| Field | Description |
|---|---|
totalRecords | The total number of records found in the requested resource given the supplied parameters |
perPage | The maximum number of returned objects for the requested resource - default value is 10 |
previousPage | The absolute URL to get the previous page of results |
current | An integer representing the current page number or position in the pagination list |
nextPage | The absolute URL to get the next page of results |
lastPage | An integer representing the last page number or position in the pagination list |
from | An integer representing the start position of the entry from the list of results |
to | An integer representing the end position of the entry the list of results |
{
"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
/reviewsRetrieve a paginated list of reviews
/reviews/{permalink}Retrieve a single review by its permalink
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.
| Field | Description |
|---|---|
status | The 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 |
channel | The 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 |
start | Add a starting point to return all reviews created from this date. Valid format is - YYYY-MM-DD |
end | Add an ending point to return all reviews created to this date. Valid format is - YYYY-MM-DD |
page | The 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
| Field | Description |
|---|---|
permalink | The unique permalink used to identify the review |
user | The Display name of the reviewer |
rating | The Star Rating of the review |
nps | The Net Promoter Score category |
npsScore | An integer value ranging from 0 to 10 for the Net Promoter Score |
channel | The Channel medium of which the review was published - either HELLOPETER, FACEBOOK or GOOGLE |
status | The status of the review which could be one of the following - UNREAD, REPLIED, UNREPLIED, UNREPLIED_COMMENT, REPORTED or ERROR |
title | The title of the Review |
body | The body of the Review |
responseReceived | A boolean value indicating whether or not a response was received |
responseTimestamp | A timestamp of the very first reply to this review |
timeToRespond | An 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 |
createdAt | The timestamp for when the review was created |
images | An array of URLs containing any uploaded images as part of the review |
customerData | Customer Data, this object will contain the name, phone, email, ID Number and reference number of the customer |
notes | Any internal notes left by business users (single review only) |
replies | All replies, both from the consumer and the business, belonging to the review (single review only) |
branches | The branches associated with the review (single review only) |
tags | All tags added to the review (single review only) |
{
"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
/reviews/{permalink}/repliesGet all replies for a single review
/reviews/{permalink}/repliesCreate a new reply on a review
/reviews/{permalink}/replies/{replyId}Edit an existing reply
/reviews/{permalink}/replies/{replyId}Delete a reply
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)
| Field | Description |
|---|---|
reply.body | The content of the reply |
reply.private | A boolean indicating whether the reply is public or private |
Response Fields
| Field | Description |
|---|---|
id | The ID of the reply |
body | The body of the reply |
private | A boolean indicating whether the reply is public or private |
user_id | The user ID of the user who created the reply |
first_name | The first name of the user who created the reply |
last_name | The last name of the user who created the reply |
from_business | A boolean indicating whether the reply was from your business OR from the reviewer |
created_at | A timestamp showing when the reply was created |
edited_at | A timestamp showing when the reply was last edited |
Examples
curl --location --request GET '/reviews/an-example-review-56789/replies' \
--header 'Accept: application/vnd.api+json' \
--header 'Content-Type: application/json' \
--header 'apiKey: 12345'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 }}'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 }}'curl --location --request DELETE '/reviews/fwefwe-3098949/replies/12345' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'apiKey: 12345'