Stream API chunk upload problem using TUS

I’ve been trying to implement stream upload using Stream API using my TUS implementation. In my implementation, I can send video chunks to the Cloudflare but i couldn’t manage to finalize and merge all chunks. I couldn’t figure out why.

According to the TUS implementation, first you need to start with POST request for initializing the upload.

POST https://api.cloudflare.com/client/v4/accounts/:accountId/stream/ 
HTTP/1.1
Host: api.cloudflare.com
Tus-Resumable: 1.0.0
Upload-Length: 5242880
Upload-Concat: partial
X-Auth-Email: :email
X-Auth-Key: :authKey
Content-Length: 0

This responds the location where a chunk will be uploaded. And I uploaded chunk to it

PATCH https://api.cloudflare.com/client/v4/accounts/:accountId/stream/:location
HTTP/1.1
Host: api.cloudflare.com
Tus-Resumable: 1.0.0
X-Auth-Email: :email
X-Auth-Key: :authKey
Upload-Offset: 0
Content-Type: application/offset+octet-stream
Content-Length: 5242880

So far so good! After I uploaded all of my chunks, I sent the finalizing request

POST https://api.cloudflare.com/client/v4/accounts/:accountId/stream/ 
HTTP/1.1
Host: api.cloudflare.com
Tus-Resumable: 1.0.0
Upload-Concat: final;https://api.cloudflare.com/client/v4/accounts/:accountId/stream/:location1
https://api.cloudflare.com/client/v4/accounts/:accountId/stream/:location2
https://api.cloudflare.com/client/v4/accounts/:accountId/stream/:location3
X-Auth-Email: :email
X-Auth-Key: :authKey
Content-Length: 0

But this request returns 400 and i didn’t manage it to work properly. Can anyone knows what I’m doing wrong here.

Thanks in advance

Hey devs, I want to use parallel uploads too.

OP, did you get this resolved?

@nicholas4 hello. Since they don’t seem to interested in my problem, I solved it by uploading to a temporary storage (i.e. a cloud storage service which provides HEAD request) and then getting the url of the video, then upload it using the url.