As a developer you can create applications and add them to SiteName, taking advantage of the existing user base. You host the application, which means that you are in full control of your server specifications.

Setting up an APP

To interact with SiteName your application can issue calls to our API and request or post information.

When you add an application to our site we will give you an APP ID.

Requesting a Token

Whenever you plan on using our API you must first request a token. In order to request a token you need a unique key that we send to you when a user visits your APP from an iframe on our site. We pass this along as $_GET['key'].
This is an example of how you can request a token:
https://cicdn.net/phpfox/token.php?key=$_GET['key']
If successful, you will get a JSON response like:
Object
(
    [token] => LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUc4d0RRWUpLb1pJaHZjTkFRRUJCUUFEWGdBd1d3SlVBdHFZdmVWOXFEdDd6NFhXTXYzS3VZM2JyWXpUKzR0VgpBbERrN1dQWjhqRVpoVzBNWjE1Z3lHdGNlNm5ueFRNenp4SXpHM29BRVIzc0JVRCtYdStHb21JeVV4UE1RN1NtCkVPdFg0ZTNwekp6R081cUxBZ01CQUFFPQotLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0K
)

Sending a Request

Now that you have a valid token you can make requests to our server. With each request you must pass the token we created for you.
An example call to our API server would look like:
https://cicdn.net/phpfox/api.php?token=#{TOKEN}&method=#{METHOD_NAME}

Understanding an API Response

For methods that could return more than one item the response will contain an indicator of the total items available as well as how many pages there are. We return by default 10 items at most and in order to get the next 10 items you would have to pass the param "page=2".

To the left you will find a list of the modules that implement API methods. Click on the module and you will see a list of the methods that your application can use. For shortness and formatting purposes we do not include the full request in there but only the most relevant parts.

friend
getFriends
GET /api.php?method=friend.getFriends&user_id=#{USER_ID}
Gets a full list of friends for a specific user. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 1
            [pages] => 0
            [current_page] => 0
        )

    [output] => Array
        (
            [0] => Object
                (
                    [user_id] => 7
                    [user_name] => jane-doe
                    [full_name] => Jane Doe
                    [joined] => 1314110027
                    [country_iso] => US
                    [gender] => Female
                    [photo_50px] => http://cicdn.net/phpfox/file/pic/user/7_50.jpg
                    [photo_50px_square] => http://cicdn.net/phpfox/file/pic/user/7_50_square.jpg
                    [photo_120px] => http://cicdn.net/phpfox/file/pic/user/7_120.jpg
                    [photo_original] => http://cicdn.net/phpfox/file/pic/user/7.jpg
                    [profile_url] => http://cicdn.net/phpfox/index.php?do=/jane-doe/
                )

        )

)
isFriend
GET /api.php?method=friend.isFriend&user_id=#{USER_ID}&friend_user_id=#{FRIEND_USER_ID}
Checks if 2 users are friends or not. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Object
        (
            [is_friend] => 1
        )

)
mail
getNewCount
GET /api.php?method=mail.getNewCount&user_id=#{USER_ID}
Get the total number of unseen messages. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => 1
)
notification
getNewCount
GET /api.php?method=notification.getNewCount&user_id=#{USER_ID}
Get the total number of unseen notifications. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 5
            [pages] => 0
            [current_page] => 0
        )

    [output] => 5
)
get
GET /api.php?method=notification.get&user_id=#{USER_ID}
Get all of the users notifications. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Array
        (
            [0] => Object
                (
                    [notification_id] => 3
                    [link] => http://cicdn.net/phpfox/john-doe/comment-id_1/
                    [message] => Jane Doe commented on your wall
                    [icon] => http://cicdn.net/phpfox/module/blog/static/image/default/default/activity.png
                )

        )

)
photo
addPhoto
POST /api.php?method=photo.addPhoto&photo=#{@FILE_PATH;TYPE=MIME_TYPE}&photo_name=#{BASE_FILE_NAME}
Uploads a photo on behalf of the user.
Response
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Object
        (
            [original] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d.jpg
            [75px] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_75.jpg
            [100px] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_100.jpg
            [150px] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_150.jpg
            [240px] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_240.jpg
            [500px] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_500.jpg
            [1024px] => http://cicdn.net/phpfox/file/pic/photo/2011/08/39740c5e356fdd6f66cfc973d4aebf6d_1024.jpg
        )

)
getPhotos
GET /api.php?method=photo.getPhotos&user_id=#{USER_ID}
Get all the photos for a user. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 1
            [pages] => 0
            [current_page] => 0
        )

    [output] => Array
        (
            [0] => Object
                (
                    [photo_100px] => http://cicdn.net/phpfox/file/pic/photo/c81e728d9d4c2f636f067f89cc14862c_100.jpg
                    [photo_240px] => http://cicdn.net/phpfox/file/pic/photo/c81e728d9d4c2f636f067f89cc14862c_240.jpg
                    [photo_original] => http://cicdn.net/phpfox/file/pic/photo/c81e728d9d4c2f636f067f89cc14862c.jpg
                )

        )

)
user
getUser
GET /api.php?method=user.getUser&user_id=#{USER_ID}
Get information about a user based on the user ID# you pass. If you do not pass the #{USER_ID} we will return information about the user that is currently logged in.
Response
Object
(
    [api] => Object
        (
            [total] => 0
            [pages] => 0
            [current_page] => 0
        )

    [output] => Object
        (
            [user_id] => 1
            [user_name] => john-doe
            [joined] => 1314109907
            [gender] => Male
            [country_iso] => US
            [full_name] => John Doe
            [email] => john.doe@site.com
            [photo_50px] => http://cicdn.net/phpfox/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e_50.jpg
            [photo_50px_square] => http://cicdn.net/phpfox/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e_50_square.jpg
            [photo_120px] => http://cicdn.net/phpfox/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e_120.jpg
            [photo_original] => http://cicdn.net/phpfox/file/pic/user/2011/08/9d673759d1cf55c9cd0b0805dc32e68e.jpg
            [profile_url] => http://cicdn.net/phpfox/index.php?do=/john-doe/
        )

)
phpFox Developers Debug Toggle JavaScript Console
Version:
3.8.0
Product Code Name:
Nebula

