Make our agent live
Now that we have a company and an agent, we need to make this agent reachable. To do this, we need to set up a channel. This channel will provide you with a telephone number to contact your agent.
A channel is defined as follows:
- companyId: The company ID you previously stored.
- agentId: The ID of the agent we just created.
- typology: The type of channel we need to setup. We'll use
phone
for this tutorial. - type: The provider of this channel. At the moment, only
reecall
is available for this value. - name: Channel name which will be used on the various interfaces provided.
- cURL
- NodeJS
curl -X POST
-H "Authorization: Bearer <APIKEY>"
-H "Content-Type: application/json"
-d '{"companyId": "XXXX", "agentId": "XXXX", "name": "My First Channel", "typology": "phone", "type": "reecall"}'
{{baseUrl}}/api/channels
const axios = require('axios');
const endpoint = "{{baseUrl}}/api/channels";
const apiKey = "YOUR API KEY";
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
};
const data = {
companyId: "XXXX",
agentId: "XXXX",
typology: "phone",
type: "reecall",
name: "My First Channel"
};
axios.post(endpoint, data, { headers: headers })
.then(response => {
console.log('Status Code:', response.status);
console.log('Response Data:', response.data);
})
.catch(error => {
console.error('Error:', error.response.status);
console.error('Error Data:', error.response.data);
});
{
"id": "ObjectID",
"name": "My First Channel",
"config": {
"phone": "+33XXXXXXXXX",
"phoneNumberId": "ObjectID
},
"type": {},
"typologie": {},
"agentId": "ObjectID",
"partnerId": "ObjectID",
"companyId": "ObjectID",
"updatedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z"
}
If all goes well, you can call the number provided in config.phone
and your agent will answer.
info
As part of the tutorial, the agent will give you feedback on this part of the documentation! It's up to you to respond, but it really helps us to keep improving our documentation.