Help - Search - Members - Calendar
Full Version: API check remaining credit
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
ticino
Can I use API to know the remaining credit of Asia 200 ?
If not , do Skype have the plan to develop this API ?
Thank You!!

TheUberOverlord
QUOTE (ticino @ Thu Jun 12 2008, 02:34)
Go to the original post
Can I use API to know the remaining credit of Asia 200 ?
If not , do Skype have the plan to develop this API ?
Thank You!!


Using Skype4COM you can get:

CODE
skype.get_Profile("PSTN_BALANCE_CURRENCY").ToString();
skype.get_Profile("PSTN_BALANCE").ToString();


$5.07 U.S. dollars would display as 507
Balance currency would display as USD

Both are shown in use here: http://forum.skype.com/index.php?showtopic=142821
Avo Nappo
There is also some relevant sample code up at:

https://developer.skype.com/Docs/Skype4COM/...le/CallCost_pas
ticino
Skype4Com only show the remaining credit of SkypeOut.
But I want to know the remainig minutes of Asia 200.
There are 200 minutes to call to mobiles in Asia 200.
If 200 minutes are exhausted , I want to change another account to dial.
Thank You!!
TheUberOverlord
QUOTE (ticino @ Thu Jun 12 2008, 21:50)
Go to the original post
Skype4Com only show the remaining credit of SkypeOut.
But I want to know the remainig minutes of Asia 200.
There are 200 minutes to call to mobiles in Asia 200.
If 200 minutes are exhausted , I want to change another account to dial.
Thank You!!


Currently, You would need to start the call then check the rate of the call as Avo's Example link shows:

CODE
if CurrentCall.Rate <> 0 Then
  Begin
   // Note that duration is given in seconds while the Rate is minute-based. Hence division by 60
   Cost := CurrentCall.Duration * (CurrentCall.Rate / (CurrentCall.RatePrecision * 10) / 60);
   Label1.Caption := 'Call cost: ' + FloatToStrF(Cost, ffFixed, 10, 2) +  ' ' + CurrentCall.RateCurrency;
  End
   Else Label1.Caption := 'This call is free';
End;


Note: The first 5 seconds of calls is not charged, you should be able to FLAG that Skype Name as having NO Asia 200 minutes ("Left for the month") so that you don't use that Skype name Again until the next month and use another Skype name before 5 seconds goes by.

I would NOT suggest always trying to see a call rate to see if it equals "0" when you already tried before and know it will not this month.

First make sure that the telephone number being called is in fact covered by Asia200 then do something like this:

CODE
If (SkypeNameStillHasAsia200ThisMonth = true) Then
   Begin
   // Start Skype Call
   If CurrentCall.Rate > 0 Then
      Begin
      CurrentCall.Finish();
      SkypeNameStillHasAsia200ThisMonth := false;
      // Now also Flag Skype Name as no more Asia 200 minutes for
      // X more days ("Days remaining in current month")
      // Use another Skype name to make this call.
      End;
   End;
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.