This API returns a contextual reply (robot message) to a user message. You should use this API to deploy a brain to your own system.
bid: The brain ID.
key: The access key for the brain.
uid: The ID you assign to end user.
msg: The message from user.
To obtain the bid and key for a brain,
- Click the brain in the left side bar.
- Click Settings tab.
The bid and key can be found there.
This API returns a JSON string structured as below
The JSON includes only one datum, 'cnt', the content of reply given by the brain. The reason to use JSON for a single datum here is we are extending the API and it will deliver more data in the future. The below is an example of possible JSON with more data.
To display the reply to end users, you need to convert JSON to an object or array (decoding) and then extract the content from the "cnt" data. You may search for the specific method to decode a JSON in your programming language.