HTTP Get URL issue

Hello everyone,

I have a scenario triggered from a filled Typeform.

I Have 6 answers, 4 being docs. So I iterate through the answers, and get the URL file with an HTTP module.

I used the function EncodeURL in the http module, but it code an error like this:

Validation failed for 1 parameter(s).
Invalid URL in parameter 'url'.

Here is an example of url:

https://api.typeform.com/responses/files/4dcb0f67a3d13ac4405bd1f7e80a38bacbb93f5567a173274ccf4972d75d4321/Mandat_de_gestion_Butler___Propriétaire___Commission_TAGS__8_.pdf

I guess the accent is the issue, but shouldn’t the encode function have fixed it?

here is my http module:

Thanks for the help!
Lucas

Why are you using the encodeURL function?

Remove the function to fix the error.

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

I used it because I had the error without it, so I thought I was due to special character in the url which is why I used the encode function.

But obviously I am not sure how to use it.

Here is a sample of my iterator:

{
        "type": "file_url",
        "file_url": "https://api.typeform.com/responses/files/4dcb0f67a3d13ac4405bd1f7e80a38bacbb93f5567a173274ccf4972d75d4321/Mandat_de_gestion_Butler___Propriétaire___Commission_TAGS__8_.pdf",
        "field": {
            "id": "loOn79twOOtk",
            "type": "file_upload",
            "ref": "386aa4a2-1a39-47f6-9998-4fd49c06b181"
        },
        "__IMTINDEX__": 3,
        "__IMTLENGTH__": 6
    },
    {
        "type": "file_url",
        "file_url": "https://api.typeform.com/responses/files/2774454a3bfbdc40e0d69728287988b3dd1b803002f4142f3efe61314ba2e495/Mandat_de_gestion_Butler___Propriétaire___Commission_TAGS__7_.pdf",
        "field": {
            "id": "Xi93Vu7U1Pq8",
            "type": "file_upload",
            "ref": "900eff45-f0f3-4895-ac54-383af0caef46"
        },
        "__IMTINDEX__": 4,
        "__IMTLENGTH__": 6
    }

To encode only just the URL path instead of full URL, you’ll need a minimum of two modules:

This is just an example. There may be a simpler solution.

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":10,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"original_url","scope":"roundtrip","value":"https://api.typeform.com/responses/files/4dcb0f67a3d13ac4405bd1f7e80a38bacbb93f5567a173274ccf4972d75d4321/Mandat_de_gestion_Butler___Propriétaire___Commission_TAGS__8_.pdf"},"metadata":{"designer":{"x":819,"y":259,"name":"Original URL"}}},{"id":13,"module":"builtin:BasicFeeder","version":1,"parameters":{},"mapper":{"array":"{{split(10.original_url; \"/\"; true)}}"},"metadata":{"designer":{"x":1064,"y":260,"name":"Split URL into paths"}}},{"id":12,"module":"util:TextAggregator","version":1,"parameters":{"rowSeparator":"other","otherRowSeparator":"/","feeder":13},"mapper":{"value":"{{replace(encodeURL(13.value); \"/(?<=https?)%3A/\"; \":\")}}"},"metadata":{"designer":{"x":1313,"y":259,"name":"Combine encoded paths"},"parameters":[{"name":"rowSeparator","type":"select","label":"Row separator","validate":{"enum":["\n","\t","other"]}},{"name":"otherRowSeparator","type":"text","label":"Separator"}],"advanced":true}},{"id":8,"module":"http:ActionGetFile","version":3,"parameters":{"handleErrors":false},"mapper":{"url":"{{12.text}}","serializeUrl":false,"method":"get","shareCookies":false},"metadata":{"designer":{"x":1557,"y":257},"parameters":[{"name":"handleErrors","type":"boolean","label":"Evaluate all states as errors (except for 2xx and 3xx )","required":true}]}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Thanks for the help!

Pasting doesn’t seem to work. I even download the json as a json file and tried the import blueprint, I have the message 'import successful on the bottom right corner, but nothing, no modules appear.