Article Recommendations

API to get Article Recommendations

JSON Format

Articles are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
article_id number false false the id of article
brand_id number false false the id of the brand_id
html_body string false false the body of the article in HTML
html_url string false false the url of the HTML body
label_names array false false the labels of this article
locale string false false the Help Center locale of the article
score number false false the score of this article against the user enquiry
snippet string false false an excerpt of the article
title string false false the title of the article
url string false false the url of the article

Get Article Recommendations

  • POST /api/v2/answer_bot/answers/articles

Returns Help Center articles based on the user's enquiry.

if locale is sent in the request, it should match the available locales in Guide.

user_segment_ids can be sent in the request to recommend the articles that users in those segments have access to.

Allowed For

  • Authenticated requests

Example Body

{  "enquiry": "Consectetur adipiscing elit",  "labels": [    "magna"  ],  "locale": "en-us",  "reference": "sdk-mobile-uid-customer-id",  "user_segment_ids": [    2345123  ]}

Using curl

curl "https://{subdomain}/api/v2/answer_bot/answers/articles" -X POST -H "Content-Type: application/json" \-u {email_address}:{password} \-d '{"enquiry": "Consectetur adipiscing elit","reference":"sdk-mobile-uid-customer-id","locale":"en-us","labels":["magna"]}'

Example Response

Status 200 OK
{  "articles": [    {      "article_id": 10192,      "brand_id": 10016,      "html_body": "\u003cp\u003eConsectetur adipiscing elit. Quisque sit amet magna id tellus volutpat aliquet et nec lorem. \u003c/p\u003e",      "html_url": "",      "label_names": [        "magna",        "tellus"      ],      "locale": "en-us",      "score": 0.38012391328882644,      "snippet": "Consectetur adipiscing elit...",      "title": "Lorem ipsum",      "url": ""    },    {      "article_id": 10192,      "brand_id": 10016,      "html_body": "\u003cp\u003eCras vehicula ipsum at maximus ullamcorper. Maecenas scelerisque ultricies dignissim.\u003c/p\u003e",      "html_url": "",      "label_names": [        "magna"      ],      "locale": "en-us",      "score": 0.8882646380123913,      "snippet": "Cras vehicula ipsum...",      "title": "Proin sit amet",      "url": ""    }  ],  "auth_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjo0MiwidXNlcl9pZCI6MTAwMDIsInRpY2tldF9pZCI6NSwiYXJ0aWNsZXMiOlsxMDEwMiwxMDE5Ml0sInRva2VuIjpudWxsLCJleHAiOjE1MjA2NjE1MTR9.VzS91dP0cLjXw_3pZd2tcEdru8xoOXQe7ZfqzA9uL3s",  "id": 4,  "interaction_access_token": "GciOiJIUzI1NiJ9eyJ0eXAiOiJKV1QiLCJhb.0aWNsZXMiOlsxMDEwMiwxMDE5Ml0sInRva2VuIjpudWxsLCJleHAiOjE1MjA2NjE1MTR9eyJhY2NvdW50X2lkIjo0MiwidXNlcl9pZCI6MTAwMDIsInRpY2tldF9pZCI6NSwiYXJ.VzS91dP0cLjXw_3pZd2tcEdru8xoOXQe7ZfqzA9uL3s"}