Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Need a POST call using REST to alert app when new post published WordPress


My company has an app and I have tasked with alerting a chat room in the app when a custom post type is published. I downloaded the WP REST API plugin and activated it on a test install. I have everything configured from the app side. But I have no idea what the next steps are from the WP end. Can someone point me to an example?

Answers (4)


dimadin answers:

This has nothing to do with WP REST API. WP REST API works by requesting something from WordPress and then delivering that data, both in JSON.

What you look for are webhooks, you need to create webhook when something happens in WordPress (new post published) that pings your URL. Another way is that your app directly communicates with WordPress. This all depends how your app works.


Rempty answers:

I was searching in google and found this maybe can help you


Luis Abarca answers:

You only need to use [[LINK href=""]]wp_remote_post[[/LINK]] and send the data to your server.

add_action('save_post_youposttype', 'send_post_data', 10, 2);

function send_post_data($post_id, $post)
$args = array(
'post_id' => $post_id,
'post_title' => get_post_field($post_id, 'post_title')

wp_remote_post('', $args);


Arnav Joy answers:

can you show me what you have currently ??