Get a list of "tags" for each chatbot and the prompt needed to process the tag
From any HTTP sender GET with orgID and chatbotID as query parameters;
curl http://127.0.0.1:5001/botco-dynamic-data/us-central1/getPrompts?orgID=2&chatbotID=11478 \
-X GET -H "Content-Type: application/json" \
curl https://us-central1-botco-dynamic-data.cloudfunctions.net/getPrompts?orgID=2&chatbotID=11478 \
-X GET -H "Content-Type: application/json" \
[
{
name: "Topics",
prompt: "this is the prompt for LLM for Topics",
index: 0, // order on contact list
showOnList: true,
showOnContact: true,
},
{
name: "Sentiment",
prompt: "this is the prompt for LLM for Sentiment",
index: 1, // order on contact list
showOnList: true,
showOnContact: true
}
]
From any HTTP sender GET with orgID and chatbotID as query parameters;
curl http://127.0.0.1:5001/botco-dynamic-data/us-central1/getTagFilters?orgID=2&chatbotID=11478 \
-X GET -H "Content-Type: application/json" \
curl https://us-central1-botco-dynamic-data.cloudfunctions.net/getTagFilters?orgID=2&chatbotID=11478 \
-X GET -H "Content-Type: application/json" \
[
{
name: "Topics",
values: ["Topic 1", "Topic 2", "Topic 3"],
},
{
name: "Sentiment",
values: ["Sentiment 1", "Sentiment 2", "Sentiment 3"],
}
]
Hiding a metric from the dashboard for a particular chatbot
From any HTTP sender GET with orgID, chatbotID, env, metric as query parameters;
curl http://127.0.0.1:5001/botco-dynamic-data/us-central1/dashboardSettings?orgID=2&chatbotID=11478&env=dev \
-X GET -H "Content-Type: application/json" \
curl https://us-central1-botco-dynamic-data.cloudfunctions.net/dashboardSettings?orgID=2&chatbotID=11478&env=dev \
-X GET -H "Content-Type: application/json" \
From any HTTP sender POST with orgID, chatbotID, env, metric as BODY;
curl http://127.0.0.1:5001/botco-dynamic-data/us-central1/hideMetric \
-X POST -H "Content-Type: application/json" \
-d '{"orgID": "dfsdfsd", "chatbotID": "343", "env": "dev", "metric": "LiveChat"'
curl https://us-central1-botco-dynamic-data.cloudfunctions.net/hideMetric \
-X POST -H "Content-Type: application/json" \
-d '{"orgID": "dfsdfsd", "chatbotID": "343", "env": "dev", "metric": "LiveChat"'
Everything you need to build integrations into your projects
From any HTTP sender POST with apikey parameter This firebase function, so production URL will change. This is local testing version
curl http://127.0.0.1:5001/botco-dynamic-data/us-central1/postData?apiKey=key&instanceID=default \
-X POST -H "Content-Type: application/json" \
-d '{"contactID": "dfsdfsd", "integrationID": "leadFlow", "requestID": "342342", "data": {"email": "[email protected]", "name": "Wes Anderson"}}'
curl https://us-central1-botco-dynamic-data.cloudfunctions.net/postData?apiKey=key&instanceID=default \
-X POST -H "Content-Type: application/json" \
-d '{"contactID": "steve", "integrationID": "leads", "requestID": "steve32423", "data": {"email": "[email protected]", "name": "Steve Anderson"}}'
This is used to fetch the organization that is used for this integration
If a given org has more than once instance (chatbot), you can specify an optional instanceID, most likely the deployment ID. This defaults to "default" if not specified
This is the name of the integration. This is used to fetch the integration settings. This is most likely the name of the Data Submit card. Each integration can have many "integration points".
- a single CRM
- a single Email
- many CRMs
- many Emails
- a combination of CRM and Emails
Is unique to the person. A contact record will be created if it doesn't exist. If a contact exists with the same ID, it will be overwritten and merged with existing data. Newer data taking precedence.
This is unique to the request. If the requestID already exists, new contact will NOT be created or updated. New emails WILL NOT be sent. New POSTs to CRM, Zapier, Syncari, will NOT be processed. If you wish to send a new request for the same contact, you will need a unique requestID. This ensures that we do not send duplicate records
Under /apikeys
Add a document with the ID of the actual apikey and a field for orgID
that matches the ID used in the orgs
collection described below
/apikeys/api8372384723874
{ orgID: "akua" }
Under /orgs/akua
(must match orgID)
Create a new collection called "integrations"
Under orgs/akua/integrations
Create a new document called whatever you want for IntegrationID in the curl example above. In our case, leads
So in orgs/akua/integrations/leads
add data for type.
This isn't really used yet
table is not needed since contacts is the default
{
type: "crm",
table: "contacts"
}
Under /orgs/akua/
Create a new collection called providers
Create a new document with ID of "zapier" and data
{ type: "third-party"}
Under orgs/akua/integrations/{integrationID}
Create a new collection called "points"
Create a new document with an ID of your choosing
{
providerID: "syncari",
webhookID: "prod-232-send-data" // only for syncari points
}
IntegrationID must match integration created above.
ProviderID must match provider created above.
a template
field is needed
addresses
array is needed
If you want to use handlebars syntax in the message, subject or in the addresses, you can use {{attribute}}
{
addresses: ["[email protected]", "{{email}}"],
subject: "This can have attributes too {{subject}}",
template: "Message sent with handlebars syntax {{first_name}}"
}
a mapping
field is optional. Otherwise all data is set to integration unchanged.
This will take a first_name
attribute in the payload and convert it to FirstName
field for CRM export
| Note: Contacts table will NOT be converted, but shows raw data instead This might change in the future if needed
Your best bet is probably to just skip mappings field
{
type: "crm"
providerID: "zapier"
mapping: {
FirstName: "{{first_name}}"
}
}
Needs to have API_TOKEN and API_USER environment variables
Syncari providers require a webhookID field in the integration point setup. See example above.
This can be any string but it must match in the Syncari setup for webhookID synapse
https://firestore.googleapis.com/v1/projects/botco-dynamic-data/databases/(default)/documents
plus the path to your data
e.g.
/org/akua/subject/Math/lesson/1/level/1/question/1
This returns data in the format...
{
"name": "projects/botco-dynamic-data/databases/(default)/documents/org/akua/subject/Math/lesson/1/level/1/question/1",
"fields": {
"Answer3Block": {
"stringValue": ""
},
"Answer4ImageURL": {
"stringValue": ""
},
"Answer3ImageURL": {
"stringValue": ""
},
"Question": {
"stringValue": "5 Beach Towels"
},
"Answer2": {
"stringValue": ""
},
etc..
NOTE: The data must be "open" to read or you will need to deal with authentication