Issue with Dynamic HTTP Request

Describe the problem/error/question

Sure, I’ll translate your request for help into English:


Hello, N8N community!

I’m facing a challenge with dynamic HTTP Requests in N8N and would appreciate your help.

Problem: I’m attempting to make an HTTP Request in N8N using a dynamic URL. However, I’m encountering inconsistent behavior depending on how the URL is entered.

Details:

  1. Using a Direct Expression:
  • Expression: {{ $json.videoUrl }}
  • Result: An error occurs.
  • Context: This URL is dynamically generated from a spreadsheet.
  1. Entering the URL Directly:
  • If I enter the URL directly into the HTTP Request’s URL field, it works without any issues.
  1. Using a ‘Set’ Variable:
  • Expression: {{ $json.video }}
  • Result: It works correctly.
  • Context: In this case, I manually set the value of ‘video’ using a ‘Set’ node.

I am seeking to understand why the expression {{ $json.videoUrl }} is failing, while other approaches work. Any insights or suggestions would be greatly appreciated!

Thank you in advance for your help!

What is the error message (if any)?

Error 1
Cannot read properties of null (reading ‘replace’)
{“status”:“rejected”,“reason”:{}}

Error 2
ERROR: Forbidden - perhaps check your credentials?
403 - “URL signature expired”

Share the output returned by the last node

Information on your n8n setup

Hi @Lellis, I am sorry you’re having trouble.

From looking into this it appears you are using the expression in the “Request Method” field of your HTTP Request3 node.

You probably want to set the method to something like GET and then use your expression in the “URL” field instead to use a dynamic URL rather than a dynamic method.

Sorry! I made a modification in the node to simplify the process and ended up putting the URL in the wrong field

This is my actual scenario. I sent a screenshot so you can see exactly what the error is.

Qual é a mensagem de erro (se houver)?

ERROR: Forbidden - perhaps check your credentials?
403 - “URL signature expired”

Please share your workflow

Details:

  1. Using a Direct Expression:
  • Expression: {{ $json.videoUrl }}
  • Result: An error occurs.
  • Context: This URL is dynamically generated from a spreadsheet.
  1. Entering the URL Directly:
  • If I enter the URL directly into the HTTP Request’s URL field, it works without any issues.
  1. Using a ‘Set’ Variable:
  • Expression: {{ $json.video }}
  • Result: It works correctly.
  • Context: In this case, I manually set the value of ‘video’ using a ‘Set’ node.

Thanks @Lellis! This looks like it’s an error coming from the server you are calling, with n8n simply displaying it.

Many Instagram URLs will only work for a limited period of time unfortunately, so you’d have to revisit the original post to get a new working URL.

1 Like

@Lellis , check the explanation in this Stack Overflow.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.