Voice API
Click to Call
Samespace has designed a server-side Rest API that will send a Call event to the Samespace dock and dial the number mapped behind a custom entity in Salesforce.
POST URL: https://<cluster_id>.samespace.com/apiv1/make_call
Content-Type: application/json
{
"username":"[email protected]_id",
"number":"448442430000",
"custom":{"name": "Alex", "phone":”+1 646 810 7016”,... },
}
Parameter | Definition |
---|---|
username | It is samespace username. You can keep this as the email ID of the agent to ensure parity between Samespace and Salesforce. |
cluster_id | Region ID where the samespace instance is hosted. |
cloud_id | Unique domain of Samespace |
number | Phone Number that needs to be dialled when clicked on Salesforce custom entity |
custom | Any custom payload that you want to send to samespace dock. |
Authentication
Authentication will happen via the cluster-ID and the username of the agent.
Error Codes
In case the agent is not logged in, the following error code is generated
{
"success": false,
"message": "Cant make call! Not logged In"
}
Campaign Push API - Single Record
Samespace has designed a server-side Rest API that will update a lead in an existing (or new) campaign dial list.
POST URL: https://<cluster_id>.samespace.com/router/api/v2/campaign/add
{
"cloud_id": "leap",
"auth_token": "538d1ae0-3e9f-11ea-9d9c-394a26b437b0",
"campaign": "Campaign_name",
"team_name": "Support team",
"source": "Dial_list",
"number": "919654301006",
"data": { "name": "sumeet", "company": "novanet" }
}
Parameter | Definition |
---|---|
campaign | You can use the existing campaign name or use a new name to create a new campaign |
team_name | Name of the team the campaign is mapped to |
cloud_id | Unique domain of Samespace. |
auth_token | Token generated via Samespace API section. |
cluster_id | Region ID where the samespace instance is hosted |
source | Name of the dial list within the campaign. You can choose to an existing dialist name or create a new. |
number | Phone Number that needs to be dialled when clicked on Salesforce custom entity. |
Authentication
Authentication will happen via the auth_token, cluster_id and cloud_id.
Campaign Push API - Multiple Records
Samespace has designed a server-side Rest API that will update multiple leads in an existing (or new) campaign dial list.
POST URL: https://<cluster_id>.samespace.com/router/api/v2/campaign/add_multiple
{
"cloud_id": "leap",
"auth_token": "538d1ae0-3e9f-11ea-9d9c-394a26b437b0",
"campaign": "campaign_name",
"team_name": "Support team",
"source": "dial_list",
"leads": [
{
"number": "919654301006",
"username": "rishi",
"data": { "name": "sumeet", "company": "novanet" }
},
{
"number": "919812306590",
"username": "siddhant",
"data": { "name": "shailesh", "company": "samespace" }
}
]
}
Parameter | Definition |
---|---|
campaign | You can use the existing campaign name or use a new name to create a new campaign |
team_name | Name of the team the campaign is mapped to |
cloud_id | Unique domain of Samespace. |
auth_token | Token generated via Samespace API section. |
cluster_id | Region ID where the samespace instance is hosted |
source | Name of the dial list within the campaign. You can choose to an existing dialist name or create a new. |
number | Phone Number that needs to be dialled when clicked on Salesforce custom entity. |
Authentication
Authentication will happen via the auth_token, cluster_id and cloud_id.
Reset Token API
You can dynamically fetch the auth token using the reset token API.
POST URL: https://<cluster_id>.samespace.com/router/api/v2/token/reset
{
"cloud_id": "leap",
"auth_token": "538d1ae0-3e9f-11ea-9d9c-394a26b437b0"
}
Authentication
Authentication will happen via the auth_token, cluster_id and cloud_id.
Samespace Live Data
Samespace live data API allows you to fetch the following real-time stats,
Status Type | Stats |
---|---|
Agent | Agent Name, Talking, Chatting, Online with duration |
Team | Team Name, Call Queue Count, Chat Queue Count |
Below is the API JSON,
POST URL: https://<cluster_id>.samespace.com/pulse-api/live
{
"cloud_id": "leap",
"auth_token": "538d1ae0-3e9f-11ea-9d9c-394a26b437b0",
"team_names": ["team_name #1", "team_name #2"]
}