To request page data, use this code:
curl -X GET \
'https://greet.chat/api/v1/page/xxxxxxxxxx?period=week' \
-H 'Authorization: Bearer xxxxxxxxxx' \
-H 'Cache-Control: no-cache' \
-H 'User: xxxxxxxxxx'
require 'uri'
require 'net/http'
url = URI("https://greet.chat/api/v1/page/xxxxxxxxxx?period=week")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["User"] = 'xxxxxxxxxx'
request["Authorization"] = 'Bearer xxxxxxxxxx'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://greet.chat/api/v1/page/xxxxxxxxxx"
querystring = {"period":"week"}
headers = {
'User': "xxxxxxxxxx",
'Authorization': "Bearer xxxxxxxxxx",
'Cache-Control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
$request = new HttpRequest();
$request->setUrl('https://greet.chat/api/v1/page/xxxxxxxxxx');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'period' => 'week'
));
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Bearer xxxxxxxxxx',
'User' => 'xxxxxxxxxx'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
var request = require("request");
var options = { method: 'GET',
url: 'https://greet.chat/api/v1/page/xxxxxxxxxx',
qs: { period: 'week' },
headers:
'Cache-Control': 'no-cache',
Authorization: 'Bearer xxxxxxxxxx',
User: 'xxxxxxxxxx' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
The above command returns JSON structured like this:
{
"total_questions": {
"total": 58,
"per_post": 3.1,
"title": "Total Customer Questions",
"desc": "Customer Questions"
},
"team_questions": {
"total": 0,
"per_post": 0,
"title": "Customer Questions Answered",
"desc": "Team Responses"
},
"open_questions": {
"total": 58,
"per_post": 3.1,
"title": "Open Customer Questions",
"desc": "Customer Care Needed"
},
"mentions": {
"total": 21,
"per_post": 1.1,
"title": "Total Mentions",
"desc": "Public Callouts"
},
"tags": {
"total": 11,
"per_post": 0.6,
"title": "Friend Tags",
"desc": "Friend Tags"
},
"long_message": {
"total": 0,
"per_post": 0,
"title": "Long Messages",
"desc": "240 Characters+ Messages"
},
"love": {
"total": 28,
"per_post": 1.5,
"title": "Brand Love",
"desc": "Public Embrace"
},
"disappointment": {
"total": 12,
"per_post": 0.6,
"title": "Toxic Messages",
"desc": "Product/Service Disappointment"
},
"domain_block": {
"total": 0,
"per_post": 0,
"title": "Spam",
"desc": "3rd Party Links"
}
}