> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # List voice log events GET https://%7BYour_Space_Name%7D.signalwire.com/api/voice/logs/{id}/events Returns the recorded event timeline for one historical voice log. Use it to troubleshoot the sequence of events for a known call segment; use [Get voice log](/docs/apis/rest/voice-logs/get-voice-log) for the log summary. This endpoint reports history and does not subscribe to or control live call events. #### Permissions The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_. [Learn more about API scopes](/docs/platform/your-signalwire-api-space). Reference: https://signalwire.com/docs/apis/rest/voice-logs/list-voice-log-events ## Authentication - `Authorization` header (basic auth, required) — SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ``` ## Request ### Path parameters - `id` (string, required) — Unique ID of the log. This is the segment_id you can find in Relay call details in your Dashboard UI or in return objects when using the SDK. ## Response ### 200 The request has succeeded. - `data` (list of Voice.LogEvent, required) — Array of event entries for the log ## Errors ### 400 Bad Request Error The request is invalid. - `error` (enum, required) - Allowed values: `Bad Request` ### 401 Unauthorized Error Access is unauthorized. - `error` (enum, required) - Allowed values: `Unauthorized` ### 404 Not Found Error The server cannot find the requested resource. - `error` (enum, required) - Allowed values: `Not Found` ### 422 Unprocessable Entity Error The request contains invalid parameters. See errors for details. - `errors` (list of Types.StatusCodes.RestApiErrorItem, required) — List of validation errors. ### 500 Internal Server Error An internal server error occurred. - `error` (enum, required) - Allowed values: `Internal Server Error` ## Types ### Voice.LogEvent Event entry for a voice log - `event_at` (datetime, required) — Timestamp when the event occurred. - `level` (enum, required) — Log level of the event. - Allowed values: `info`, `warn`, `error`, `debug` - `name` (string, required) — Name of the event. - `details` (VoiceLogEventDetails, required) — Additional details about the event. Structure varies by event type. - `project_id` (string, required) — Unique identifier for the project. - `log_id` (string, required) — Unique identifier for the log. ### Types.StatusCodes.RestApiErrorItem Details about a specific error. - `type` (string, required) — The category of error. - `code` (string, required) — A specific error code. - `message` (string, required) — A description of what caused the error. - `url` (string, required) — A link to documentation about this error. - `attribute` (string, optional, nullable) — The request parameter that caused the error, if applicable. ### VoiceLogEventDetails Additional details about the event. Structure varies by event type. ## Examples **Response** ```json { "data": [ { "event_at": "2024-05-06T12:20:00Z", "level": "info", "name": "calling_call_initiated", "details": {}, "project_id": "b7182dc2-00f3-40e4-a5ce-20f164b329df", "log_id": "b7182dc2-00f3-40e4-a5ce-20f164b329df" } ] } ``` **SDK Code** ```python import requests url = "https://{your_space_name}.signalwire.com/api/voice/logs/id/events" response = requests.get(url, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://{your_space_name}.signalwire.com/api/voice/logs/id/events'; const credentials = btoa(":"); const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://{your_space_name}.signalwire.com/api/voice/logs/id/events" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://{your_space_name}.signalwire.com/api/voice/logs/id/events") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://{your_space_name}.signalwire.com/api/voice/logs/id/events") .basicAuth("", "") .asString(); ``` ```php request('GET', 'https://{your_space_name}.signalwire.com/api/voice/logs/id/events', [ 'headers' => [ ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://{your_space_name}.signalwire.com/api/voice/logs/id/events"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = ["Authorization": "Basic \(credentials)"] let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/voice/logs/id/events")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```