Upload Attestation Document
Attestations must be backed by documentation such as wire confirmations, bank statements, or audit letters. This guide shows how to upload documents and receive a blobId
that can be attached to an attestation.
For automated / system driven attestations this can be a JSON file with the attestation details.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure:
- You have the
stablecoinId
- Your document is in an accepted format (PDF, image, or plain file)
Endpoint
Section titled “Endpoint”POST /v2/stablecoin/{stablecoinId}/attestation/documents
Content-Type
Section titled “Content-Type”Content-Type: multipart/form-data
Form Fields
Section titled “Form Fields”- file: The document file to upload
Example Request
Section titled “Example Request”curl -X POST https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/documents \ -H "Authorization: Bearer $FSCO_API_KEY" \ -F "file=@./wire-receipt.pdf"
import axios from 'axios';import FormData from 'form-data';import fs from 'fs';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const uploadDocument = async () => { const formData = new FormData(); formData.append('file', fs.createReadStream('./wire-receipt.pdf'));
const response = await axios.post( 'https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/documents', formData, { headers: { ...formData.getHeaders(), Authorization: `Bearer ${FSCO_API_KEY}` } } );
console.log('Document uploaded:', response.data);};
uploadDocument();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = {"Authorization": f"Bearer {FSCO_API_KEY}"}
files = {"file": ("wire-receipt.pdf", open("./wire-receipt.pdf", "rb"))}
response = requests.post( "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/documents", headers=headers, files=files,)
print("Document uploaded:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;using System.IO;
class Program{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var form = new MultipartFormDataContent(); var fileContent = new StreamContent(File.OpenRead("./wire-receipt.pdf")); fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/pdf"); form.Add(fileContent, "file", "wire-receipt.pdf");
var response = await client.PostAsync("https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/documents", form); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Document uploaded: " + responseString); }}
Response
Section titled “Response”{ "blobId": "{{blobId}}"}
Returns a
blobId
, which you can include in your attestation’s documents
array when calling the /attestation
endpoint.