• curl
  • Ruby
  • Python
  • PHP
  • Node

Informations

Welcome to the Greet API! You can use our API to access Greet API endpoints, which can get information on data to your page nad individual posts in our database.

We have language bindings in curl, Ruby, PHP and Node! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

This API documentation page was created by Greet to customize and integrate with your own platform.

Token will expire in 30 days.

Get Started

Page

GET Page Data

Endpoint to retrieve all page related data.

HTTP Request

GET https://greet.chat/api/v1/page/:page_id

Query Parameters

Parameter Default Description
page_id false Your page id is required to get data for your page.
period true Period is optional and set by a default to 1 week since now. Can be set to month, two_weeks, week, today

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"
                    }
                  }
                
              

Post

GET Post Data

Endpoint to get data for specific posts.

HTTP Request

GET https://greet.chat/api/v1/post/:page_id

Query Parameters

Parameter Default Description
page_id false Your page id is required to get data for your page.
period true Period is optional and set by a default to 1 week since now. Can be set to month, two_weeks, week, today
post_ids true Optional, by default are posts set based on selected period. Can be set as array.

To request post data, use this code:

                
                  curl -X GET \
                    'https://greet.chat/api/v1/post/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/post/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/post/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/post/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/post/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": 0,
                          "title": "Total Customer Questions",
                          "desc": "Customer Questions"
                      },
                      "team_questions": {
                          "total": 0,
                          "title": "Customer Questions Answered",
                          "desc": "Team Responses"
                      },
                      "open_questions": {
                          "total": 0,
                          "title": "Open Customer Questions",
                          "desc": "Customer Care Needed"
                      },
                      "mentions": {
                          "total": 0,
                          "title": "Total Mentions",
                          "desc": "Public Callouts"
                      },
                      "tags": {
                          "total": 0,
                          "title": "Friend Tags",
                          "desc": "Friend Tags"
                      },
                      "long_message": {
                          "total": 0,
                          "title": "Long Messages",
                          "desc": "240 Characters+ Messages"
                      },
                      "love": {
                          "total": 0,
                          "title": "Brand Love",
                          "desc": "Public Embrace"
                      },
                      "disappointment": {
                          "total": 0,
                          "title": "Toxic Messages",
                          "desc": "Product/Service Disappointment"
                      },
                      "domain_block": {
                          "total": 0,
                          "title": "Spam",
                          "desc": "3rd Party Links"
                      }
                    }, ...
                  ]
                
              

Responses

Responses:

Every response is returned with error code and message as json.

{"message": "Bad Request!"} or {"message": "Success!"}

Successful request:

Error Code Meaning
200 Success -- Request was successful.
204 No Content -- Request was successful but no data found.

Bad request:

Error Code Meaning
400 Bad Request -- Your request is wrong.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The requested is hidden for administrators only.
404 Not Found -- The request could not be found.
406 Not Acceptable -- You requested a format that isn't json.
429 Too Many Requests -- Slow down!
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.