Total Time:
0.0486832
PHP General Time:
0.047206
GZIP:
enabled

Driver Version:
MySQL 5.5.62-0ubuntu0.14.04.1
SQL Time:
0.0014772
SQL Queries:
4
SQL Memory Usage:
5.88 kb
SQL Slave Enabled:
No
SQL Total Slaves:
N/A
SQL Slave Server:
N/A

Total Memory Usage:
2.23 Mb
Total Memory Usage (Including Debug):
2.27 Mb
Memory Limit:
0.5 b (-1)

Load Balancing Enabled:
No
Requests From:
198.13.61.26


Server Time Stamp:
October 21, 2019, 11:46 pm
PHP Version:
5.5.9-1ubuntu4.29
PHP Sapi:
apache2handler
PHP safe_mode:
false
PHP open_basedir:
false
Operating System:
Linux

Cache:
file
SQL Queries
0.0001290 | Memory Before: 442.41 kb | Memory After: 443.92 kb | Memory Used: 1.51 kb | Rows: 1 | Slave: No
SELECT value_actual
FROM phpfox_setting
WHERE var_name = 'phpfox_version'
/* OO Query */
IdSelect TypeTableTypePossible KeysKeyKey LenRefRowsExtra
1SIMPLEphpfox_settingrefvar_namevar_name102const1Using where
0.0011921 | Memory Before: 738.35 kb | Memory After: 739.7 kb | Memory Used: 1.35 kb | Rows: - | Slave: No
INSERT INTO phpfox_log_session (session_hash, id_hash, user_id, last_activity, location, is_forum, forum_id, im_hide, ip_address, user_agent) VALUES ('ecda69dca11552e2febea424167b5a48', 'c56fb43d525078d2aaf85f739d93f298', '0', '1571701566', '/mobile/apps/developer/', '0', '0', '0', '34.204.171.108', 'CCBot/2.0 (https://commoncrawl.org/faq/)')
0.0001020 | Memory Before: 872.86 kb | Memory After: 874.37 kb | Memory Used: 1.51 kb | Rows: 1 | Slave: No
SELECT s.style_id, s.parent_id AS style_parent_id, s.folder AS style_folder_name, t.folder AS theme_folder_name, t.parent_id AS theme_parent_id, t.total_column, s.l_width, s.c_width, s.r_width
FROM phpfox_theme_style AS s
     JOIN phpfox_theme AS t
            ON(t.theme_id = s.theme_id)

WHERE s.is_default = 1
/* OO Query */
IdSelect TypeTableTypePossible KeysKeyKey LenRefRowsExtra
1SIMPLEsrefis_defaultis_default1const1 
1SIMPLEteq_refPRIMARY,theme_idPRIMARY2phpfoxfb.s.theme_id1 
0.0000541 | Memory Before: 876.2 kb | Memory After: 877.7 kb | Memory Used: 1.51 kb | Rows: 1 | Slave: No
SELECT folder AS parent_style_folder
FROM phpfox_theme_style
WHERE style_id = 1
/* OO Query */
IdSelect TypeTableTypePossible KeysKeyKey LenRefRowsExtra
1SIMPLEphpfox_theme_styleconststyle_id_2,style_idstyle_id_22const1 
Array
(
    [session] => ecda69dca11552e2febea424167b5a48
    [redirect] => /mobile/apps/developer/
)