scheidgabriel
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Create product using WooCommerce APIHello @stuartduff
First of all, thanks you for your answer!And I misspelled on my question. I’m not able to make POST requests.
That is the same endpoint I’m using.
I use Postman for testing. But not even in Postman I can use that endpoint.
I set everything up, the endpoint URL, then the following:
– “Params” tab: I add two keys: consumer_key and consumer_secret, and their respective values.– “Authorization” tab: I select “Basic Auth”, and the username is the consumer key, and the password is the consumer secret.
– “Body” tab: I select “raw”, define it as JSON, then I write the JSON in the text area
– I define the method as POST
Then I hit “Send”. What the API returns is the same thing as if I used this endpoint: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products
I get no error messages. I get nothing but the list of all products, when I should receive back the product I tried to create.
I tried creating the product using Postman (like I described here) and I tried creating the product using the Visual Studio C# console application I developed to consume the API. After trying these 2 methods, I always log in the admin panel of the WooCommerce site I’m developing this for, and check the products. The one I tried to create is never there.My C# console app GET and PUT requests work just fine. But my POST does not. I don’t know what I’m doing wrong.
- This reply was modified 4 years, 4 months ago by scheidgabriel.