API: clearmls.io – Sorting, Bearer

A request asked me, how to display data from the API clearmls.io sorted. One thing here is how to get access to the data. The other how to display that data.

Authentication at docs.clearmls.io
What the API expects is described here. At the free plugin you can set the API_KEY at the plugin setup. The free plugin can’t sort the json-data, but together with the Plugin TableSorter a sortable Table is possible, see here.

Authorization: Bearer API_KEY

With the pro plugin it’s like this:
Create a new pro plugin template with the following settings.
The “curloptions” set the http-header. “sortbyjsonfield” sorts for the latitude-values. When saving the template you get a TEMPLATE_ID of this template:

template: 
{% for i in properties | sortbyjsonfield("latitude,desc,num") %}
latitude: {{i.latitude}}, postal_code: {{i.postal_code}}<br>
{% endfor %}

url:
https://api.clearmls.io/properties

method:
curlget

curloptions:
CURLOPT_HTTPHEADER=Authorization:Bearer API_KEY

Use the new TEMPLATE_ID in the shortcode on a page or post:

[jsoncontentimporterpro  id=TEMPLATE_ID]

API: trustatrader.com

Request via wordpress.org: “no feed coming through”

Question: “Can’t get raw data from this feed to show up at all. Not sure what I am missing: https://www.trustatrader.com/api/consumer-reviews?username=CWYAONE&format=json

I saved this JSON to http://api.json-content-importer.com/extra/json/blog/trustatrader_com.json to have this example independent from external sites.

Continue reading “API: trustatrader.com”