bmsimons / PowerShell-SMS

Send SMS messages using SMS APIs with PowerShell.
MIT License
5 stars 3 forks source link

Get balance powershell #1

Open Kopertje opened 6 years ago

Kopertje commented 6 years ago

Hi!

Love the script! Been using it for 2 weeks now. Just love it! Keep up the good work. We do have a question, is it possible to get the remaining balance after a SMS has been send? We are using Nexmo.

With kind regards, Kopertje

ikelso commented 6 years ago

Hi Kopertje,

I was looking for issues to contribute to for Hacktoberfest and had a quick look at the available Nexmo API. There is no direct API to get a remaining balance, but the information is returned after every send action. I tested this with the current module and I can see within the response data a remaining-balance property.

$response = Send-SMS -To ########## -From ########## -Message "Test" -Provider Nexmo

$response.messages."remaining-balance" will return your remaining balance after sending that message. Do you need this information displayed in a different way?