> This page is for APIs.

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

# Get fax log

GET https://%7BYour_Space_Name%7D.signalwire.com/api/fax/logs/{id}

Retrieves one historical fax activity record by log ID for delivery review or troubleshooting. This read-only endpoint cannot send, cancel, or delete the fax; use Compatibility [Retrieve fax](/docs/compatibility-api/rest/faxes/retrieve-fax) for the managed fax resource.

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Fax_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

Reference: https://signalwire.com/docs/apis/rest/fax-logs/get-fax-log

## 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

## Response

### 200

The request has succeeded.

- `id` (string, required) — A unique identifier for the log
- `from` (string, required, nullable) — The origin phone number in E.164 format.
- `to` (string, required, nullable) — The destination phone number in E.164 format.
- `status` (enum, required) — The status of this fax call.
  - Allowed values: `queued`, `initiated`, `ringing`, `in-progress`, `busy`, `failed`, `no-answer`, `canceled`, `completed`
- `direction` (enum, required, nullable) — The direction of this fax call.
  - Allowed values: `inbound`, `outbound-api`, `outbound-dial`
- `source` (enum, required) — Source of this log entry.
  - Allowed values: `laml`
- `type` (enum, required) — Type of this log entry.
  - Allowed values: `laml_call`
- `url` (string, required) — URL for the associated fax resource with this log entry.
- `remote_station` (string, required, nullable) — Represents a customer hosted Fax server.
- `charge` (double, required) — The amount charged for this fax request.
- `number_of_pages` (integer, required, nullable) — The number of pages the fax document contained.
- `quality` (enum, required, nullable) — The quality that was set when the fax document was sent.
  - Allowed values: `fine`, `standard`, `superfine`
- `charge_details` (list of Fax.ChargeDetail, required) — Details on charges associated with this log.
- `created_at` (datetime, required) — Date and time when the fax was created.
- `error_code` (string, required, nullable) — Error code for this resource (if available).
- `error_message` (string, required, nullable) — The description of this error (if available).

## 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

### Fax.ChargeDetail

- `description` (string, required) — Description for this charge.
- `charge` (double, required) — Charged amount.

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

## Examples

**Response**

```json
{
  "id": "b7182dc2-00f3-40e4-a5ce-20f164b329df",
  "from": "+12065551212",
  "to": "+12065553434",
  "status": "completed",
  "direction": "inbound",
  "source": "laml",
  "type": "laml_call",
  "url": "https://example.signalwire.com/api/laml/2010-04-01/Accounts/b7182dc2-00f3-40e4-a5ce-20f164b329df/Faxes/c9a1d3e4-56f7-89ab-cdef-0123456789ab",
  "remote_station": null,
  "charge": 0.01,
  "number_of_pages": 2,
  "quality": "fine",
  "charge_details": [],
  "created_at": "2024-05-06T12:20:00Z",
  "error_code": "34004",
  "error_message": "The call dropped prematurely"
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/fax/logs/id"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/fax/logs/id';
const credentials = btoa("<project_id>:<api_token>");

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/fax/logs/id"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	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/fax/logs/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/fax/logs/id")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/fax/logs/id', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/fax/logs/id");
client.Authenticator = new HttpBasicAuthenticator("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/fax/logs/id")! 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()
```