Dear customers! We have updated our Privacy Policy: . An updated version of our Privacy Policy takes eff ect on May 25, 2018.

First API call

Find more details about API on the Getting started with API page.
Find more details about API SDK on the Topvisor SDK: PHP page.
Find more details about selection parameters on the basic request parameters page.

In the below example we'll retrieve the last 10 operations from the billing log.

Request

  • operator: get
  • service name: bank_2
  • method name: history

POST /v2/json/get/bank/history HTTP/1.1
Host: api.topvisor.com
Content-Type: application/json User-Id: %USER_ID% Authorization: bearer %USER_API_KEY% {"fields":["info","sum","date"],"orders":[{"name":"date","direction":"DESC"}],"limit":"10"}
curl \ -H 'Content-Type: application/json' \ -H 'User-Id: %USER_ID%' \ -H 'Authorization: bearer %USER_API_KEY%' \ -d '{"fields":["info","sum","date"],"orders":[{"name":"date","direction":"DESC"}],"limit":"10"}' \ "https://api.topvisor.com/v2/json/get/bank/history"
<?php use TopvisorSDK\V2 as TV; // instead of "..." write a path to the directory with the Topvisor SDK include('.../topvisorSDK/v2/topvisorSDK.php'); $TVSession = new TV\Session(); $selectorBankHistory = new TV\Pen($TVSession, 'get', 'bank_2', 'history'); $selectorBankHistory->setFields(['info', 'sum', 'date']); $selectorBankHistory->setOrders([ TV\Fields::genOrderData('date', 'DESC') ]); $selectorBankHistory->setLimit(10); $page = $selectorBankHistory->exec(); // catch error if(is_null($page->getResult())){ var_dump($page->getErrors()); return; } // is array of bank history var_dump($page->getResult());

Response

{"result":[{"info":"Keyword rank check for #NN","sum":"-0.23","date":"2018-05-21 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.38","date":"2018-05-14 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.94","date":"2018-05-13 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.49","date":"2018-05-15 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.66","date":"2018-05-17 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.76","date":"2018-05-13 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.23","date":"2018-05-15 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.01","date":"2018-05-16 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.36","date":"2018-05-21 08:35:45"},{"info":"Keyword rank check for #NN","sum":"-0.42","date":"2018-05-13 08:35:45"}],"limitedBy":10,"total":100}