How It Works

WPRM or WP RESTful APIs Manager  plugin is multi-purpose and can be generally used. It enables you to create, manage RESTful APIs data – whether it’s live currency exchange, weather forecasting data, google services data, or any other RESTful API – starting from establishing a connection to customizing templates and positioning the results.

What is APIs?

APIs are the wonderful method of  a business to enable exposure of content and services to internal and external audiences. If you used any twitter or Facebook app or any google API or service or even bought any thing online, so you are benefiting from APIs.

RESTful APIs are a way of fetching data using the URL as a request sender. But this time when you hit the url you will not return images or any interactive web page like the one you are reading from right now. Instead, it returns a data formatted page. This link is an example.

Key Features

  • Integrating most common APIs without researching for any custom integration.
  • Creating a connection with any restful API just copy the link and set the parameters.
  • Add dynamic data to your request such as post title, content, post meta and more.
  • Customize where to show the request output including using a shortcode.
  • Handling repeatable results and templating all types of results.
  • Ability to save request results in WordPress database tables.
  • Check request results with dummy data using initial request engine.
  • Functional helpers to check and display your template better.
  • Actions and filters for developers.
  • Ability to establish authorized requests with username and password.

How this plugin works?

  1. Establishing Connection:
    To make a request to the service server you have to use a URL which have 2 parts: base url ( and parameters (access_key=YOUR_ACCESS_KEY& currencies=AUD,EUR,GBP,EGP). The first part is static and the second is dynamic in most cases which means that you can change the results if you changed the parameters’ values.
    To establish a connection you need to know 3 thing about your API:

    • Its base url.
    • the results (response) format [Json, XML, etc ..].
    • The parameters Keys: the name of the parameters like access_key & currencies.
    • If your API are authorized with Email and password, so you can check the option of authorized connection and add username and password.
    • If you have any header extra data (sometimes api documentation need you to add authorization key in the header instead of the parameters), add as many as you like in the ‘Extra header data’ section.

    Once you now that, go to Restful Manager > Connection, add a new connection, give it a relevant name(you will need it soon)  and add the data as in the following GIF then click Save.

    Click to show full image with clear text
  2. Create request and Connection Settings:
    Next, we need to assign those parameters to suitable data so that the web service can query it and return the required data response.
    Now, go to Restful Manager > Requests, add a new request. and give it a name, then select the connection name that you have just created. When the parameters show up, populate the parameter values as you see in the following GIF.
    As you can see, there are a lot of options in Parameter values setting, most of them are to set the dynamic data retrieval which is one of the features that makes this plugin powerful(we will discuss it more in other tutorial).
    Once you populated those fields, click save.

    Click to show full
    Click to show full image with clear text
  3. Request’s Display Settings:
    After you save your values, you will find new sections are generated in the request page. One of them is ‘Display Settings’ which responsible for what you want to do with the response results:

    • Display Vs. Save then Display: WPRM give a chance to save selected items from the results in database or just display it in runtime. Most of times we will just choose ‘Display Only’ (‘runtime request’ in old versions) to only display the results.
    •  Where to display results: decide where to show the results template by selecting post type and then before or after content or you can just use a shortcode to add it wherever you like.
    • Showing repeatable results: select where or not to loop through results. This used only when you have a group of results that share the same group of parameter keys(will discussed in other example).
    • Start Checking dummy data: add all values in this section with full fixed(no dynamic work is here) dummy(but correct) data then click ‘check request’ once you see results check only the data that you want it to show up in your app or widget.

      Click to show full
      Click to show full image with clear text
  4. Templating Results:
    Now every thing is ready except how the results will look like!! so here comes the last section, ‘Template Settings’. You will find in it 2 parts:

    • Header or non-repeatable Template: this is the template that we’ll use. you can add text inline style and html to template you results. The links below the editor is a shorthand to help you copy and paste to the editor:
      • the results keys
      • Functional helpers like: if/ifExists/section
    • Repeatable template: if you have a repeatable data you will setup this template exactly as the above to be in for each repeated item at a time.
      Click to show full
      Click to show full image with clear text

      Save the changes once you finish.

To see the output, we’ll copy  and paste the shortcode from the display section in any text widget in your theme.

  • samples

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s