Setting Richtext via Markdown API will reference external images

The GQL is in my opinion already quite good to use. I’m currently using it to try to transfer internal documentation from other (cloud) systems into fibery.

I noticed that images that are referenced via URL from external site are actually not replaced with Fibery uploads, but instead stay as external references. This is not what I expected (as the UI markdown import works differently) – but also because the image URLs from the external systems might not work forever.

Would be great to have an option inside the API to automatically pull the files into Fibery.

Is there a recommended way to work around this or should we just write our own scripts to download and upload the files to Fibery (via the REST API)?

1 Like

As a workaround for now, first upload the file via the REST API:

const response = await fetch(“API_ENDPOINT“,{
            method: "POST",
            headers: {
                'Authorization': `Token ${this._token}`,
            },
            formData: {
                file: // BLOB or Stream
}
        })

const json = await response.json();

// Now you can use the secret as an image URL in the document markdown:
// ![ALT](YOUR_FIBERY_URL/api/files/{{json["fibery/secret"]}})