C-Phrase NLI REST API

Here we overview of the endpoints defined to access a running C-Phrase Natural Language Interface. Let us assume that you are running a C-Phrase NLI on port 9000 of the host with IP www.yourdomain.com. Then the end point www.yourdomain.com:9000/api/cphrase/session would give you a session id from the running C-Phrase NLI. More endpoints are defined below:
Method Endpoint Usage Return Type
GET /api/cphrase/session Gets a new session id. session
GET /api/cphrase?session={int}&question={string} Asks the C-Phrase NLI to answer the given question under the specified session. answer-result or choice-result
GET /api/cphrase?session={int}&choice={int} Chooses the n-th options returned in previous choice-result under given session. answer-result
GET /api/cphrase/completions Gets a list of completions which are intended to help the user type questions. completions
GET /api/cphrase/corpus/question Gets the <question> values in the current .corpus file. demo-query
GET /api/cphrase/corpus/constants Gets the <constants> values in the current .corpus file. demo-query