• Paul de Wouters

    (@pauldewouters)


    Hi John,

    I’m trying to debug a custom endpoint by doing a POST request, as an authenticated superadmin with an application password. I tried the first method with _wpnonce in the request URL, but I got an error “rest_cookie_invalid_nonce”
    With the app password, the request is successful but I don’t receive any QM data, the plugin is active and I can see the output in the admin with this user.

    Any ideas? Does the endpoint callback have to send back a specific type? I’ve tried new WP_REST_Response and an array.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Hi Paul!

    If you’re sending a valid application password then you don’t also need a nonce for authentication.

    Are you performing an enveloped request? That’s the main thing that’s needed to see the full output otherwise you’ll only see an overview in the HTTP response headers.

    Have you read through https://querymonitor.com/wordpress-debugging/rest-api-requests/ ?

    Thread Starter Paul de Wouters

    (@pauldewouters)

    Thanks for replying so fast! ??

    I’m not sure why, I’m making a request from VS Code thunderclient – and this works fine https://mysite.local/wp-json/wp/v2/users?context=edit but I don’t get any QM headers or data in the response. I do see them if I open the rest api endpoint in the browser while logged in to the site

    Jason

    (@galapogos01)

    Hey Paul did you resolve this?

    I too am using an external client (curl in my case) and can not work out how to get QM to include results. I am trying to hit the WooCommerce API.

    The QM documentation uses WP specific buzzwords and I am having trouble understanding what is expected. For example when I visit /wp-admin/admin-ajax.php?action=rest-nonce I get a response of 0, not a nonce I can use.

    • This reply was modified 1 month ago by Jason.
    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    I’ve seen this reported a few times now and it seems that QM might not output its data when using an application password. It works as expected if you use regular authentication cookies plus a nonce. I will be looking into this properly soon.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.