PHP code example of ourenergy / ea-api
1. Go to this page and download the library: Download ourenergy/ea-api library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ourenergy / ea-api example snippets
use OurEnergy\Emi\Prices\Factories\ClientFactory;
$subscriptionKey = "your subscription key";
$client = ClientFactory::create("rtp", $subscriptionKey);
$prices = $client->getPrices();
print_r($prices);
$prices = $client->getPrices(
new DateTime("2019-01-01 00:00:00"),
new DateTime("2019-01-01 00:30:00")
);
print_r($prices);
$serviceName = "Your service";
$callbackUrl = "http://yourwebsite.com";
$client->subscribe($serviceName, $callbackUrl);
$client->unsubscribe($callbackUrl);
$subscriptions = $client->getSubscriptions();
print_r($subscriptions);
use OurEnergy\Emi\Icp\Factories\ClientFactory;
$subscriptionKey = "your subscription key";
$client = ClientFactory::create($subscriptionKey);
$icp = $client->getById("0000143418TRD9F");
echo $icp->getNetwork()->getParticipantId();
$icps = $client->getByIdList([
"0000143418TRD9F",
"0000130040TR3DB"
]);
print_r($icps);
$icps = $client->search("260", "Tinakori");
print_r($icps);