[Habbo]Phoenix API[Habbo]

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
Hello, DevBest!

I've created a JSON API for hotel's that wish to allow users to use hotel data off-site.
With this, users will be able to create their own scripts using their player data.
They could create player cards etc...
Currently, the API let's users choose whether they want to be able to access their
data by using the API (for privacy reasons).
On line 247 in api.php, there is a parameter "false".
False means the API won't check the database to see if users don't wish to
change the API settings (not let them choose whether they want their data accessible via the API)
but just force the data to be visible.
If you wish to allow them to choose, change the parameter to true and run the included SQL
file into the database.
There isn't a way for them to change this on the site currently, so you'll
have to add something on the settings page(i.e. radio buttons or checkbox).
Currently, data users can access via the API is:-

Username
Motto
Credits
Online Status (0, 1)
Respect
Achievement
Room Visits
Gifts Given
Gifts Received
User Look

I have only tested this with Phoenix EMU.
If you need any help, send me a message or reply to this thread.
Thanks!

V4.0:

Example usage with PHP:
PHP:
<?php
$request = "api.php?username=my_username";
$ci = curl_init($request);
curl_setopt($ci,CURLOPT_RETURNTRANSFER, TRUE);
$input = curl_exec($ci);
curl_close($ci);
$result = json_decode($input, true);
echo $result['user']['username'];
?>

Example usage with JavaScript:
Code:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$.getJSON(
    'api.php?username=my_username',
    function(data) {console.log(data['user']['username'])}
);
</script>

Screenies.
JSON
api_json.png
 

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
Thanks, Mega!
Made some changes to the latest release.
In the configuration file, there is a new option called "$auth_hotel".
Setting this to true will no longer output an error if there is no username
parameter in the request to api.php, instead it will output hotel data.

Here is what is currently given in the request:

6dd9b7e36c66370dba38d07ef5fabbd9.png


However, if you don't want this information to be seen by users, just set
$auth_hotel to false.

I also added the users "look" to the API request, so they can make requests
to the Habbo imager.

Sorry, I forgot to add the API.SQL file for those wishing to allow users to opt-out of the API.
URL:
Remember: If you're going to use this, make sure you add
an option for them to change whether they want their
data accessible via the API somewhere in their
settings page.
 

Users who are viewing this thread

Top