The GetQR API is in beta and is available to selected workspaces. Details may change before the general release.
Upload a file
1
Register the file
Call Register a file upload with the file’s
target, contentType and size. The target decides the accepted content types and the size limit. You get a fileId and an uploadUrl.2
Send the file
Send the file with a
PUT request to uploadUrl. Its Content-Type and Content-Length must exactly match the contentType and size you registered: anything else is rejected. The URL is pre-signed, so don’t add your API key. It expires after 10 minutes.3
Use the file ID
Pass
fileId when you create a QR code:- As
fileIdfor apdf,imageorvideoQR code. Upload with the matching target. - As
fileIdfor the profile image of avcard,social,multilinkoreventQR code. Upload with thelogotarget. - As
logoOptions.fileId, withlogoOptions.typeset touploaded, for a custom logo. Upload with thelogotarget. See Customization.
Limits
- Bare MIME type. Send a single lowercase type and subtype, such as
image/png. Parameters such as;charset=and lists are rejected. - No SVG. XML-based types such as
image/svg+xmlaren’t accepted. Upload a raster image such asimage/pngorimage/jpeg.
Headers
string
required
Bearer followed by your API key. See Authentication.string
required
application/json.Register a file upload
POST /api/v1/files
Registers a file and returns a pre-signed URL to upload it to. This call doesn’t upload the file itself.
string
required
What the file is for:
pdf, image, video or logo. Sets the accepted content types and the size limit. See Limits.string
required
MIME type of the file, for example
application/pdf, without parameters. The upload request must send exactly this Content-Type.integer
required
Exact size of the file in bytes, a positive whole number. Checked against the limit for the target. The upload request must send exactly this
Content-Length.string
Original file name, up to 255 characters. Kept for display in the dashboard. A path with
/ or \ is rejected.string
ID to pass as
fileId or logoOptions.fileId.string
Pre-signed URL to
PUT the file to.integer
Seconds until
uploadUrl expires: 600.string
HTTP method for the upload:
PUT.Common issues
422 "Content type … is not allowed for target"
422 "Content type … is not allowed for target"
The content type doesn’t match the target. For example,
pdf accepts only application/pdf. See Limits.422 "must be a single lowercase type/subtype"
422 "must be a single lowercase type/subtype"
Send the content type in lowercase and without parameters:
image/png, not Image/PNG or image/png; charset=utf-8.422 "File is too large for target"
422 "File is too large for target"
The declared
size is over the limit for the target. Compress the file before you register it.The upload to uploadUrl fails
The upload to uploadUrl fails
The URL expires 10 minutes after you register the file, and the request must send exactly the registered
Content-Type and Content-Length. Register the file again to get a new URL.422 "is registered but its content was never uploaded" when creating a QR code
422 "is registered but its content was never uploaded" when creating a QR code
You registered the file but the
PUT to uploadUrl didn’t complete. Upload the file, then create the QR code.422 "was uploaded to …" when creating a QR code
422 "was uploaded to …" when creating a QR code
The file was registered with a different target, for example an
image file used for a pdf QR code. Register a new upload with the matching target.404 "File … was not found" when creating a QR code
404 "File … was not found" when creating a QR code
The
fileId doesn’t exist. Take it from the response of Register a file upload.