Difference between revisions of "Rolepay Money System/API"

From Nexus
Jump to: navigation, search
m (Protected "Rolepay Money System/API" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
m
Line 68: Line 68:
 
* from
 
* from
 
* am (Amount to send)
 
* am (Amount to send)
* t (Include Taxes) <small>'''(Optional)'''</small>
+
* t (Include Taxes, True or False) <small>'''(Optional)'''</small>
  
 
=== HTTP API Call ===
 
=== HTTP API Call ===
Line 79: Line 79:
 
<pre>{
 
<pre>{
 
     "success" : "lukeman Bade successfully sent money to shymus Roffo"
 
     "success" : "lukeman Bade successfully sent money to shymus Roffo"
 +
}</pre>
 +
 +
= '''<span style="color:#4D5A93">Take Money</span>''' =
 +
:This function will take money from the user and place it into general funds.
 +
:'''This function does not have protection, it is advised that you create it on a separate API key and monitor the amount of calls that are made to that key.'''
 +
 +
=== Information required for API call ===
 +
* action (take_money)
 +
* api_key
 +
* to
 +
* am (Amount to send)
 +
 +
=== HTTP API Call ===
 +
<pre>http://rolepay.nexus-sl.net/api/action/transfer_money/api_key/{API_KEY}/to/{TO_UUID}/am/{AMOUNT_TO_SEND} GET</pre>
 +
 +
=== Message Linked API Call ===
 +
<pre>llMessageLinked(LINK_SET, 0, "user_info^{API_KEY}^{TO_UUID}^{AMOUNT_TO_SEND}", NULL_KEY);</pre>
 +
 +
=== Example Response ===
 +
<pre>{
 +
    "success" : "shymus Roffo successfully sent money to Network Funds"
 
}</pre>
 
}</pre>

Revision as of 23:25, 27 May 2014

← Rolepay Money System

API Documentation

The API Documentation is only relevant to version number 2.0.0. Anything older than that will not work on this page.
This API is a read, write, and update API. In order to use the API you must get an API key from the network you intend on making changes to via the API.
To navigate this wiki better, please use the navigation on the right side of the screen.

API Features


  • User Information (Gets the users account information)
  • Transfer Money (Send money from one person to the other)
  • Take Money (Takes money from someone then places into network funds)
  • Give Money (Takes money from the Network Funds and gives it to someone)
  • Server Information (Gets the server information)
  • Send Card (Give someone a card)
  • Register User (Registers a user into the network)
  • Ban User (Adds a user to the ban list for the network)
  • Un-Ban User (Removes a user to the ban list for the network)

How to make an API Call


Before you can make a call to the API you must have keys which will be given to you from the network owner on the web interface.
There are two way to make a call to the API. Either through HTTP or llMessageLinked();
If you are going to use llMessageLinked you must request an API script from the network owner.
When making a call via HTTP just use a simple GET request to the URLs listed under the functions listed below.

User Information

This function will get the user's account information.
The information that can be accessed are as followed.
  • User's Name
  • Account Balance
  • Card Number
  • If the user is Banned.

Information required for API call

  • action (user_info)
  • api_key
  • user_uuid

HTTP API Call

http://rolepay.nexus-sl.net/api/action/user_info/api_key/{API_KEY}/user_uuid/{USER_UUID} GET

Message Linked API Call

llMessageLinked(LINK_SET, 0, "user_info^{API_KEY}^{USER_UUID}", NULL_KEY);

Example Response

{
    "user" : "shymus Roffo",
    "info" : {
        "card_number" : "123 456 789 101",
        "balance" : "200",
        "banned" : false
    }
}

Transfer Money

This function will transfer money from person A to person B.
This function does not have protection, it is advised that you create it on a separate API key and monitor the amount of calls that are made to that key.

Information required for API call

  • action (transfer_money)
  • api_key
  • to
  • from
  • am (Amount to send)
  • t (Include Taxes, True or False) (Optional)

HTTP API Call

http://rolepay.nexus-sl.net/api/action/transfer_money/api_key/{API_KEY}/to/{TO_UUID}/from/{FROM_UUID}/am/{AMOUNT_TO_SEND} GET

Message Linked API Call

llMessageLinked(LINK_SET, 0, "user_info^{API_KEY}^{TO_UUID}^{FROM_UUID}^{AMOUNT_TO_SEND}", NULL_KEY);

Example Response

{
    "success" : "lukeman Bade successfully sent money to shymus Roffo"
}

Take Money

This function will take money from the user and place it into general funds.
This function does not have protection, it is advised that you create it on a separate API key and monitor the amount of calls that are made to that key.

Information required for API call

  • action (take_money)
  • api_key
  • to
  • am (Amount to send)

HTTP API Call

http://rolepay.nexus-sl.net/api/action/transfer_money/api_key/{API_KEY}/to/{TO_UUID}/am/{AMOUNT_TO_SEND} GET

Message Linked API Call

llMessageLinked(LINK_SET, 0, "user_info^{API_KEY}^{TO_UUID}^{AMOUNT_TO_SEND}", NULL_KEY);

Example Response

{
    "success" : "shymus Roffo successfully sent money to Network Funds"
}