rest api - Need to get user data via API

admin2025-01-07  4

I apologise for what must be a very noob question but I'm brand new to WP and not a pro developer so a lot of this stuff is difficult for me.

I simply want to get API access to my user's data.

I have browsed through but I don't speak that language. I do not know what to do with the info they are giving me.

I have tried but I am failing at the first hurdle. I tried using the "Wordpress API with Basic authentication' method and I get the error: "missing 2 required positional arguments: 'consumer_key' and 'consumer_secret' " even though I have Basic authentication plugin installed so (I understand) I should not need this data.

But I tried to see how to get my consumer key and consumer secret, and I CAN'T figure it out. How do I get this data?

Or is there some other approach?

I apologise for what must be a very noob question but I'm brand new to WP and not a pro developer so a lot of this stuff is difficult for me.

I simply want to get API access to my user's data.

I have browsed through https://developer.wordpress.org/rest-api/reference/users/#retrieve-a-user-2 but I don't speak that language. I do not know what to do with the info they are giving me.

I have tried https://github.com/derwentx/wp-api-python but I am failing at the first hurdle. I tried using the "Wordpress API with Basic authentication' method and I get the error: "missing 2 required positional arguments: 'consumer_key' and 'consumer_secret' " even though I have Basic authentication plugin installed so (I understand) I should not need this data.

But I tried to see how to get my consumer key and consumer secret, and I CAN'T figure it out. How do I get this data?

Or is there some other approach?

Share Improve this question asked Jun 6, 2019 at 15:47 pumpkinfeetpumpkinfeet 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

So wp-json/wp/v2/users/<#id> is only going to give you back basic data on that user, which is what I don't think you are looking for. Where are you storing and editing consumer_key and consumer_secret?

The WordPress Rest API only makes certain pieces of data available out of the box. Sounds like you'd have to extend your REST API to get a hold of your pieces of data you need??

https://developer.wordpress.org/rest-api/extending-the-rest-api/.

After a little searching it looks like you might be in the WooCommerce world, so maybe this might help? And there is a link at the end of that how-to article to test those end points. Hope this helps!!

https://docs.woocommerce.com/document/woocommerce-rest-api/

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736252548a54.html

最新回复(0)