Page Source for RatesApi

=begin options 

write = root 

=end options 

Q: How can I obtain rates list from my script written in PHP, Perl,
Java etc.? 

A: The simplest way for your to get rates is to call Diamondcard site
from your PHP scripts with the following parameters: 

method: GET 

URL: http://www.diamondcard.us/exec/voip-rep-acc-type 

secId=Site Name (your PE site name) 

Action=EXPORT 

grpId=2 - type of price list (2 - for IP phone rates, 

if you need rates for other access points contact us 

and we'll provide you proper Ids.) 

currency=USD - currency (CZK, EUR, GBP, etc...) 

This request will return price list for required access point (grpId)
from your default rate plan. Default rate plan can be configured in
your admin center at: PE -> options -> new user defaults ->
Rate Plan 

With this request you'll get CSV output which then can be represented
in any design. It contains the following columns: 

first column - Destination name 

second column - area codes separated with ';' 

third column - price 

Here is an example of complete working shell command: 

curl
"http://www.diamondcard.us/exec/voip-rep-acc-type?secId=corporate&c
urrency=USD&grpId=2&Action=EXPORT 

Contact us for more information about acceptable values for secId,
grpId and currency fields. 

If you want to load rates from different rate plans for every rate plan
you need to do the following steps: 

- create new sub account under your top PE account. 

- turn ON PE for this new account. 

- assign required rate plan to this new account - the rate plan which
rates you want to load. 

- login under this account and create new dynamic rate plan based on
wholesale rate plan with 0% profit. 

- configure this rate plan as a default rate plan. PE -> options
-> new user defaults -> Rate Plan 

- now you can use this account secId in HTTP request to get rates from
your scripts