wcapi.get('orders') returns 403
See original GitHub issueI connect to my WooCommerce webshop through the WooCommerce REST API Python wrapper,
I.e,
from woocommerce import API
wcapi = API(
url="https://mywebshop.whatever",
consumer_key="ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
consumer_secret="cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
wp_api=True,
version="wc/v1"
)
API has read/write access.
All worked fine for months up to yesterday.
Problem
Since yesterday latest_order = wcapi.get('orders').json()
returns a JSONDecodeError: Expecting value
. Also, wcapi.get('orders')
returns a <Response [403]>
.
I don’t know what’s causing this all of a sudden and I’m not sure how to solve it either.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:20 (9 by maintainers)
Top Results From Across the Web
Woocommerce REST API error 403 - WordPress.org
This error generally means that the server could find the resource, but unable to grant access to the requested resource for some reason....
Read more >Wordpress API returns 403 for PUT only - Stack Overflow
Take a look at yout .htaccess file. If it looks like this: <Limit GET POST> order deny,allow deny from all allow from all...
Read more >How to Fix a 403 Forbidden Error in WooCommerce?
This error is most commonly caused by permission issues—for example, when a file or directory is not writable by the web server's user...
Read more >Introduction – WooCommerce REST API Documentation
GET /orders?offset=5. Page number is 1-based and omitting the ?page parameter will return the first page. The total number of resources and pages...
Read more >Receiving 403 Forbidden When Using REST API In C# - Orion ...
If the credentials are wrong, you will get 403 Forbidden. ... MapStudioFiles WHERE IsDeleted = False ORDER BY FileName" $SwisConnection = Connect-Swis ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
When specifying the
user_agent
, the request goes through:This got fixed by https://github.com/woocommerce/wc-api-python/pull/57, thanks @Evert-Arends for your help. Note that I’ll release 3.0 soon, we’ll drop support to unsupported Python releases. The older releases of this lib seems to be still working with Python 2.7 in my tests.