uploadFile(), keep the returned file id, and call getFileUrl() with that id whenever you need a download link.
requestFileUpload() is deprecated. The endpoint it called never existed, so it never succeeded; it now rejects with a HaspSDKError without sending a request. Use uploadFile().uploadFile(entityKey, recordId, file, signal?)
Uploads aFile (or Blob) and attaches it to the record. The SDK sends it to the Data API as multipart/form-data; the file is scanned for malware before it is stored.
createRecord(), then upload. Nothing links the file to a particular field, so store file.id on the record yourself if you need to find the file again:
Upload errors
All are HTTP 422 except
NOT_FOUND (404). See Error Handling.
getFileUrl(fileId, signal?)
Returns a presigned download URL for a file, plus the file’s metadata.The presigned URL is valid for one hour (
expiresAt). Do not cache it long-term — call getFileUrl again if you need a fresh URL.