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 ) ) {
// error handling goes here
}
$results = wp_remote_retrieve_body( $response );
// $results has the actual results in it
Related Posts:
- How to avoid loading wp-load.php from external php scripts?
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- Constructing requests with URL Query String in Python
- Yahoo! Finance CSV file will not return Dow Jones (^DJI)
- Is there a developers api for craigslist.org
- WordPress Rest API custom endpoint optional param
- Access WordPress API Outside of WordPress (command-line PHP)
- Create API for single sign-on with 3rd party site
- What is the best way to get directory path for wp-config.php?
- Retrieving pages with multiple tags using REST API
- External WordPress API
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- Sending POST Request from server
- List Table API – Safe to use?
- POST to a REST API from a wordpress form
- get WP-API by page id
- WordPress.org Support Forum API
- Custom route for WP-API gives “rest_no_route” value
- How to add a custom parameter to a WP API default route?
- Get more than 10 posts in a specific category with the wordpress api
- “rest_no_route” – Debug error
- utf8 encoding in json rest api
- Implementing the wp json-rest api
- How to Securely and remotely Create new user in wordpress using Rest API
- API in numbers?
- how to get nonce using json api
- What is the official way to consume the WordPress API? (api.wordpress.org)
- Stuck with wp_remote_post sending data to an external api on user registration
- How to get title tag of an external page with http api?
- How to Hit External REST POST API in WordPress? [closed]
- How to Increase WordPress JSON API Speed?
- WordPress JSON API Extend to Create Users [closed]
- External API to WP
- Headless WordPress – Issue with plugin path
- Can’t get POST data in API endpoint callback
- node-wpapi: how to handle authentication?
- Post body not working with wp_remote_post()
- Possible to use wordpress as publishing platform but programmatically inject content?
- Adding rest api endpoints to an old theme
- Develop REST API using WordPress for Android app [closed]
- Integrate ZOHO Recruit API?
- Allow logged in WordPress user to access 3rd party Laravel API via OAuth
- Sanitize Disqus API results?
- Best Practice for re-using API Data in WordPress?
- For using google api is it necessary to install the google client libraries for using Oauth 2 in wordpress installation?
- WordPress Google Calendar Oath 404
- Get non-rendered content from WP-API
- Calling an API to do authentication / user login
- cURL to install theme
- Enabling CORS with WordPress
- How do I query my WordPress posts on another HTML page using the WordPress Restful API?
- body_class REST field in WP-API
- Authenticating a user with the WP-API V2 in Postman
- WP OAuth Server “The grant type was not specified in the request”
- Submit comment via JSON from Android device
- How to send messages when a customer is registered
- WordPress keeps autoplaying my Youtube-Links no matter what I write
- Save external API calls in WordPress
- How to add an endpoint for my custom post type? /wp-json/wp/v2/posts is working but it didn’t in the custom post
- Integrating API in to WordPress
- How to convert and use JSON data from a remote WordPress server?
- JSON API and notification about registration
- How to get the post_id after you successfully create new post using xmlrpc api wp newPost?
- Implement External API into WordPress [closed]
- Integrate WooCommerce to PromoSoftware Rest API
- hybridauth (google OAuth integration) and WP problems
- term_exists returns NULL
- Consuming an external API to publish/post to wordpress
- WordPress API Create post content
- How to queue API requests with PHP in WordPress?
- WordPress API causing fatal error
- WordPress Theme/Plugin Information API Response to Text and Button
- Composer Installed Package with WordPress Rest API Endpoint
- Is there a way to get Google My Business photos on WordPress with the API or other?
- Call external API
- How to use filters/params in wordpress as headless cms api
- WordPress json rest api displaying 10 categories only
- Creating posts, containing data from remote API
- Passing data outside of WordPress possible?
- Periodically Query an external API on wordpress site
- Post to WordPress API using cURL and login cookies
- Extending the API I created to return category names
- Rest WP_Error always return null
- Posting data from Ionic app to WordPress
- WordPress REST API Endpoint (Authors and Categories latest posts)
- Instructure Canvas API with WordPress [closed]
- Best way to make a JSON API from WordPress?
- Encrypt API key [duplicate]
- Can I get the post id when trying to make a new post using xmlrpc?
- Using PHP Api wrapper within plugin. Wrapper uses name space
- REST API And Error Codes – No Message
- Querying Posts Using JSON API
- basic wordpress api endpoint to serve a key-value dictionary
- Is it possible to make website content available on another website?
- How to login via wordpress api and get user details?
- How many users/load can the rest API handle?
- How get JSON from external API on every page load if not existing in transient?
- Send PUT remote request with BuddyPress checkbox
- Using WordPress API to mass update posts freezes the server