PHP API Wrapper

in #jse6 years ago

We have written a PHP wrapper for the API which is downloadable from:

https://jsecoin.com/downloads/JSEcoinPHPWrapper.zip

Here’s a demo video of a simple web app we built using it:

The API makes it as simple as possible to integrate JSEcoin functions into your web sites code. Here are some examples.

Example 1 – Load the api with an api key and print balance

include_once(‘jseapi.php’);
$jse = new jse_api(‘R8deSq23h5j2ha5bCjk2hrid7Dc1Yv8d52’); // Set api key
echo $jse->jse_balance(); // display balance json response

Example 2 – Export a coincode and decode json response to get coincode

include_once(‘jseapi.php’);
$jse = new jse_api(‘R8deSq23h5j2ha5bCjk2hrid7Dc1Yv8d52’); // Set api key
$result = $jse->jse_export(0.02);
$obj = json_decode($result);
echo $obj->{‘coinCode’};

Example 3 – Make a transfer

include_once(‘jseapi.php’);
$jse = new jse_api(‘R8deSq23h5j2ha5bCjk2hrid7Dc1Yv8d52’); // Set api key
echo $jse->jse_transfer(‘charity@jsecoin.com’,1,’from php’);

Note ‘R8deSq23h5j2ha5bCjk2hrid7Dc1Yv8d52’ isn’t a real API key, you can get yours from the settings page on the web platform at https://platform.jsecoin.com

Set the API access level to read or write depending on what you need. Outgoing transactions require write access.

Hopefully this will make it easier for PHP website developers to integrate cryptocurrency functions with their websites.

https://jsecoin.com/downloads/JSEcoinPHPWrapper.zip

Sort:  

Looks nice! Good call. This API should help with JSECoin adoption around the web.

I got to check out JSECoin thanks for sharing! Resteemed

I have already joined you and supporting you