Complete the steps described in the rest of this page, and in about five minutes you'll able to use knowledgeCoins on your site. Using this API user's of Knowledgecoin.com will able to pay you for certain activities in form of KnowledgeCoins (KC) and vice-versa.
To run a quickstart example you'll need:
- Access to the internet and a web browser, in order to authorize the sample.
- An API key registered with Knowledgecoin.com I.e having a Company wallet on KnowledgeCoin.com.
- An environment to run programs in your desired language.
Following are the steps through which you can able to Use KnowledgeCoins on your site:-
- 1. First signup as a company on Knowledgecoin.com in turn of which you get an identical API key, which represents your site for every API request. Register Here as a company.
- 2. You can Use API on your site for two functionality namely a) User to company Coin transfer and b) Company to user coin Transfer. Both Case valid only for registered user's of Knowledgecoin.com and not of API using site and are explained below:-
(A) User to company Coin transfer :-
In these case user can able to transfer KnowledgeCoins from there existing wallet to company wallet(associated with API key posted with request) For these functionality we need user authentication before coin transfer, Following parameters are needed in this case:
- API KEY(*) :- An API key associated with your wallet and on the basis of this key coins are transfer in your wallet. Send on our server as 'api_key'
- Number of coins (*) :- Total number of coins which have to transfer from user wallet into company wallet. Send on our server as 'coins'
- Success URL (*) :- The url on which user will be redirected after successful coin transfer, along with transfer details. Send on our server as 'success_url'
- Cancel URL (*) :- The url on which user will be redirected if an error is occurred or transfer is canceled by user. Send on our server as 'cancel_url'
(*) Needed parameters, Must be Posted on Url-http://www.knowledgecoin.com/site_login.php .
An simple example for this functionality is show below:-
<form name="api_details_form" id="api_details_form" method="POST" action="http://www.knowledgecoin.com/site_login.php">
<input type="text" name="api_key" value="YOUR_COMPANY_API_KEY">
<input type="text" name="success_url" value="http://example.com/success.php">
<input type="text" name="cancel_url" value="http://example.com/cancel.php">
<input type="text" name="coins" value="20">
<input type="submit" id="send_request" value="Send Request" >
After submiting above form user have to login on Knowledgecoin.com wallet and then user will able to either transfer or cancel the request. Screen-shot for a dummy user, after login will be shown below:-
Response in both case(Submit & Cancel) are given below:-
Response in case of 'Submit', on success.php:-
Script : <? php print_r($_POST); ?>
Array ( [transfer_status] => Success [username] => test [user_email] => email@example.com [no_of_coins] => 2 [transfer_time] => 13-07-02 11:43:13 [PHPSESSID] => 5741595fc284fbaab0b0f22375d940e4 )
Response in case of 'Cancel' or 'Logout', on cancel.php:-
Script: <? php print_r($_POST); ?>
Array ( [transfer_status] => Failure [message] => Transfer Canceled. Logout Successfully [transfer_time] => 13-07-02 11:53:43 [PHPSESSID] => 5741595fc284fbaab0b0f22375d940e4 )
(B) Company to user Coin transfer :-
In this case company can able to transfer KnowledgeCoins from there existing wallet to user wallet. For these functionality we need company authentication before coin transfer, in this case following parameter needed:
- API KEY(*) :- An API key associated with wallet through which coins are rewarded to users of Knowledgecoin Shop. Send on our server as 'api_key'. This key must be posted on the given URL- http://www.knowledgecoin.com/site_login.php.
Company can also able to reward users in terms of Knowledgecoins by directly hitting the above url, in there browser address bar, along with API key such as URL- http://www.knowledgecoin.com/site_login.php?api_key=YOUR_API_KEY.
In this case company has to login into company wallet before reward user for security purposes.