File Download API
curl --request GET \
--url https://api.pazy.io/v1.0/download/:resourceTypeimport requests
url = "https://api.pazy.io/v1.0/download/:resourceType"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/download/:resourceType', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/download/:resourceType",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/download/:resourceType"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pazy.io/v1.0/download/:resourceType")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/download/:resourceType")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyDownload APIs
File Download API
Retrieve documents for a specific vendor by its identifier
File Download API
curl --request GET \
--url https://api.pazy.io/v1.0/download/:resourceTypeimport requests
url = "https://api.pazy.io/v1.0/download/:resourceType"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/download/:resourceType', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/download/:resourceType",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/download/:resourceType"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pazy.io/v1.0/download/:resourceType")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/download/:resourceType")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All requests require an API key in the request headers. Headers:Authorization: Api-Key YOUR_API_KEY
Request
Content-Type:application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
resourceType | string | Yes | The resource type of the file |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fileKey | string | Yes | The unique key of the file |
Code Examples
curl -X GET https://api.pazy.io/v1.0/download/resource_type?fileKey=file_key \
-H "Authorization: Api-Key YOUR_API_KEY"
const response = await fetch(
"https://api.pazy.io/v1.0/download/resource_type?fileKey=file_key",
{
method: "GET",
headers: {
Authorization: "Api-Key YOUR_API_KEY",
},
},
);
import requests
url = "https://api.pazy.io/v1.0/download/resource_type?fileKey=file_key"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
Success Response
HTTP Status:200 OK
Response Fields:
You will get your file as data in response.
Error Responses
Missing Resource Type
HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "MISSING_REQUIRED_FIELD",
"message": "Resource Type is required"
}
}
File Not Found
HTTP Status:404 Not Found
{
"ok": false,
"error": {
"code": "FILE_NOT_FOUND",
"message": "File not found"
}
}
Access Denied
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "ACCESS_DENIED",
"message": "Access denied: You can only view your own files or resources where you are the owner"
}
}
Authentication Errors
HTTP Status:401 Unauthorized
{
"ok": false,
"error": {
"code": "MISSING_CREDENTIALS",
"message": "Missing Credentials"
}
}
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API Key"
}
}
Permission Errors
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Permission check failed - PERMISSION_CHECK_FAILED"
}
}
Best Practices
Access Control
- Only resource you created or where you are the owner are accessible (unless you have admin or auditor role)
- Use downloadUrl you get from documents API as a API endpoint right here.
Was this page helpful?