I have two HTTP request. One from API Discogs to get information and another to create a post to Wordpress using Rest API.
When I make a simple consult using GET, it works fine, but when I try to use POST method, not work.
I use localhost for my site.
The URL is: http://localhost/muzicrave/wp-json/acf/v3/artista
message": “404 - {“code”:“rest_no_route”,“message”:“No route was found matching the URL and request method.”,“data”:{“status”:404}}”
Hi @cesar_dev, I am very sorry to hear you’re having trouble. I quickly gave this a go on my end but didn’t run into any trouble with sending POST requests to localhost from the n8n desktop app (using a mock server that replies to whatever request I am sending):
The 404 status would also be an error coming from your machine, n8n would send an error such as getaddrinfo ENOTFOUND if it can’t find a hostname you have provided.
Is there a chance you are simply using the wrong endpoint? Any chance you can share a link to the documentation for you Wordpress API endpoint?
Hello @MutedJam,
Thanks for quickly help.
I send to you a new image of my endpoint. You can see that it works fine. I’m using ACF for Wordpress.
I’m just use ACF to REST API plugin.
Hi @cesar_dev, your browser would make a GET request rather than a POST request. Any chance you can double-check the API request using Postman, Insomnia, curl or a similar tool?
Hello @MutedJam, I have to install a plugin that authorize the URL of my rest API. Now it works fine.
I’m new to do this. The n8n is amazing!!!
I have one last issue.
The name of acf parameters not work.
I try everything, but nothing works.
{{ $node[“HTTP Request”].json[“acf”][“Nome”] }}
[“acf”][“Nome”]
[acf].Nome
I send an image to my json.
Thanks for help and patience.
For the expressions to work you’d need to tell n8n you want to use an expression by clicking on the gears icon and then selecting Add Expression like so:
Afterwards you should be able to write the expression you have in mind manually or simply select the value you want to use in the expression editor:
Hi @cesar_dev, it looks like the request itself is working fine (you can double-check the request by temporarily using a URL provided by https://webhook.site/ to send the data to - it’s a service that simply accepts all kinds of requests and shows them).
The null in the Name field is part of the answer from your API. So I suspect they might expect a slightly different data structure to actually process your information. Do you have a link to the API reference describing the endpoint you are using?
Hello @MutedJam,
I’m using this configuration.
The default fields os Wordpress works fine, but only acf fields not work.
The link that you send to make a test to send data, not loaded.
This is my workflow
I’m new to this. I’m learning. So there is somethings that I’m not an expert.