REST Connector encodes spaces in the URL query paramaters to +

Tagged:
  • Scott Roriston
        Has successfully completed the online course Introduction
        Has successfully completed the online course Intermediate (200)
        Has successfully completed the online course Basics (100)
        Has successfully completed the online course Advanced (310)
      1 year ago #38309

      We are using an oData specification API and part of the specification is to use a filter in the query parameter which includes spaces.

      e.g. $filter=(((startswith(Name,’Joe’))) and ((Location eq ‘ZA’) or (Location eq ‘DE’)))

      You can see the specification at the following link under 4.5. Filter System Query Option ($filter).

      URI Conventions (OData Version 2.0)

      The issue

      When using the Simplifier connector, the URI is encoded but instead of encoding the spaces to ‘%20’ the connector replaces the spaces with a ‘+’ which returns a malformed uri error.

      We also tried adding an already encoded set of parameters but Simplifier just encoded it again.

      Is there a way to set the connector encoding strategy?

      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 #38312
        Up
        0
        Down
        ::

        Hi Scott,

        You’re saying that you are using a REST connector. Simplifier also has an oData v2 connector, where you can specify query options as input parameters (like expand, filter etc.). In this article, we describe how to do this: https://community.simplifier.io/knowledge/how-to-use-query-options-in-odatav2-connector/

        Does this help you with your issue?

        Scott Roriston
            Has successfully completed the online course Introduction
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Basics (100)
            Has successfully completed the online course Advanced (310)
          1 year ago #38575
          Up
          0
          Down
          ::

          Hello Jennifer,

          Thank you for letting me know about the oData v2 connector.

          Are we able to add an “headParams/Authorization” header parameter to the oData connector like the REST connector? I looked in the documentaion and I could not find it.

          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 #38576
            Up
            0
            Down
            ::

            There is no dedicated parameter to add a header in oData v2 connector calls. However, if you are using a token for authentication, you can set it in the login method of the connector.

            Login methods are credentials that will be used by the connector for authentication: https://community.simplifier.io/doc/current-release/integrate/connectors/login-methods/

            Create a new login method, set the type to ‘token’ and activate the advanced view. For a static token, set the source to ‘provided source’. Set the target to ‘header parameter’.

            Then, enter the static token. Set the header name according to your API, e.g., ‘Authentication’. Now, the token will be added as header parameter in each connector call.

            Read more about the login method ‘token’ in the documentation: https://community.simplifier.io/doc/current-release/integrate/connectors/login-methods/token/

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

          You must be logged in to reply to this topic.