# Get call data

**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.

```json
{   
    "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)
