API Reference

1. Show the image using the URL

const options = {
    method: "GET",
    headers: {
        Accept: "application/json",
        Authorization: "Bearer {API_Key}",
    },
};
const response = await fetch("https://api.upsend.app/images/{id}", options);

// Add type guard 
const image = (await response.json()) as {
    id: string;
    created: string;
    updated: string;
    user_id: string;
    name: string;
    size: string;
    mime_type: string;
    url: string; // ----------------------!!!----------------------
    buffer: Buffer;
};

2. Modify the image dynamically

To modify the image, pass the acquired URL into the Cloudflare Transformation service set up for this domain. The end result looks like that (say hello to my dog :)):

https://upsend.app/cdn-cgi/image/quality=90,gamma=0.5,height=600,format=webp/https://images.upsend.app/49e185dc61cf460dbb298def1554591e%2F018f597f-c946-74ff-9b51-f7ae0f71f20e

Haker