Introduction
API Endpoint
https://api.reviewqueue.net/v1
Welcome to the Review Queue API! You can use our API to access Review API endpoints, which can send and check the status of review requests.
Our APIs are RESTful with responses delivered in JSON and XML format.
PHP library is available on Github
Authentication
To authorize:
# With shell, you can just pass the correct header with each request
curl -X GET "https://api.reviewqueue.net/v1/review-request/view?id=123" \
-u "Basic:<YOUR_API_KEY>" \
-H "Content-Type: application/json"
Make sure to replace
<YOUR_API_KEY>
with your API key.
All the API endpoints require authentication and the respective credentials should be provided via HTTP Basic Auth:
Authorization: Basic
Review Requests
Send Review Request
To create a review request:
curl -X POST "https://api.reviewqueue.net/v1/review-request/create" \
-H "Content-Type: application/json" \
-u "Basic:<YOUR_API_KEY>" \
-d '{"phone_number":"+18888888888"}'
The above command returns JSON structured like this:
[
{
"id": 1,
"phone_number": "+18888888888",
"status": "sent",
"date_sent": "2017-07-25 13:06:45"
}
]
This endpoint creates a new review request.
HTTP Request
POST https://api.reviewqueue.net/v1/review-request/create
Post Parameters
Parameter | Description |
---|---|
phone_number | Must be in format +18888888888 |
Get Review Request Status
To retrieve a review request:
curl -X GET "https://api.reviewqueue.net/v1/review-request/view?id=123" \
-H "Content-Type: application/json" \
-u "Basic:<YOUR_API_KEY>"
The above command returns JSON structured like this:
[
{
"id": 123,
"phone_number": "+18888888888",
"status": "sent",
"date_sent": "2017-07-25 13:06:45"
}
]
This endpoint retrieves a specific review request.
HTTP Request
GET https://api.reviewqueue.net/review-request/view?id=<ID>
URL Parameters
Parameter | Description |
---|---|
id | The ID of the review request to retrieve |
Reviews
Get Reviews
To retrieve reviews:
curl -X GET "https://api.reviewqueue.net/v1/reviews?page=1" \
-H "Content-Type: application/json" \
-u "Basic:<YOUR_API_KEY>"
<?php
$reviewQueueApi = new ReviewQueueV1('<YOUR_API_KEY>');
// Send a review request
try {
$reviewRequestAPI = $reviewQueueApi->reviewRequest();
$response = $reviewRequestAPI->create('+18888888888');
print_r($response);
} catch (Exception $e) {
die($e->getMessage());
}
?>
The above command returns JSON structured like this:
{
"items": [
{
"id": 2,
"company_id": 1,
"name": "John Doe",
"email": "johndoe@example.com",
"feedback": "The service could have been better",
"rating": "2.00",
"date": "2017-07-29 22:26:01"
},
{
"id": 1,
"company_id": 1,
"name": "Jane Doe",
"email": "janedoe@example.com",
"feedback": "Great Service!",
"rating": "5.00",
"date": "2017-07-29 22:26:01"
}
],
"_links": {
"self": {
"href": "https://api.reviewqueue.net/v1/reviews/index?page=1"
}
},
"_meta": {
"totalCount": 2,
"pageCount": 1,
"currentPage": 1,
"perPage": 20
}
}
This endpoint retrieves reviews. Only 20 are retrieved at a time.
HTTP Request
GET https://api.reviewqueue.net/reviews?page=1
Parameter | Description |
---|---|
page | (Optional) The page number |
Rate Limiting
Get Rate Limit
To retrieve rate limits:
curl -X GET "https://api.reviewqueue.net/v1/review-request/view?id=123" \
-H "Content-Type: application/json" \
-u "Basic:<YOUR_API_KEY>" -i
<?php
$reviewQueueApi = new ReviewQueueV1('<YOUR_API_KEY>');
try {
$firstPageOfReviews = $reviewsAPI->getAll();
// Page meta
$currentPage = $reviewsAPI->meta->currentPage;
$totalCount = $reviewsAPI->meta->totalCount;
$itemsPerPage = $reviewsAPI->meta->perPage;
$pageCount = $reviewsAPI->meta->pageCount;
// Get next 20 results
if($pageCount > 1){
$secondPageOfReviews = $reviewsAPI->getAll(2);
}
} catch (Exception $e) {
die($e->getMessage());
}
?>
The above command returns rate limit information in the headers
HTTP/1.1 200 OK
Date: Wed, 26 Jul 2017 19:26:05 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.21
X-Rate-Limit-Limit: 100
X-Rate-Limit-Remaining: 99
X-Rate-Limit-Reset: 0
Content-Length: 90
Content-Type: application/json; charset=UTF-8
More Coming Soon
Rate limit information is returned in the response headers
Name | Description |
---|---|
X-Rate-Limit-Limit | The maximum number of requests allowed with a time period. |
X-Rate-Limit-Remaining | The number of remaining requests in the current time period. |
X-Rate-Limit-Reset | The number of seconds to wait in order to get the maximum number of allowed requests. |
Errors
The Review Queue API uses the following error codes:
Error Code | Description | Meaning |
---|---|---|
400 | Bad Request | Missing or invalid request parameters. |
401 | Unauthorized | Authentication failed. |
403 | Forbidden | The authenticated user is not allowed to access the specified API endpoint. |
404 | Not Found | The requested resource does not exist. |
405 | Method Not Allowed | Method not allowed. Please check the Allow header for the allowed HTTP. |
422 | Data validation failed | Please check the response body for detailed error messages. |
429 | Too many requests | The request was rejected due to rate limiting. |
500 | Internal Server Error | We had a problem with our server. Try again later. |
503 | Service Unavailable | We're temporarily offline for maintenance. Please try again later. |