Post
Topic
Board Announcements (Altcoins)
Re: NXT :: descendant of Bitcoin - Updated Information
by
erik__
on 27/01/2014, 02:38:10 UTC
Does anyone know how I can call an account balance in PHP?

I need something like...

Code:

$TokenResponse = json_decode(file_get_contents("http://localhost:7874/nxt?requestType=decodeToken&website=" . $rand . "&token=" . $token"));

$balance = json_decode(file_get_contents("http://localhost:7874/nxt?requestType=getBalance&account=". $TokenResponse[account]"));


pass account ID not token.
Code:
http://localhost:7874/nxt?requestType=getBalance&account=6669070404060812420

remember results are "multiplied by 100"

also, you'll probably be interested more in guaranted balance:
Code:
http://localhost:7874/nxt?requestType=getGuaranteedBalance&account=6669070404060812420&numberOfConfirmations=10


Right I understand the API, I was just giving an example -- what I meant was connections are refused when I send json requests, and curl is returning "NULL".

Echo the url and enter it into the browser.   Is the connection still refused?  Can you use a public node?  This seems to work for reading the balance:
http://node10.nxtbase.com:7874/nxt?requestType=getGuaranteedBalance&account=6669070404060812420&numberOfConfirmations=10