WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: JSON API] posting through API via curl

[Resolved] [Plugin: JSON API] posting through API via curl

  • lego123
    Member

    @lego123

    First off, I would like to say that this plugin is the bomb! Anyways aside from it being so awesome, I’m having trouble using create_post method via curl in php. I have created a class to access the API via cURL and will will log me via curl if necessary. I seem to have all the cookies required for authentication in my cookie jar but I keep getting the following error from the API “You need to login with a user capable of creating posts”. Does anyone know why I keep getting this error? I noticed that the wordpress_logged_in cookie is prefixed with #HttpOnly_[domain], is it possible that curl ignores these values? If cURL is ignoring this how can I resolve this issue? Any input is greatly appreciated, I need this working ASAP to complete a project.

    http://wordpress.org/extend/plugins/json-api/

Viewing 1 replies (of 1 total)
  • lego123
    Member

    @lego123

    Nvm, I found the issue. I had to set CURLOPT_COOKIEFILE to the same file that CURLOPT_COOKIEJAR points to in order to transmit the cookies back to the server, then I had to set CURLOPT_COOKIESESSION to false in my curl settings. Everything seems to be working perfectly now.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: JSON API] posting through API via curl’ is closed to new replies.