0

First of all thank you, it is the first time that I am going to write, although I have used it many times.

I put you in a little situation, I am trying to use the REST API of Wordpress Woocommerce from an application in C#.

In wordpress I have changed the permalinks and created a key in the read / write rest api (ck _... and cs _...).

Using Postman and using OAuth 1.0 authentication I get the data back, in my case of orders.

http: // localhost / wordpress / wc-api / v3 / orders? filter [meta] = true

In the authentication I only put the consumer_key and consumer_secret and it returns the data. In fact, if I look at the console, the call it makes is the following:

GET http://localhost/wordpress/wc-api/v3/orders?filter[meta]=true&oauth_consumer_key=ck_……&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1586951821&oauth_nonce=GKkrS5tdync&oauth_version=1.0&oauth_signature=igKzzqzTNeSTSHRyOx4T9ucZWak=

but I don't know how to get the data I need. I have seen how to get timestamp and nonce at: REST API authentication (OAuth 1.0) using C#

but to get the signature I have seen that I need a token that I don't know how to get it, in postman I only put the consumer_key and the consumer_secret. If you can help or guide me, I would appreciate it. Greetings and thank you

Pimenta
  • 1,029
  • 2
  • 13
  • 32
Salva
  • 1
  • 1
  • Hey there, can you add examples of the changes you made or add links to the examples you followed (" I have changed the permalinks and created a key in the read / write rest api") ? The token is usually created on the server side, so if your are consuming a Rest API there should be a method to get the token along with the authentication. Can you check for that as well? – Pimenta Apr 21 '20 at 12:12
  • Good, is that in postman all I do is choose OAuth 1.0 authentication and put the consumer_key and consumer_secret. When I say that the other data I know how to get it is what I have looked at the link that I have put – Salva Apr 21 '20 at 12:40

1 Answers1

0

Fixed, I have used a visual studio nuget package called Woocommerce.NET. The project itself can be seen at: https://github.com/XiaoFaye/WooCommerce.NET

Salva
  • 1
  • 1