Skip Navigation
Expand
Recording answer clickthru events with Knowledge Advanced Search REST API
Answer ID 10316   |   Last Review Date 07/24/2019

Why do my answer views from search results not show up in analytics when using the Knowledge Advanced Search REST API?
 

Environment:

Oracle Service Cloud Knowledge Advanced
Search REST API

Issue:

The Knowledge Advanced integration I am building with the Search REST API needs to record clickthru rate for analytics reporting such as Advanced Searches Summary -- Knowledge Advanced Advanced Searches Summary.  The integration performs authentication and session initialization to retrieve an integrationUserToken and session respectively.  The /question endpoint is then used for a search and an answer from the results is viewed, but no event has been recorded in the okcs_stg_clickthru table.

Resolution:

There is an endpoint for the Search REST API that is available for use to populate answer clickthru for results from the /question endpoint, this is the /answer endpoint. There are other endpoints to view answers and this can cause the integration to not fully record details for the session.  Conducting a full session by authenticating, creating a session, asking a question and then recording the answer clickthru will enable your site to correctly track and tune searches.
The full request to the /answer endpoint must contain:
  • Headers
    • accept: application/json
    • content-type: application/json
    • kmauthtoken:{"siteName":"<sitename>","interfaceId":"1","localeId":"en-US","knowledgeInteractionId":"<value for session_ref>","integrationUserToken":"<token>"}
  • Body
    • {"session":"<session from initial endpoint>","transactionId":<integer>,"locale":"en-US","resultLocales":"en-US"}
  • Endpoint: https://<vhost for site>-qp.custhelp.com/srt/api/latest/search/answer?priorTransactionId=0&answerId=<answer from results>&trackClickFlag=true
    • Please note this answer id is the search answer id and not the IM answer id, it is returned in the results from the /question endpoint as the answerId key, not the globalAnswerId key.
Notes:
For further information on the Search REST API