• I have a general question about WordPress that I am seeking guidance on.

    My college uses Smart Catalog ( https://www.academiccatalog.com/ ) to publish the academic catalog which contains information about our programs and courses of study. They offer API access to information in the catalog that we can re-purpose to pages on our website. I’m working with their developer to give us access to this information for pages that highlight our program offerings (the example of which I have included as the page I am working on).

    The catalog developer notes that the call wp_remote_get() is often used to bring in data from an external site. She has asked me to post the following questions as we seek a solution:

    1. How is the best way to get an API from an outside vendor (are there plug-ins needed to make this happen)?

    2. How do you apply wp_remote_get() with an outside API to access information?

    The company provides this information in different formats, including JSON.

    Can anyone suggest a way we might approach API integration or a develop we could talk with to discuss ways we might solve our problem?

    Thank you in advance for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 1. A plugin would need to be created for WordPress to access the data from the SmartCatalog IQ remote API, if one does not currently exist. The SmartCatalog IQ developer could likely help you with this.

    Here is the Plugin Handbook guide to HTTP API :
    https://developer.www.ads-software.com/plugins/http-api/
    Of particular interest is the “GETting data from an API” section, which provides some basic usage examples.

    2. The aforementioned “GETting data from an API” section of the HTTP API article in the Plugin Handbook provides examples of usage like :

    $response = wp_remote_get( 'https://api.github.com/users/blobaugh' );
    $body = wp_remote_retrieve_body( $response );

    If the data in $response is in JSON format, you can simply use json_decode to work with the $response data from there.

    You can find a number of tutorials on the web about how to use the HTTP API, including the wp_remote_get helper function. Here is a good series of articles on Tuts+ from noted developer Tom McFarlin, “A Look at the WordPress HTTP API,” which provides examples of both wp_remote_get and wp_remote_post :
    https://code.tutsplus.com/series/a-look-at-the-wordpress-http-api–wp-33794

    Hi i want to apply 99prints api on my wordpress site is there any plugin so that i can complete my site

    Hi Jyoti,

    Calling api with PHP is very easy, you can simply call the api with php and do what you want.
    Also it will depends on the conditions, what you want to do?
    Can you explore some conditions if possible?

    Also if you just want to get some data from api and want to add that to your page,
    Then get the data by url from php. you will get JSON, Then you need to parse it and then just go ahead with that…
    Thats easy, Let me know if you face any problem?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Integrating Third-Party API Calls In WordPress’ is closed to new replies.