3
  1. The first api call is https://api.boxever.com/v2/batches/cb7c7d33-634d-4a97-b12c-ddd58118fb06

  2. The above API returns the Url where the file is to be uploaded

  3. 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

  4. 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
    
  5. 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?

2 Answers 2

0

Just make sure that there is no Content-Type in the header. In my case i had sent the content-type as application/gzip unknowingly as hidden headers and i was getting the below error. enter image description here

0

The Sitecore CDP technical guide at https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/importing-a-batch-file-into-sitecore-cdp.html mentions that "the content-type header must be added to request".

I got my API call working by adding a Content-Type in the header and leaving the value blank. This overrides the existing Content-Type header that was getting automatically added by postman.

Two other things to watch for which may cause you error -

  1. Make sure to base64 encode the md5 string when using it in the call. The above help article mentions this. There are websites that can convert or you can use linux commands for eg

echo -n '368f2ec3efb8ace9d0e787eb2b825817' | xxd -r -p | base64

  1. Make sure to attach the file you are uploading in the body as a binary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.