Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
[Habbo]Phoenix API[Habbo]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NSA" data-source="post: 223684" data-attributes="member: 10034"><p>Hello, DevBest!</p><p> </p><p>I've created a JSON API for hotel's that wish to allow users to use hotel data off-site.</p><p>With this, users will be able to create their own scripts using their player data.</p><p>They could create player cards etc...</p><p>Currently, the API let's users choose whether they want to be able to access their</p><p>data by using the API (for privacy reasons).</p><p>On line 247 in api.php, there is a parameter "false".</p><p>False means the API won't check the database to see if users don't wish to</p><p>change the API settings (not let them choose whether they want their data accessible via the API)</p><p>but just force the data to be visible.</p><p>If you wish to allow them to choose, change the parameter to true and run the included SQL</p><p>file into the database.</p><p>There isn't a way for them to change this on the site currently, so you'll</p><p>have to add something on the settings page(i.e. radio buttons or checkbox).</p><p>Currently, data users can access via the API is:-</p><p> </p><p>Username</p><p>Motto</p><p>Credits</p><p>Online Status (0, 1)</p><p>Respect</p><p>Achievement</p><p>Room Visits</p><p>Gifts Given</p><p>Gifts Received</p><p>User Look</p><p> </p><p>I have only tested this with Phoenix EMU.</p><p>If you need any help, send me a message or reply to this thread.</p><p>Thanks!</p><p> </p><p>V4.0: <a href="http://sharefa.st/view/4bd7yLKDt720" target="_blank">http://sharefa.st/view/4bd7yLKDt720</a></p><p> </p><p>Example usage with PHP:</p><p>[PHP]<?php</p><p>$request = "api.php?username=my_username";</p><p>$ci = curl_init($request);</p><p>curl_setopt($ci,CURLOPT_RETURNTRANSFER, TRUE);</p><p>$input = curl_exec($ci);</p><p>curl_close($ci);</p><p>$result = json_decode($input, true);</p><p>echo $result['user']['username'];</p><p>?>[/PHP]</p><p> </p><p>Example usage with JavaScript:</p><p>[CODE]<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script></p><p><script type="text/javascript"></p><p>$.getJSON(</p><p> 'api.php?username=my_username',</p><p> function(data) {console.log(data['user']['username'])}</p><p>);</p><p></script>[/CODE]</p><p> </p><p><strong>Screenies.</strong></p><p><strong>JSON</strong></p><p><strong><img src="http://s21.postimg.org/3n7hnh65j/api_json.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p></blockquote><p></p>
[QUOTE="NSA, post: 223684, member: 10034"] 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: [URL]http://sharefa.st/view/4bd7yLKDt720[/URL] 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']; ?>[/PHP] 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>[/CODE] [B]Screenies.[/B] [B]JSON[/B] [B][IMG]http://s21.postimg.org/3n7hnh65j/api_json.png[/IMG][/B] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
[Habbo]Phoenix API[Habbo]
Top