Encoding URL parameters

When making requests that include query parameters, make sure the entire URL is correctly encoded.

You can use the @uri filter to achieve this with an Action. Here is an example of adding an encode URL step and passing your query parameters to the action to perform the encoding before making your request.

Flow:

{  "StartAt": "Zendesk.GetEmail",  "States": {   "Zendesk.GetEmail": {      "Result":        {         "email": "[email protected]"        },      "ResultPath": "$.res",      "Type": "Pass",      "Next": "Zendesk.SearchParams"    },   "Zendesk.SearchParams": {      "Result":        {         "query.$": "status<=open assignee:none via:sunshine_conversations_api email:{{$.res.email}} created>"        },      "ResultPath": "$.params",      "Type": "Pass",      "Next": "EncodeQuery"    },    "EncodeQuery": {            "Type": "Action",            "ActionName": "zis:common:transform:Jq",            "Parameters": {              "data.$": "$.params",              "expr": ".query | @uri"            },            "ResultPath": "$.encoded_query",            "Next": "Zendesk.GetTicket"          },    "Zendesk.GetTicket": {      "Comment": "A Flow defines the steps your integration takes in response to an input event. When you click Execute, your Input is passed into the Flow, which uses your Actions. Details of the Flow execution appear in the Output pane below.",      "Type": "Action",      "ActionName": "zis:zis_playground_z3nvvg-flowtest-998v2:action:zendesk.get_ticket",      "Parameters": {        "ticketId.$": "{{$.input.ticket.id}}",        "query.$": "{{$.params.query}}",        "encoded_query.$": "{{$.encoded_query}}"      },      "End": true    }  }}

Action:

{  "zendesk.get_ticket": {    "Comment": "This is where you can define custom Actions, which are wrappers for API requests. Actions are used in your Flow. Learn more https://developer.zendesk.com/documentation/integration-services/developer-guide/zis-custom-actions/",    "type": "ZIS::Action::Http",    "properties": {      "name": "zendesk.get_ticket",      "Comment": "name is used to reference the Action in the Flow",      "definition": {        "method": "GET",        "path.$": "api/v2/search.json?query={{$.encoded_query}}",        "connectionName": "zendesk"      }    }  }}

Resulting URL:

"api/v2/search.json?query=status%3C%3Dopen%20assignee%3Anone%20via%3Asunshine_conversations_api%20email%3Atester%40example.com%20created%3E"