/** * TODO: type endpoint description here * @return mixed response from the API call*/ public function getStatsForSpecifiedChain() { //the base uri for api requests $queryBuilder = Configuration::BASEURI; //prepare query string for API call $queryBuilder = $queryBuilder . '/api/ethereum/api/'; //validate and preprocess url $queryUrl = APIHelper::cleanUrl($queryBuilder); //prepare headers $headers = array('user-agent' => 'APIMATIC 2.0', 'Accept' => 'application/json'); //prepare API request $request = Unirest::get($queryUrl, $headers); //and invoke the API call request to fetch the response $response = Unirest::getResponse($request); //Error handling using HTTP status codes if ($response->code < 200 || $response->code > 206) { //[200,206] = HTTP OK throw new APIException("HTTP Response Not OK", $response->code); } return $response->body; }
/** * TODO: type endpoint description here * @param string $addrs Required parameter: TODO: type description here * @return mixed response from the API call*/ public function createGetUnspentTransactionOutputsForMultipleAddresses($addrs) { //the base uri for api requests $queryBuilder = Configuration::BASEURI; //prepare query string for API call $queryBuilder = $queryBuilder . '/api/digibyte/api/utxo'; //process optional query parameters APIHelper::appendUrlWithQueryParameters($queryBuilder, array('addrs' => $addrs)); //validate and preprocess url $queryUrl = APIHelper::cleanUrl($queryBuilder); //prepare headers $headers = array('user-agent' => 'APIMATIC 2.0', 'Accept' => 'application/json'); //prepare API request $request = Unirest::post($queryUrl, $headers); //and invoke the API call request to fetch the response $response = Unirest::getResponse($request); //Error handling using HTTP status codes if ($response->code < 200 || $response->code > 206) { //[200,206] = HTTP OK throw new APIException("HTTP Response Not OK", $response->code); } return $response->body; }