Automattic/liveblog

API Insert

bambryan opened this issue · 0 comments

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)