Retrieve an attachment
curl --request GET \
--url https://thirdparty.qonto.com/v2/attachments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://thirdparty.qonto.com/v2/attachments/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://thirdparty.qonto.com/v2/attachments/{id}', 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://thirdparty.qonto.com/v2/attachments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://thirdparty.qonto.com/v2/attachments/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://thirdparty.qonto.com/v2/attachments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v2/attachments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"attachment": {
"id": "71c32755-d0c3-4d82-9a78-774caa9d8556",
"created_at": "2021-03-23T14:21:51.000Z",
"file_name": "Foobar",
"file_size": "666",
"file_content_type": "image/png",
"url": "https://my-s3.url.qonto.bucket.com/123456789",
"probative_attachment": {
"status": "unavailable",
"file_name": "statement.pdf",
"file_content_type": "application/pdf",
"file_size": "666",
"url": "https://my-s3.url.qonto.bucket.com/123456789"
}
}
}Attachments
Retrieve an attachment
Retrieves the attachment identified by the id path parameter.
GET
/
v2
/
attachments
/
{id}
Retrieve an attachment
curl --request GET \
--url https://thirdparty.qonto.com/v2/attachments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://thirdparty.qonto.com/v2/attachments/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://thirdparty.qonto.com/v2/attachments/{id}', 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://thirdparty.qonto.com/v2/attachments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://thirdparty.qonto.com/v2/attachments/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://thirdparty.qonto.com/v2/attachments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v2/attachments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"attachment": {
"id": "71c32755-d0c3-4d82-9a78-774caa9d8556",
"created_at": "2021-03-23T14:21:51.000Z",
"file_name": "Foobar",
"file_size": "666",
"file_content_type": "image/png",
"url": "https://my-s3.url.qonto.bucket.com/123456789",
"probative_attachment": {
"status": "unavailable",
"file_name": "statement.pdf",
"file_content_type": "application/pdf",
"file_size": "666",
"url": "https://my-s3.url.qonto.bucket.com/123456789"
}
}
}Authentication: API key OAuth 2.0
Scope:
Scope:
organization.read Sensitive
In the Qonto app, attachments are files uploaded onto transactions by users. Attachments typically correspond to the invoice or receipt, and are used to justify the transactions from a bookkeeping standpoint.
You can retrieve the IDs of those attachments inside each transaction object, by calling GET /v2/transactions.
Probative attachment is another version of attachment, compliant with PAdES standard.
For security reasons, the
url you retrieve for each attachment is only valid for 30 minutes. If you need to download the file after more than 30 minutes, you will need to perform another authenticated call in order to generate a new download URL.If you download the file using
curl, replace the \\u0026 references by & in the url string.Authorizations
OAuthSecretKey
Bearer authorization header: Bearer <token>, where <token> is the access token received from the authorization server at the end of the OAuth 2.0 flow.
Headers
Required only for Sandbox API requests; to get one, please sign up to the Developer Portal.
Path Parameters
Example:
"e72f6e43-0f27-4415-8781-ad648a89b47f"
Response
Returns the attachment identified by the id path parameter.
Show child attributes
Show child attributes
Was this page helpful?