Voice API

July 3, 2020

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”,... },
}
ParameterDefinition
usernameIt is samespace username. You can keep this as the email ID of the agent to ensure parity between Samespace and Salesforce.
cluster_idRegion ID where the samespace instance is hosted.
cloud_idUnique domain of Samespace
numberPhone Number that needs to be dialled when clicked on Salesforce custom entity
customAny 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" }
}
ParameterDefinition
campaignYou can use the existing campaign name or use a new name to create a new campaign
team_nameName of the team the campaign is mapped to
cloud_idUnique domain of Samespace.
auth_tokenToken generated via Samespace API section.
cluster_idRegion ID where the samespace instance is hosted
sourceName of the dial list within the campaign. You can choose to an existing dialist name or create a new.
numberPhone 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" }
    }
  ]
}
ParameterDefinition
campaignYou can use the existing campaign name or use a new name to create a new campaign
team_nameName of the team the campaign is mapped to
cloud_idUnique domain of Samespace.
auth_tokenToken generated via Samespace API section.
cluster_idRegion ID where the samespace instance is hosted
sourceName of the dial list within the campaign. You can choose to an existing dialist name or create a new.
numberPhone 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 TypeStats
AgentAgent Name, Talking, Chatting, Online with duration
TeamTeam 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"]
}
On this page

Introduction

Click to Call

Campaign Push API - Single Record

Campaign Push API - Multiple Records

Reset Token API

Samespace Live Data