Question

Dynamically create URL through code

  • 17 October 2023
  • 5 replies
  • 63 views

Hello,

 

I have a situation where I have to dynamically build a URL “?example1=DSWIM POWER SUPPLY&example2=23” I have created the link, but I keep getting a zap error:

 

Failed to create a request in Webhooks by Zapier

DSWIM POWER SUPPLY not found (HTTP Status Code: 404)

 

The URL is correct and if I send it externally it works, but Zapier is having issues propagating the dynamic data into the url string.. Any Ideas?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 6
Badge +8

This is probably happening because you have not encoded the URL. “DSWIM POWER SUPPLY” should become “DSWIM%20POWER%20SUPPLY”.

After determining the URL parameters, but prior to sending the text to your web hook, create a Formatter action, choose Text as the event, then “URL Encode” in the transform dropdown, enter the URL (or at least the query string) as the input, and leave “Convert space to plus” empty or choose false.

You should then be able to pass the newly encoded URL to your web hook :)

Userlevel 6
Badge +8

Alternatively, if you happen to have a code step prior to your web hook, you can use the encodeURI() or encodeURIComponent() methods there (they do the same thing as Zapier’s URL Encode formatter).

Failed to create a request in Webhooks by Zapier

FIBERSYNCRECEIVER not found (HTTP Status Code: 404)

 

I removed any chance of that and still got this error^^

Hello..

 

This is the original:

&item_prices[item_price_id][0]=TEST

what I converted it to for testing:

&item%5Fprices%5Bitem%5Fprice%5Fid%5D%5B0%5D=TEST

 

and the error:

Failed to create a request in Webhooks by Zapier

TEST not found (HTTP Status Code: 404)

Userlevel 6
Badge +8

Are you able to share the base URL and/or any documentation for the API you are sending the request to? Also, a screenshot of your web hook action setup would be helpful to see if there’s anything else there that might be going wrong. (Please be sure to redact any sensitive details in your screenshot and URL, including API keys, email addresses, etc.)