Complete a PDF upload
POST/api/v1/media/upload-complete
The last step of a PDF upload: check the file you sent to the upload address and get its media ID. Start with Start a PDF upload, which explains all three steps. Call this endpoint with the uploadId you got there, after you have sent the file and before completeBy.
The answer has the mediaId to use in Send RCS as document.mediaId. It stops working 24 hours after you started the upload, and completing doesn't move that time.
Call it again with the same uploadId and you get the same answer until the media ID expires.
When a call is refused, what to do next depends on the answer. The texts are in the response examples.
- The file hasn't arrived yet (
400): while the upload address is open (uploadExpiresAt, 15 minutes after the start), send the file and call again with the sameuploadId. After that the file can no longer be sent, so start a new upload. - Another call is still working on the same upload (
429): wait for theRetry-Afterheader, 5 seconds, and call again. - The server could not store the file (
500): call again with the sameuploadId. - The file is wrong, because its size is not the declared one or it is not a PDF (
400): the upload is refused for good, and every later call for it is refused too. Start a new upload. - You didn't complete in time (
400): the limit is an hour from the start. Start a new upload. - The
uploadIdis not known (400): it doesn't exist, or it isn't one of your account's uploads. - The media has expired (
400): the 24 hours are over. Upload the PDF again.
Like Send RCS, the call needs RCS enabled for your account and an approved RCS sender: contact support.
Request
- application/json
- Body
- An upload
Bodyrequired
The ID of the upload to complete.
The uploadId from Start a PDF upload.
Possible values: Value must match regular expression ^UPL[0-9A-F]{8}$
{
"uploadId": "UPL7C41D2E9"
}
Responses
- 200
- 400
- 401
- 429
- 500
The PDF was stored. Use mediaId in Send RCS within 24 hours of the start. A repeat call answers the same until then.
Bad Request. Nothing was stored.
Unauthorized.
Too Many Requests. An earlier call for the same upload is still working. Wait that many seconds and call again.
Response Headers
The number of seconds to wait before you try again.
The PDF could not be stored. Trying again with the same uploadId is safe.