|
 |
e-dinar Application Interface (API)
The e-dinar application interface is for developers only.
The e-dinar application interface allows execution of the following e-dinar functions: balance, history, spend, and try_spend. The e-dinar API is available at:
https://www.e-dinar.com/cgi/api.cgi
For each function specific POST variables must be submitted to this URL.
Before you can use the API you must configure your account so it can be accessed via the API. Login to your account and click on "Configure Account". In the section "API Access" you must check "enable API Access" and also fill in one or more IP addresses from which your automation script will access the e-dinar system. You can enter parts of the IP address but at least the first three parts must be present [i.e. 123.12.34.1 is valid, 123.12.34 is valid, 123.12 is not valid]. Access from any IP address is not supported for security reasons.
Following is a description of input and output variables to the individual API-functions. All API-functions will output an XML-document.
I. BALANCE
| in: |
| POST variable | value |
| username | [your username] |
| password | [your password] |
| account_number | [your account number] |
| transaction | balance |
| out: |
| XML-document with gold- and silver-balance in the following currencies: aed, chf, din [e-dinar for gold] / dir [e-dirham for silver], eur, gr [grams], jpy, oz [ounces], usd |
II. HISTORY
| in: |
| POST variable | value |
| username | [your username] |
| password | [your password] |
| account_number | [your account number] |
| transaction | history |
| startday | [1-31] |
| startmonth | [1-12] |
| startyear | [ex. 2007] |
| endday | [1-31] |
| endmonth | [1-12] |
| endyear | [ex. 2007] |
| paymentsreceived | [0/1] |
| paymentsmade | [0/1] |
| redemptions | [0/1] |
| inexchanges | [0/1] |
| outexchanges | [0/1] |
| fees | [0/1] |
| latest_first | [0/1] |
| out: |
| XML-document with the following fields for each transaction: |
| rn | [record number within current set] |
| account | [your account number] |
| amount | [amount (in currency)] |
| amount_gold | [amount of gold in ounces] |
| amount_silver | [amount of silver in ounces] |
| currency | [currency] |
| exchangerate | [exchangerate] |
| memo | [memo] |
| other_account | [account to or from which the transaction took place] |
| other_account_name | [name of other_account] |
| timestamp | [timestamp as unixtime] |
| transaction_id | [reference for this transaction] |
| type | [type of transaction: spend, inexchange, outexchange, fee, etc.] |
III. TRY_SPEND
| in: |
| POST variable | value |
| username | [your username] |
| password | [your password] |
| account_number | [your account number] |
| transaction | try_spend |
| to_account | [ex. 100000] |
| amount | [ex. 12.34] |
| currency | [din/dir/oz/gr/usd/eur/aed/chf/jpy] |
| metal | [gold / silver] |
| memo | [max. 200 characters] |
| out: |
| from_account | [sender account number] |
| payee_account_number | [recipient account number] |
| amount | [same as input] |
| currency | [same as input] |
| metal | [same as input] |
| exchangerate | [exchangerate at the time the spend was executed] |
| transfer_amount_oz | [actual amount which has been transferred in ounces] |
| memo | [same as input] |
| success | [1 for success] |
| transaction | try_spend |
| transaction_id | [can be used as input to spend transaction] |
IV. SPEND
| in: |
| POST variable | value |
| username | [your username] |
| password | [your password] |
| account_number | [your account number] |
| transaction | spend |
| to_account | [ex. 100000] |
| amount | [ex. 12.34] |
| currency | [din/dir/oz/gr/usd/eur/aed/chf/jpy] |
| metal | [gold / silver] |
| memo | [max. 200 characters] |
| transaction_id | [optional, value must come from a try_spend transaction] |
| out: |
| from_account | [sender account number] |
| payee_account_number | [recipient account number] |
| amount | [same as input] |
| currency | [same as input] |
| metal | [same as input] |
| exchangerate | [exchangerate at the time the spend was executed] |
| transfer_amount_oz | [actual amount which has been transferred in ounces] |
| memo | [same as input] |
| success | [1 for success] |
| transaction | spend |
| transaction_id | [reference number for this transaction] |
|