Author

Topic: Developing an API system, would appreciate peer review and feedback (Read 295 times)

hero member
Activity: 595
Merit: 503
workingForBitcoins.com
In the coming months, I am going to create and document an API system that will make it super easy for developers to integrate EPC into their games. I will make it open source and post it on GitHub. I will host the site and service and give 1,000,000 EPC to help start them out, after verification.


Here is a list of API calls that I plan to implement:


DATABASE (limited)

client (developer)
-company_name
-email
-phone
-website
-verified
-epc_address
-epc_balance

client_employee
-name
-email
-phone

client_app
-name
-has_android_version
-has_iphone_version

client_user
-client_app_id
-epc_balance

client_transaction
-action(add|subtract)
-amount
-date

client_user_transaction
-source(user|client)
-action(add|subtract)
-amount
-date

WEBSITE

sign up
-company name
-email

Add APP
-name
-has Android
-has iPhone

dashboard:
-Company Name (edit)
-Email (edit)
-EPC Wallet ID
-EPC Balance
-Withdraw
-List of Apps (Add|remove)

Transaction
-List of transaction (Date|App ID| Source | Action | Amount)

Users
-List of Users (User ID | App ID | Wallet ID | Balance | Date Created)

API CALLS

/user/create (client_id|client_app_id)
- if successful returns client_user_id | wallet_id (the wallet ID main function is so that users can add to their balance if they wish to do so)
- errors
- - invalid client_id
- - invalid client_app_id
- - system error

/user/deposit (client_id|client_user_id|amount) - subtracts from client's balance adds to user's balance
- if successful returns TRUE
- errors
- - invalid client_id
- - invalid client_user_id
- - invalid amount
- - insufficient balance (client's balance is not enough to cover the transaction)
- - system error

/user/withdrawal (client_id|client_user_id|amount) - subtracts from users's balance adds to clients's balance
- if successful returns TRUE
- errors
- - invalid client_id
- - invalid client_user_id
- - invalid amount
- - insufficient balance (users's balance is not enough to cover the transaction)
- - system error

/user/get_balance (client_id|client_user_id) - get users balance
- if successful returns returns balance
- errors
- - invalid client_id
- - invalid client_user_id
- - system error

/get_balance (client_id) - get client's balance
- if successful returns returns balance
- errors
- - invalid client_id
- - system error


I would appreciate any feedback and/or suggestions. This is a very high level view of the API system, if you see anything missing, or have a suggestion, let me know. I would be more than happy to modify this blue print.


Thank you
Jump to: