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

Help getting started, examples seem out of date #15

Closed
sla-te opened this issue Sep 12, 2020 · 2 comments
Closed

Help getting started, examples seem out of date #15

sla-te opened this issue Sep 12, 2020 · 2 comments

Comments

@sla-te
Copy link

sla-te commented Sep 12, 2020

Tried the below snippet and it asks me to put a callback. (TypeError: __init__() missing 1 required positional argument: 'callback')

from wordpress import API

wpapi = API(
    url="http://example.com",
    consumer_key="XXXXXXXXXXXX",
    consumer_secret="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    api="wp-json",
    version="wp/v2",
    wp_user="XXXX",
    wp_pass="XXXX",
    oauth1a_3leg=True,
    creds_store="~/.wc-api-creds.json"
)
@derwent-m-js
Copy link

Hey @chwba , could you post a full stack trace with line numbers? I don't believe this is from the WordPress API constructor.

@nioupola
Copy link

Hello,

You have to add the new argument to the API constructor:

wpapi = API(
    url="https://example.com",
    consumer_key="XXXXXXXXXXXX",
    consumer_secret="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    api="wp-json",
    version="wp/v2",
    wp_user="XXXX",
    wp_pass="XXXX",
    oauth1a_3leg=True,
    callback="https://example.com",
    creds_store="~/.wc-api-creds.json"
)

I forked it and fix the example and the encoding issue (#17): https://github.com/Synoptik-Labs/wp-api-python

@sla-te sla-te closed this as completed Aug 15, 2023
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

3 participants