Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can incorporate REST services into BMP Interactions

Cheese

Code Block
themeRDark
languagephp
titleSample Interaction Code
linenumberstrue
$debug = true;
$str = '';
$url = 'http://api.geonames.org/countryCode?lat=' . $args[0] . '&lng='
 . $args[1] . '&username=demo&type=JSON';
$t->fetch($url);
$data = json_decode($t->result, true);
if($debug)
 $str = "URL: {$url}<br /><br />

JSON: {$t->result}<br /><br />";

return $str . "Country name is {$data[countryName]}
<br />Country code is {$data[countryCode]}";

...