Skip to content
Developerhome
X3

Import scenario - 3rd party application uploads file

  Less than to read

3rd party application queries the endpoint for getting a presigned upload url

  • API call examples:

    • Obtain a signed upload url

      • By curl command:

              curl -X POST -LH "Authorization: Bearer XXXXXXX" https://api.customerregion-sagex3.com/v1/dataingestion/SEED?filename=import_soh00001.txt
        

        Result:

              % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                            Dload  Upload   Total   Spent    Left  Speed
              100  1032  100  1032    0     0    710      0  0:00:01  0:00:01 --:--:--   710
              {"uploadUrl":"https://x3cloudmanager-s3-fileupload-dirty-qa.s3.eu-west-1.amazonaws.com/input/docuemntation-api/SEED/c0febabe-0f39-44bc-afe1-4619719804c9/import_soh00001.txt.8368b99a-80f6-456f-98cd-332bff265228?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAYET7IF4KEPQAZC2L%2F20190404%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20190404T165310Z&X-Amz-Expires=3600&X-Amz-Security-Token=FQoGZXIvYXdzEDIaDO54N3%2BNKBmLUwfXxCLyAU6y9wCbyPHhB0tlpInhAP24F%2FhsNxifCLjCs%2BatErjlOz2uZ1gqjYfhe8ucwBfpI%2B4k355%2F19IUYcWSznj2Uz3abrIX9s5RXenXAvXIfEUC1xII0c%2FxCieL%2BRHCBzCfR%2BADogzgZV4zLP3VmpbUbzatMXIBcyNDqv82caTTAsbPEJlWjwuHleETD1gCxpAfftv9Ila5t14si6Ghc1zAG%2BbLPjfTXd0xIDTTQSDsy%2FYpC8W7k4p3QPhT7cdok26HTjnEBvgUyMM67OlwlLGyc0tRpcMJnH2f3Hm2Pn8Qz9QQhTW08vlzLsqLG%2F6ndIkkeaSdKPTsmOUF&X-Amz-Signature=6fefa78ff5f541b3d02040b54be5e73183d993ccc5c95c00d4854a4dc772e7cb&X-Amz-SignedHeaders=host",
              "trackingUrl":"https://api.customerregion-sagex3.com/v1/dataingestion/tracking/8368b99a-80f6-456f-98cd-332bff265228"}
        
        
    • Postman

      Presigned URL

3rd party application uploads file

  • API call examples:

    • Upload the file using the presigned URL obtained previously

            curl -v --upload-file <sourcefile> “<signed upload url>”
      
            % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                          Dload  Upload   Total   Spent    Left  Speed
            0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying ...
          * TCP_NODELAY set
            0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*
            ....
          *  SSL certificate verify ok.
          } [5 bytes data]
          > PUT .....
          > Content-Length: 1588
          > Expect: 100-continue
          >
          { [5 bytes data]
          < HTTP/1.1 100 Continue
          } [5 bytes data]
          * We are completely uploaded and fine
          { [5 bytes data]
          < HTTP/1.1 200 OK
          < x-amz-id-2: cqYfTc97mLDyUljyA1xkw5msvBNE0380i/G0IR93TVkFFzeAfmmlwStTH/UtunHv6KG/I4hoXLk=
          < x-amz-request-id: 98EFF82D2682D4B4
          < Date: Fri, 25 Jan 2019 00:38:53 GMT
          < x-amz-server-side-encryption: AES256
          < ETag: "aaa32fcc92b3d705b3835d76eeacb28c"
          < Content-Length: 0
          < Server: AmazonS3
          <
          100  1588    0     0  100  1588      0   1373  0:00:01  0:00:01 --:--:--  1373
      
  • By Postman

    • Postman upload ing

    • Upload the file using the presigned URL obtained previously

      File upload