Return

WTF: The API
A nice API
this is not designed for the
feint of heart I think.



Read this first

This doc describes the WTF API. Ordinarilly this is all hidden behind the widget, but you inpatient few who want to roll your own integrations for a platform before we support out of the box, we are describing here.


API Endpoint

https://whatthefaq.herokuapp.com/api

/node/get

This accepts an API-key, domain, and page (node) and returns that pages content and widget-specific settings.

/node/get?apiKey=my_api_key&domain=my_domain&node=/home

Response:

[
  {
    "_id": "57c69d9dd7625103000e1e1e",
    "propdomain": "www.whatthefaq.io",
    "nodes": [
      {
        "url": "\/",
        "content": " <-- HTML Formatted Content -->",
        "createDate": "2016-08-31T09:04:50.305Z",
        "_id": "57c69db2d7625103000e1e1f",
        "stats": {
          <-- Various stats -->
        }
      }
    ],
    "widget": {
      "overlay": "0",
      "color": "#3D3D3D",
      "placement": "bottom_left",
      "type": "\ue801"
    }
  }
]

/node/getAll

This accepts an API-key & domain and will return an array of all provisioned pages.

/node/getAll?apiKey=my_api_key&domain=my_domain

Response:

{
  "_id": "57c69d9dd7625103000e1e1e",
  "updated_at": "2017-02-14T00:30:16.609Z",
  "propdomain": "www.whatthefaq.io",
  "nodes": [
    {
      "url": "/main page",
      "content": "<-- HTML Content -->"
    },{
      "url": "/shoes",
      "content": "<-- HTML Content -->"
    },
    .
    .
    .
    .

    {
      "url": "/socks",
      "content": "<-- HTML Content -->"
    }
  ]
}

/node/hit

This analytics API call records a pageview. Its designed to be triggered each time the page/screen is opened (not the widget itself). It accepts an API-key, domain, and page (node) and returns "1" as a succesfull acknowledgement.

/node/hit?apiKey=my_api_key&domain=my_domain&node=/home


/node/open

This analytics API call records when a user clicks on the widget. It accepts an API-key, domain, and page (node) and returns "1" as a succesfull acknowledgement.

node/open?apiKey=my_api_key&domain=my_domain&node=/home


/node/initChat

Some clients with custom integrations utilise live chat within their custom widget, so a user instead of leaving a message can talk to customer care. This analytics API call records when when a user clicks on the live chat icon. It accepts an API-key, domain, and page (node) and returns "1" as a succesfull acknowledgement.

node/initChat?apiKey=my_api_key&domain=my_domain&node=/home


©2016 - WTF Inc.