Skip to main content
To get a presigned URL, you first need to request for it. Here we’ll go through how you’d do it
1

Request the presigned URL

Start by performing a GET request on the server. This needs to contain the endpoint and your API token.The ?fileType param can be image, audio or video.
We plan to remove this ?fileType param in our next version of the API.
curl --request GET \
	--url 'https://fmapi.net/api/v2/presigned-url?fileType=image' \
	--header 'Authorization: YOUR_API_TOKEN' \
You will then get a response that looks like this:
{
	"data": {
    	"presignedUrl": "https://fmapi.net/api/v2/presigned-url/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  	},
	"status": "ok"
}
This is the url that you will be using in order to upload the file.
2

Uploading files

curl --request POST \
	--url https://fmapi.net/api/v2/presigned-url/iCyMnIkzF423RQr88Hppo \
	--header 'Content-Type: multipart/form-data' \
	--form file=path/to/your/file.png

Response

The response you get back is like any other file upload using the other uploads API endpoints.
{
  "data": {
    "id": "7F9pGhN8qwErT1vx5aZk",
    "url": "https://i.fmfile.com/7F9pGhN8qwErT1vx5aZk.jpg"
  },
  "status": "ok"
}