- Newest
- Most votes
- Most comments
The | character falls under the list of unwise characters in the RFC 2396 specification:
Other characters are excluded because gateways and other transport
agents are known to sometimes modify such characters, or they are
used as delimiters.
unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
Data corresponding to excluded characters must be escaped in order to
be properly represented within a URI.
Step Functions encodes provided URLs before invoking the Task state HTTP call, which is why your % character is being encoded into %25. There is currently no way to use a HTTPS task with a pipe symbol.
I've reached out to the team to explore if that logic can be adjusted however.
The issue you're encountering with the pipe character in the URL is indeed a challenge when working with AWS Step Functions' HTTP Task. Step Functions appears to be applying URL encoding to certain special characters, which is causing the problem you're experiencing.
To work around this issue, you can try the following approach:
-
Instead of putting the full URL in the
ApiEndpointparameter, split it into two parts:- Use the base URL (https://example.com) as the
ApiEndpoint - Put the path with the special character (/users/app|1234) in a separate
Pathparameter
- Use the base URL (https://example.com) as the
-
Modify your state machine definition to use this approach. Here's how you can structure it:
{ "QueryLanguage": "JSONPath", "Comment": "A description of my state machine", "StartAt": "Call HTTPS APIs", "States": { "Call HTTPS APIs": { "Type": "Task", "Resource": "arn:aws:states:::http:invoke", "Parameters": { "ApiEndpoint": "https://example.com", "Method": "GET", "Path": "/users/app|1234", "InvocationConfig": { "ConnectionArn": "..." } }, "Retry": [ { "ErrorEquals": [ "States.ALL" ], "BackoffRate": 2, "IntervalSeconds": 1, "MaxAttempts": 3, "JitterStrategy": "FULL" } ], "End": true } } }
By separating the base URL and the path, you can avoid the automatic URL encoding that Step Functions is applying to the full URL. This should allow the pipe character to be sent correctly in the request.
If you need to make the user ID dynamic, you can use a path reference to pass it as a parameter. For example:
"Path.The issue you're encountering with the pipe character in the URL is indeed a challenge when working with AWS Step Functions' HTTP Task. Step Functions appears to be applying URL encoding to certain special characters, which is causing the problem you're experiencing. To work around this issue, you can try the following approach: 1. Instead of putting the full URL in the `ApiEndpoint` parameter, split it into two parts: - Use the base URL (https://example.com) as the `ApiEndpoint` - Put the path with the special character (/users/app|1234) in a separate `Path` parameter 2. Modify your state machine definition to use this approach. Here's how you can structure it: ```json { "QueryLanguage": "JSONPath", "Comment": "A description of my state machine", "StartAt": "Call HTTPS APIs", "States": { "Call HTTPS APIs": { "Type": "Task", "Resource": "arn:aws:states:::http:invoke", "Parameters": { "ApiEndpoint": "https://example.com", "Method": "GET", "Path": "/users/app|1234", "InvocationConfig": { "ConnectionArn": "..." } }, "Retry": [ { "ErrorEquals": [ "States.ALL" ], "BackoffRate": 2, "IntervalSeconds": 1, "MaxAttempts": 3, "JitterStrategy": "FULL" } ], "End": true } } }
By separating the base URL and the path, you can avoid the automatic URL encoding that Step Functions is applying to the full URL. This should allow the pipe character to be sent correctly in the request.
If you need to make the user ID dynamic, you can use a path reference to pass it as a parameter. For example:
"Path.$": "$.userPath"
Then in your input to the state machine, you would provide the path including the pipe character:
{ "userPath": "/users/app|1234" }
This approach should allow you to successfully make requests to URLs containing pipe characters or other special characters that might otherwise be encoded unexpectedly.quot;: "$.userPath"
Then in your input to the state machine, you would provide the path including the pipe character:
```json
{
"userPath": "/users/app|1234"
}
This approach should allow you to successfully make requests to URLs containing pipe characters or other special characters that might otherwise be encoded unexpectedly.
Sources
Call HTTPS APIs in Step Functions workflows - AWS Step Functions
Passing parameters to a service API in Step Functions - AWS Step Functions
answered 2 years ago
When I tried this I get the error: The field "Path" is not supported by Step Functions.
Relevant content
asked 2 years ago
asked 2 years ago
- AWS OFFICIALUpdated a year ago

@ben-from-aws thanks for confirming. I'd be very interested to hear what response you get back from the step functions team.
Hi, it's been a while but the issue has been fixed by the team. Could you please try again