Difference between revisions of "Rolepay Money System/API"
From Nexus
m (Added invite_to_group to the Register User Feature.) |
(Added export_user_data_json) |
||
Line 239: | Line 239: | ||
"owner" : "60f68ce2-0efe-4772-beef-823547416e6d" | "owner" : "60f68ce2-0efe-4772-beef-823547416e6d" | ||
}</pre> | }</pre> | ||
+ | |||
+ | = '''<span style="color:#4D5A93">Export User Data JSON</span>''' = | ||
+ | :This function will export your network users and provide it in the JSON format. | ||
+ | |||
+ | === Information required for API call === | ||
+ | * action (export_user_data_json) | ||
+ | * api_key | ||
+ | |||
+ | === HTTP API Call === | ||
+ | <pre>http://rolepay.nexus-sl.net/api/action/export_user_data_json/api_key/{API_KEY}/ GET</pre> |
Latest revision as of 17:15, 25 January 2017
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.
- Want to know what an API is? Look here on Wikipedia.
- To navigate this wiki better, please use the navigation on the right side of the screen.
API Features
- Check Key (Checks to make sure an API key is valid and exists.)
- 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)
- Validate Card (Used to make sure a card is a working card with an owner.)
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.
Check API Key
- This function will check to see if the API key specified exists and is valid.
Information required for API call
- action (check_key)
- api_key
HTTP API Call
http://rolepay.nexus-sl.net/api/action/check_key/api_key/{API_KEY} GET
Example Response
{ "success" : "api_key found" }
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
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
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
- from
- am (Amount to send)
HTTP API Call
http://rolepay.nexus-sl.net/api/action/take_money/api_key/{API_KEY}/from/{FROM_UUID}/am/{AMOUNT_TO_SEND} GET
Example Response
{ "success" : "shymus Roffo successfully sent money to Network Funds" }
Give Money
- This function operates like the Take Money feature, except it takes money from the network funds and gives it to the user.
- 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 (give_money)
- api_key
- to
- am (Amount to send)
HTTP API Call
http://rolepay.nexus-sl.net/api/action/give_money/api_key/{API_KEY}/to/{TO_UUID}/am/{AMOUNT_TO_SEND} GET
Example Response
{ "success" : "Network Funds successfully sent money to shymus Roffo" }
Server Information
- This function will get all the information about the network from the server.
Information required for API call
- action (server_info)
- api_key
HTTP API Call
http://rolepay.nexus-sl.net/api/action/server_info/api_key/{API_KEY} GET
Example Response
{ "network_key": "FFB8A3BF-D30B-A59A-F2F0-8AF6B3BE8AB8", "owner_information": { "owner_name": "shymus Roffo", "owner_uuid": "60f68ce2-0efe-4772-beef-823547416e6d" }, "information": { "transactions": "103", "funds": "49955", "start_ammount": null, "tax": "25", "cards_sent": "2", "users_registered": "2" } }
Send Card
- This function will send a card from the Network Server to the user specified.
Information required for API call
- action (send_card)
- api_key
- to (The uuid of the person to receive the card)
HTTP API Call
http://rolepay.nexus-sl.net/api/action/send_card/api_key/{API_KEY}/to/{USER_UUID} GET
Example Response
{ "success": "Card successfully sent" }
Register User
- This function will register a user into the network allowing them to make transactions.
Information required for API call
- action (register_user)
- api_key
- user_uuid(The user to register)
- send_card(Send a card to them?) (Optional)
- invite_to_group(Send Group Invite to Nexus?) (Optional) Default value is True. To prevent invites, switch value to False.
HTTP API Call
http://rolepay.nexus-sl.net/api/action/register_user/api_key/{API_KEY}/user_uuid/{USER_UUID} GET
Example Response
{ "success": "User has been successfully registered!" }
Ban User
- This function will ban a user from the network. This will prevent them from making transactions and registering.
Information required for API call
- action (ban_user)
- api_key
- user_uuid(The user to ban)
HTTP API Call
http://rolepay.nexus-sl.net/api/action/ban_user/api_key/{API_KEY}/user_uuid/{USER_UUID} GET
Example Response
{ "success": "User successfully added to the ban list." }
Unban User
- This function will remove a user from the ban list. This will allow them to register and make transactions in the network.
Information required for API call
- action (unban_user)
- api_key
- user_uuid(The user to unban)
HTTP API Call
http://rolepay.nexus-sl.net/api/action/unban_user/api_key/{API_KEY}/user_uuid/{USER_UUID} GET
Example Response
{ "success": "User successfully removed from the ban list." }
Validate Card
- This function can be used to make sure a card exists and is real and accepting transactions.
Information required for API call
- action (validate_card)
- api_key
- card_number
HTTP API Call
http://rolepay.nexus-sl.net/api/action/validate_card/api_key/{API_KEY}/card_number/{CARD_NUMBER} GET
Example Response
{ "success" : "Card found.", "owner" : "60f68ce2-0efe-4772-beef-823547416e6d" }
Export User Data JSON
- This function will export your network users and provide it in the JSON format.
Information required for API call
- action (export_user_data_json)
- api_key
HTTP API Call
http://rolepay.nexus-sl.net/api/action/export_user_data_json/api_key/{API_KEY}/ GET