Fetching 'products' fails with a 403 error despite other successful API calls
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
Research direction
No repository files or tests are named. Start by running the provided Python examples and comparing the requests and 403 response for products with the successful orders and customers calls; done means establishing whether the wrapper or the WooCommerce endpoint causes the failure and documenting a reproducible next step.
Written by the indexing model from the issue text.
Description
Hello! Thanks for this library, though I'm having a little trouble retrieving products specifically. I have no trouble retrieving e.g. orders and customers.
This works:
import os
from woocommerce import API
WOOCOMMERCE_API_CONSUMER_KEY = os.environ.get('WOOCOMMERCE_API_CONSUMER_KEY')
WOOCOMMERCE_API_CONSUMER_SECRET = os.environ.get('WOOCOMMERCE_API_CONSUMER_SECRET') # noqa
wcapi = API(
url='https://xxxxxxxx.org',
consumer_key=WOOCOMMERCE_API_CONSUMER_KEY,
consumer_secret=WOOCOMMERCE_API_CONSUMER_SECRET,
version='wc/v3',
user_agent='PostmanRuntime/7.26.5'
)
data = wcapi.get('orders')
# data = wcapi.get('customers')
print(data.status_code)
Trying wcapi.get('products'), however, throws a 403 status code:
import os
from woocommerce import API
WOOCOMMERCE_API_CONSUMER_KEY = os.environ.get('WOOCOMMERCE_API_CONSUMER_KEY')
WOOCOMMERCE_API_CONSUMER_SECRET = os.environ.get('WOOCOMMERCE_API_CONSUMER_SECRET') # noqa
wcapi = API(
url='https://xxxxxxxx.org',
consumer_key=WOOCOMMERCE_API_CONSUMER_KEY,
consumer_secret=WOOCOMMERCE_API_CONSUMER_SECRET,
version='wc/v3',
user_agent='PostmanRuntime/7.26.5'
)
data = wcapi.get('products')
print(data.status_code)
Any help is much appreciated, thanks!
- Dominant language
- Python
- Stars
- 216
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from woocommerce/wc-api-python
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
woocommerce/wc-api-python#108 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
woocommerce/wc-api-python#106 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
woocommerce/wc-api-python#105 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
woocommerce/wc-api-python#104 ·
-
Json FormattingOpen
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
woocommerce/wc-api-python#103 ·
All issues in woocommerce/wc-api-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug difficulty:2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MakazhanAlpamys/Soup#3167 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
snap-stanford/Biomni#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jsboige/CoursIA#27768 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
rossant/awesome-math#206 ·