Ingest
Ingest From API
Ingest
Ingest From API
How to ingest data using the API
Ingest
You can ingest data into a source with a few lines of code.
Simply fill in the <>
with your specific entries:
const data = [
{<key>:<value>}
];
fetch('https://api.airfold.co/v1/events/<source_name>', {
method: 'POST',
headers: {
Authorization: <token>,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
Here are some examples in practice:
const data = [
{
"ID":"ed9f19aa-8986-4d9a-8261-3d65bb331944",
"Transcript":"Sales Rep: Hi there! Thank you for taking the time to speak with me today. This is Jake from QuickCart. How are you doing? Client: Hi Jake, I'm doing well, thanks! Just busy with the online shop."
},
{
"ID":"bf9d1771-30b1-4817-8385-c13711342405",
"Transcript":"ales Rep: Good morning! Thank you for taking the time to speak with me today. My name is Alex from QuickCart. How are you doing? Client: Hi Alex, I’m doing well, thanks. Just busy trying to figure out the best way to improve my online store."
}
];
fetch('https://api.airfold.co/v1/events/sales_calls_csv', {
method: 'POST',
headers: {
Authorization: aft_3paEjG6XBXA0examplekn6auth7tokenKPHSymSP1E,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
Get Data Schema
You may also get the data source schema with the following API call:
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.airfold.co/v1/events/<source_name>', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
On this page