Fetching a file and converting RESTBinaryResult

  • Radostin Minchev
        Has successfully completed the online course Basics (100)
      1 year ago #35243

      Hello,

      I created a connector that should receive a pdf as a response, but instead, it receives “RESTBinaryResult” instead.
      How can I convert this “RESTBinaryResult” to a blob or a file object?

      Thank you,
      Radostin

      Jennifer Häfner
          Has successfully completed the online course Intermediate (200)
          Has successfully completed the online course Advanced (300)
          Has successfully completed the online course Basics (100)
          Has successfully completed the online course Advanced (310)
          Has successfully completed the online course Advanced (320)
          Has successfully completed the Intermediate Certification
          Has successfully completed the Advanced Certification
        1 year ago #35245
        Up
        0
        Down
        ::

        Hi Radostin,

        Does the RESTBinaryResult output contain the base64 data of the PDF?

        If so, you can use the Client-Side Business Object function ‘ITIZ_Utilities’ – ‘B64toBlob’ from our Standard Content to convert the base64 data to a blob.

        Vasileios Thanasias
            Has successfully completed the online course Basics (100)
          1 year ago #35256
          Up
          0
          Down
          ::

          Hi Jennifer,

          Is it possible to get the blob of the file, directly from the connector?

          Like in Javascript  XMLHttpRequest we have a property to set the response type to blob.

          xhrInSign.responseType = “blob”

          Jennifer Häfner
              Has successfully completed the online course Intermediate (200)
              Has successfully completed the online course Advanced (300)
              Has successfully completed the online course Basics (100)
              Has successfully completed the online course Advanced (310)
              Has successfully completed the online course Advanced (320)
              Has successfully completed the Intermediate Certification
              Has successfully completed the Advanced Certification
            1 year ago #35266
            Up
            0
            Down
            ::

            With the input parameter ‘configuration/http/body/binaryResult/format’, you can control the format of the binary output result. The format options are described in the advanced configuration documentation for REST connectors.

            If these format options are not suitable for your use case, you can still convert the base64 output to a blob, e.g., inside a Client-Side Business Object.

             

          Viewing 4 posts - 1 through 4 (of 4 total)

          You must be logged in to reply to this topic.