• Hello,

    Thank you in advance for answer. I am experiencing the next problem:
    I’ve added a self-hosted wordpress 4.7.2 site and installed latest JetPack(4.5) plugin.
    I can publish new posts via admin panel from wordpress.com. It sends xmlrpc request with ‘internal’ param set to 1. So Jetpack is not checking it hard and my post is created with no problems.
    But when I try to create post via API, fo example: https://public-api.wordpress.com/rest/v1.2/sites/68055767/posts/new
    content=test&title=test
    (I supply Authorization header too for wordpress.com)
    it sends request to xmprpc with the exactly same tokens and etc. But without internal param set. So Jetpack performs hmac check:
    if ( ! hash_equals( $hmac, $verify ) ) {
    return false;
    }
    And it fails! I receive:
    {“error”:”jetpack_response_error”,”message”:”The Jetpack site encountered an error and could not process the API request.”}

    Speed of the site is definitely not an issue…

    • This topic was modified 9 years, 3 months ago by skoba.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    I’m having some trouble when trying to reach your site. Most of my requests time out at one point or another during the process:

    [http_request_failed] cURL error 28: Connection timed out after 10001 milliseconds

    I have similar issues when trying to access your site’s XML-RPC file in my browser; it times out every time:
    https://i.jeremy.hu/mobidev.png

    Could you take a look and make sure your site is always accessible?

    Let me know how it goes.

    Thread Starter skoba

    (@skoba)

    Jeremy, thank you for the answer. Can you please attach some info on how do you test the ‘http://wordpressblog.mobi-dev.com/xmlrpc.php’?
    Because I tried accessing it via browser,
    via anonymous proxy in different location,
    via http://requestmaker.com/
    and it didn’t fail even at least once.
    In browser it says: XML-RPC server accepts POST requests only.

    Are you sending some data or doing performance test which slows the system ?

    Thank you.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    It looks like you’ve made some changes; I am now able to access your site’s XML-RPC file in my browser.

    Unfortunately, I still receive the same timeout error whenever I try to make any kind of POST request to the file from our servers; whether the requests are authenticated or not, I receive that timeout error.

    I’ve just made a few test requests, so you should be able to see them in your logs.

    It might be worth checking your server’s security settings, to make sure you’re not blocking specific XML-RPC requests via tools like Mod Security.

    I hope this helps.

    Thread Starter skoba

    (@skoba)

    If you don’t mind – it’s hard to look through logs, can you please provide:
    1) url
    2) headers
    3) data
    to send via post so I can reproduce this timeout.
    Thank you

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    It looks like you’ve fixed the issue; I don’t receive any time outs anymore. Could you let me know what was causing the issue?

    Thread Starter skoba

    (@skoba)

    I didn’t change anything at all.
    By the way from wordpress.com admin panel I can create post 100% times. So no timeouts from wordpress.com to self hosted wp site.
    Can we now investigate something about original issue? Thank you.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    I didn’t change anything at all.
    By the way from wordpress.com admin panel I can create post 100% times. So no timeouts from wordpress.com to self hosted wp site.

    There are no timeouts at all anymore, so something definitely changed! πŸ™‚ I can now access your site from WordPress.com properly, and all WordPress.com REST API calls return data.

    Could you let me know what happens if you try to create a post via the API console here?
    https://developer.wordpress.com/docs/api/console/

    If it works there as well, but still not in your app, I’ll need to see your app and how you authenticate to be able to dig in a bit deeper. If you’d like you can send it to me via this contact form and mention this thread so I can follow up with you.

    Thank you!

    Thread Starter skoba

    (@skoba)

    No problem, I will try and get back to you as soon as possible.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Cannot create new post via WordPress public API’ is closed to new replies.