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

API Insert #624

Open
bambryan opened this issue Feb 5, 2019 · 0 comments
Open

API Insert #624

bambryan opened this issue Feb 5, 2019 · 0 comments

Comments

@bambryan
Copy link

bambryan commented Feb 5, 2019

Is there a way to insert a new entry via api? I use this code for another plugin to send emails when my script is finishing it's run.

headers = {'Content-Type': 'application/json',}
params = (('action', 'newsletters_api'),)
data = '{"api_method":"send_newsletter","api_key":"key","api_data":{"history_id":"1234"}}'
r = requests.post('/wp-admin/admin-ajax.php', headers=headers, params=params, data=data)

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

1 participant