Title: Rest API Plugin Development
Last modified: December 15, 2021

---

# Rest API Plugin Development

 *  [solvafabiola](https://wordpress.org/support/users/solvafabiola/)
 * (@solvafabiola)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/rest-api-plugin-development/)
 * Hello, I need to make new plugin for Sync between Epicor System and wordpress
   website.
    So my purpose is just that customers can see details of their order
   processing on wordpress website from Epicor System. As you know, Epicor is customer
   and order management system physical service. Epicor support team provide me 
   rest API document for this. I did not well about rest API integration with wordpress.
   How can send request data from WordPress to Epicor? Who have experiences on this?
   Who can guide me about this problem? Thank you for your help.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/rest-api-plugin-development/#post-15171223)
 * You can use any PHP code that can send appropriate HTTPS requests. `file_get_contents()`
   for example. However, I suggest using the [WP_Http class](https://developer.wordpress.org/reference/classes/wp_http/)
   to make such requests.
 * To present the data obtained from the API to the user, you have a few choices.
   You could hijack the normal template loading process through the “template_include”
   filter. Have it load a template from your plugin instead. Or you could generate
   output through either shortcode or custom block which the page author would include
   in their normal page content.
 *  Thread Starter [solvafabiola](https://wordpress.org/support/users/solvafabiola/)
 * (@solvafabiola)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/rest-api-plugin-development/#post-15173153)
 * Thank you for your reply. By the way, do you have any sample plugin that have
   functions what I want?
    If you have experiences about this function, let me know
   how to start this. Please let me know thank you.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/rest-api-plugin-development/#post-15175309)
 * There’s a lot of variability in how you might request data from an API. It depends
   on the API’s specification. Making a GET request is pretty straight forward. 
   You construct the required URL and use it in the `get()` method. Here’s some 
   example code to make a GET request to Google’s geocoding API:
 *     ```
               //assume the client app sent a POST request with an "address" field among other data
       	$addr = sanitize_text_field( urldecode( $_POST['address']));
       	$url = 'https://maps.googleapis.com/maps/api/geocode/json?address='.$addr.'&key=your-api-key-goes-here';
       	$http = new WP_Http();
       	$response = $http->get( $url );
       	echo $response['body'];
       ```
   
 * Making POST requests is more complicated, but similar in general concept.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Rest API Plugin Development’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/rest-api-plugin-development/#post-15175309)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
