POST to a REST API from a wordpress form

I don’t know of a plugin that does it in a general way; for the most part, you’ll need to build something custom for each specific API you intend to communicate with. For your purposes, the key function will be wp_remote_post(), which is a wrapper for the POST method of WP’s HTTP class. (Use this … Read more

API integration with WordPress

Something like this works: $url=”https://xxx”; $body = array( ‘auth_token’ => ‘xxxxxx’, ‘list_id’ => ‘xxxxx, ‘name’ => ‘Office’, ‘campaign_id’ => ‘xxxxx’, ); $response = wp_remote_post($url, array( ‘body’=>$body, ‘sslverify’ => false // this is needed if your server doesn’t have the latest CA certificate lists ) ); if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response … Read more

List Table API – Safe to use?

Its not a private class, only its methods (some) are defined as private so as long as you extend the class and use your own instance of theme extention you should bs safe and fine.

Sending POST Request from server

‘wp_remote_post’ is the function you’re searching for. $response = wp_remote_post( $url, array( ‘method’ => ‘POST’, ‘timeout’ => 45, ‘redirection’ => 5, ‘httpversion’ => ‘1.0’, ‘blocking’ => true, ‘headers’ => array(), ‘body’ => array( ‘param1’ => ‘value1’ ), ‘cookies’ => array() ) ); if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); echo “Something went … Read more

How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?

I know it’s a bit far fetched, but might help. For anyone looking for WP REST API implementation with JWT, here’s our solution. Add it to your function.php add_action(‘rest_api_init’, ‘wp_rest_user_endpoints’); /** * Register a new user * * @param WP_REST_Request $request Full details about the request. * @return array $args. **/ function wp_rest_user_endpoints($request) { /** … Read more

External WordPress API

As of WordPress 4.7 (released December 2016), a REST API is provided out of the box on WordPress. As you’re probably aware, REST APIs are interfaced with by standard HTTP GET and POST requests, so if you have a WordPress 4.7 installation, you can access it at this URL, by plugging this into your browser: … Read more