Talkstack
  • System architecture
  • Getting Started With Talkstack's API
  • Authentication
    • Signup
    • Verify Email
    • Resend email verification code
    • Login
    • Refresh Token
    • Change Password
    • Forgot Password
    • Reset Password
  • User
    • Generate API key
    • Set active Project
    • Get active Project
  • Project
    • Creating a new project
    • Get Project
    • Getting list of projects
    • Update a project
    • Delete Project
    • Webhook
    • Get Active Agent
    • Set Active Agent
    • Remove Active Agent
  • Agent
    • Create a new Agent
    • Get Agent Details
    • Update Agent
    • Delete an agent
    • Get All agents
  • Call
    • Make phone call
    • Get call data
    • Get call history
    • Get call analysis
    • Batch calls
  • Voices
    • List Voices
    • Get Voice data
  • Phone Number
    • Get phone number data
    • Assign Number to Agent
  • Hubspot
    • HubSpot Integration
Powered by GitBook
On this page
  1. Call

Get call data

This section explains how to use the /call endpoint to initiate calls using TalkStack's API.

Step 1: Prepare Your Request

  • Endpoint: /call

  • Method: POST

  • URL: https://api.talkstackai.com/call

  • Headers: Include Content-Type: application/json.

  • Authorization: Bearer token or x-api-key in headers

Step 2: Construct the JSON Body with Dynamic Variables

  • sid: The sid of the call for which you want to fetch details.

  • projectId: The id of the project with which the call is associated.

Step 3: Send the Request

Use your preferred HTTP client to send the POST request with the above JSON body.

Step 4: Handle the Response

The response will provide detailed information about the call associated with the callSid.

Success Response:

  • Status Code: 200 OK

  • Body: The response includes details like status, from, to, date, recordingUrls, and additional call data.

{   
    "seconds": 23,
    "cost": 0.077,
    "status": "completed",
    "from": "+14152148508",
    "to": "+12068091239",
    "date": "Tue, 30 Jan 2024 13:39:53 +0000",
    "recordingUrls": [
        "https://api.twilio.com/2010-04-01/Accounts/xxxxxx/Recordings/xxxxx.mp3"
    ],
    "phoneNumber": "+12068091239",
    "callSid": "CA26e39c970fd416515799f5a165718be3",
    "partnerId": "partner-id",
    "shiftId": "shift-id",
    "assignmentId": "assignment-id",
    "data": {
        "employeeGoToWork": "false",
        "reasonOfCancellation": "Please keep in mind that canceling your shift within 12 hours of shift start will negatively impact your ability to see shifts in the future. Are you sure you want to cancel?",
        "newDate": ""
    }
}
  • Confirm that the callSid is correctly included in the request body.

  • Ensure that the callSid is valid and corresponds to a call made through your system.

  • Contact our support team for further assistance in case of persistent issues or errors.

Troubleshooting

  • 400 Bad Request: If the callSid is missing in the request.

  • 404 Not Found: If the call details for the provided callSid are not found.

  • 500 Internal Server Error: For errors in fetching the call status.

Error Responses:

  • ringing - temporary

  • in-progress - temporary

  • voicemail - permanent

  • busy - permanent

  • silence - permanent (if there is silence > 6s during the call or voicemail, we close the call)

  • queued - temporary (our systems still do not trigger the call)

PreviousMake phone callNextGet call history

Last updated 1 month ago