• Resolved dsawyers

    (@dsawyers)


    We’re building a new website where the content that needs the notification is going to be generated by a 3rd party and published using the rest API. When we manually create a post, the notification goes out without issues, but when I test creating a post with the API, the post is created, but no notification is sent out.

    our endpoint is /wp/v2/insider_tips/ and we’re pushing the status, title, content and author.

    is there a function we can add that triggers the notification when the endpoint successfully creates a post?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @dsawyers,
    Thanks for your message.

    I think you need to ensure that you’re creating the post using a WP user in WP-CLI, not just assigning an author.

    I think it should then work for you.

    Let me know how you get on.

    Thread Starter dsawyers

    (@dsawyers)

    I’m not sure I understand. I’m using rest API (not wp-CLI) which requires basic auth using a user account and token, so I’m creating the post as me. I don’t see any other options in REST to send the WP user.

    https://developer.www.ads-software.com/rest-api/reference/posts/

    Is there something else specific to REST API that needs to be sent with the post to trigger the notification?

    Thread Starter dsawyers

    (@dsawyers)

    it looks like the rest API doesn’t trigger certain function (like save_post), but I can create an action that triggers on rest_insert. I just haven’t figured out the right action to call the notification.

    Plugin Author bnfw

    (@voltronik)

    Hi @dsawyers,
    Ok, let me know how you get on.

    Thread Starter dsawyers

    (@dsawyers)

    you don’t have any advice on what BNFW function I can call from a custom script to trigger that notification?

    Plugin Author bnfw

    (@voltronik)

    Hi @dsawyers,
    The only advice I can give at this stage, because it’s custom code, is to take a look at this support document on the subject:
    https://betternotificationsforwp.com/documentation/compatibility/using-bnfw-with-the-wp-rest-api/

    Let me know if this helps.

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