Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use API when site is not placed at main domain #65

Open
TinQ0 opened this issue Mar 20, 2021 · 1 comment
Open

Unable to use API when site is not placed at main domain #65

TinQ0 opened this issue Mar 20, 2021 · 1 comment

Comments

@TinQ0
Copy link

TinQ0 commented Mar 20, 2021

I have a test site located at a certain page "example.com/testsite".

But when trying to use the API I can only get an 'woocommerce_rest_cannot_view' 401 error.

Even disabling all security or using the legacy api doesn't yield success.

Is what I'm doing possible or should I give up?

@lakshaychopra
Copy link

Hello,
You might try changing the user agent something like this
wcapi = API( url="your site", consumer_key="consumer_key", consumer_secret="consumer_secret", version="wc/v3", user_agent="Mozilla/5.0", )
This might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants