Last updated
Last updated
Gleen provides an API that allows developers to engage with their application (knowledgebase hosted on Gleen). To obtain your API key, visit your account at and navigate to the bottom of the page.
Good to know: Please note that you need the api key only if you are try to use curl request to call Gleen AI services from your backend. For front end integration take a look at Website SDK
Access token can be created in developer api section
Important : API keys are visible once. If api key is lost then you need to create a new one.
A user query is the question a customer enters and the developer sends to Gleen AI. A Gleen AI Response is what Gleen AI returns after a user query is submitted.
A thread is all user queries from a specific user and all associated Gleen AI responses. All user queries and Gleen AI responses that belong to a thread will have the same unique thread_id associated to them.
For example, the user queries and Gleen AI responses below are all one thread:
user: Hello
Gleen AI: How can I help you?
user: What is Gleen AI?
Gleen AI: A customer success product
How does thread_id work?
Gleen AI api has an optional parameter thread_id. When a given user ask first question then developer needs to pass empty or simple don't pass thread_id. In this case gleen ai return the response and generate the thread_id
For the next follow up conversation, developers need to pass the thread_id. By passing thread_id, developers intent to convey that this is a follow up message rather a new conversation
Gleen AI will return the thread_id in every response. If it's a new conversation then new thread_id is returned. If it is a follow up conversation then Gleen AI return the same thread_id
Using send message api
POST
https://api.gleen.ai/api/v1/send_message
send a query to gleen ai endpoint
Making requests VIA CURL
You can paste the command below into your terminal to run your first API request. Make sure to replace $GLEENAI_API_KEY
with your secret API key.
You should get a response back that resembles the following:
Making requests via python sdk
python installation
Setting up GLEENAI_API_KEY
Sending requests
Sample response
Example - 1
response is
GLEENAI_API_KEY*
String
auth key for your gleen api
query_text*
string
query text sent to gleen ai for the response generation
thread_id
string
thread_id for the follow up conversation