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
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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 Formatting Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
woocommerce/wc-api-python#103 ·
All issues in woocommerce/wc-api-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
use-agent-os/agent-os#3314 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AiursoftWeb/AnduinOS-2#19 ·