The first api call is https://api.boxever.com/v2/batches/cb7c7d33-634d-4a97-b12c-ddd58118fb06
The above API returns the Url where the file is to be uploaded
Next call will be to the upload url which is saved in the "testurl" variable.In the body will add the file to be uploaded
In the Header along with the existing parameters 2 more parameters are added:
1. Content -MD5 whose value is Checksum value of the file converted to Base64. 2. x-amz-server-side-encryption value is AES256
When this request is sent it returns either of the below errors:
1 . <Error>
<Code>AccessDenied</Code>
<Message>Request has expired</Message>
<Expires>2022-02-28T07:13:47Z</Expires>
<ServerTime>2022-03-03T07:54:07Z</ServerTime>
<RequestId>WDZWPM6XPRWQ6C13</RequestId>
<HostId>4Ppbuy8tG6ZCoqAs434tvvCvEyPaivqdbFO8tO5pnb7jVNfozwU2XquVR19+Q7j8cdtIbWlkgEo=</HostId>
</Error>
OR
enter code here
2. <Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<AWSAccessKeyId>AKIAXFYJLCYVPIX6DCXT</AWSAccessKeyId>
<StringToSign>PUT
application/gzip
1646032427
/boxever-batch-service-production-eu-west-1/psfu6uh05hsr9c34rptlr06dn864cqrx/cb7c7d33-634d-4a97-b12c-ddd58118fb06/import.gz</StringToSign>
<SignatureProvided>wxFRgvHbmVmlaJ8Fl9jg9BhgRmk=</SignatureProvided>
<StringToSignBytes>50 55 54 0a 0a 61 70 70 6c 69 63 61 74 69 6f 6e 2f 67 7a 69 70 0a 31 36 34 36 30 33 32 34 32 37 0a 2f 62 6f 78 65 76 65 72 2d 62 61 74 63 68 2d 73 65 72 76 69 63 65 2d 70 72 6f 64 75 63 74 69 6f 6e 2d 65 75 2d 77 65 73 74 2d 31 2f 70 73 66 75 36 75 68 30 35 68 73 72 39 63 33 34 72 70 74 6c 72 30 36 64 6e 38 36 34 63 71 72 78 2f 63 62 37 63 37 64 33 33 2d 36 33 34 64 2d 34 61 39 37 2d 62 31 32 63 2d 64 64 64 35 38 31 31 38 66 62 30 36 2f 69 6d 70 6f 72 74 2e 67 7a</StringToSignBytes>
<RequestId>KAZ2TBXWZ906PTFC</RequestId>
<HostId>6wtT/GL37RnIIttqMvgwpNyge34yz+4lZM3vA8qdja2kXATPU7rbXWulG1S+AATfiewhNyH2oa0=</HostId>
</Error>
Any suggestions how to fix this?