> This page is for Advertising Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Fetch report URL

GET https://dashboard.humansecurity.com/api/v5/reports/get

Returns the URL of your requested report. You can then download the report file from its unique URL.

Reference: https://docs.humansecurity.com/advertising/reference/get-report-url

## Authentication

- `Authorization` header (basic auth, required) — To authenticate a request, provide an `Authorization` header with the value `Basic base64(username:password)`. For example, if your HUMAN Auth ID is `whiteops` and your HUMAN Auth Key is `secret`, your `Authorization` header should be set to `Basic d2hpdGVvcHM6c2VjcmV0`.

## Request

### Query parameters

- `name` (string, required) — The name of the report you'd like to access. You can find a list of possible values from the List Reports response. This value should be URL encoded.
- `type` (string, required) — The type of report to access. Possible values are `report` and `export`.

## Response

### 200

Success

- `data` (ReportUrlData, optional)

## Errors

### 400 Bad Request Error

Bad request (unsupported/missing parameters)

- `any`

### 401 Unauthorized Error

Unauthorized request (authentication failure)

- `any`

### 500 Internal Server Error

Internal server error

- `any`

## Types

### ReportUrlData

- `url` (string, optional)
- `expires` (string, optional)

## Examples

**Response**

```json
{
  "data": {
    "url": "https://testurl.com",
    "expires": "2015-05-21T22:10:07.634Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://dashboard.humansecurity.com/api/v5/reports/get"

querystring = {"name":"name","type":"type"}

response = requests.get(url, params=querystring, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type';
const credentials = btoa("<username>:<password>");

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://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type"

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

	req.SetBasicAuth("<username>", "<password>")

	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://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type")

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

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

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://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type")
  .basicAuth("<username>", "<password>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

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

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

var client = new RestClient("https://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

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

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

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

let request = NSMutableURLRequest(url: NSURL(string: "https://dashboard.humansecurity.com/api/v5/reports/get?name=name&type=type")! 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()
```