Hey folks, this is killing me. When I hard code a URL for an API call, I get a response. When I add the variable, {{column heading}} I get an error. Any advice would be amazing. What I have checked
column heading name
spacing or hidden characters after the URL
changed the column with the URL from 'URL' to 'Text'
variation of the body inc url / urls / text / formula
Any suggestions would be amazing?
The issue is with JSON formatting in your body. When using dynamic variables for strings in the HTTP API body, you must enclose them in quotation marks.
Change your body from:
{
"url": {{Website}}
}To:
{
"url": "{{Website}}"
}Dynamic string variables require quotation marks to follow proper JSON formatting rules. Could you copy and paste your current JSON body so I can help troubleshoot further?
If you still need help resolving the JSON formatting issue with your API call, I’m here to assist. Would you like to share your current JSON body so we can troubleshoot it together?
Clay received a 400 error from the API with Content: {"success":false,"code":"BAD_REQUEST","error":"URL must have a valid top-level domain or be a valid path","details":[{"code":"custom","message":"URL must have a valid top-level domain or be a valid path","path":["url"]}]}
The 400 error indicates the API is receiving an invalid URL. This typically happens when the dynamic variable {{Website}} contains empty cells, malformed URLs, or URLs without proper top-level domains.
Check your Website column for:
Empty or null values
URLs missing protocols (http:// or https://)
Invalid domains without proper extensions
Hidden characters or extra spaces
Could you copy and paste your current JSON body so I can help troubleshoot the formatting further?
Click into the specific error cell to see the detailed error message. Based on your previous 400 error about invalid URLs, check your JSON body formatting - ensure dynamic string variables like {{Website}} are enclosed in quotation marks: "url": "{{Website}}".
Also verify your Website column has no empty cells, hidden characters, or malformed URLs. Please copy and paste your current JSON body so I can troubleshoot the formatting further.
Did that answer your question?
If you still need help with the API call error, I’m here to assist you further. Would you like to provide more details about your current JSON body or the specific issue you’re encountering?
Clay received a 400 error from the API with Content: {"success":false,"code":"BAD_REQUEST","error":"URL must have a valid top-level domain or be a valid path","details":[{"code":"custom","message":"URL must have a valid top-level domain or be a valid path","path":["url"]}]}
The 400 error indicates your {{Website}} variable contains invalid URL data. Check your Website column for empty cells, URLs missing protocols (http:// or https://), or hidden characters.
Ensure dynamic string variables like {{Website}} are enclosed in quotation marks in your JSON body: "url": "{{Website}}".
Copy and paste your current JSON body so I can troubleshoot the formatting further.
Is that what you were looking for?
If you still need assistance with the 400 error or your API call setup, I’m here to help. Would you like to share more details about your current JSON body or any other part of the issue you’re facing?
