# User

User

This section provides necessary functions related to user such as authentication, user profile and other user specific actions.

# avatar.php

Function:

Function Name Description Level
avatar.php This script allows the app to pass the user id or based64 encoded username and it returns the user's avatar as an image. Return a 1x1 image if this user has no avatar. 4

Input Parameters:

Name Type Required? Description Level
user_id String Parameter as GET 4
username byte[] Parameter as GET 4

Output Parameters:

Name Type Required? Description Level

# login

Function:

Function Name Description Level
login Server returns cookies in HTTP header. Client should store the cookies and pass it back to server for all subsequence calls to maintain user session. ** DO NOT include HTTP Cookies in the request header ** 3,4

Input Parameters:

Name Type Required? Description Level
login_name byte[] yes 3
password byte[] yes The app should send the encrypted password to the server if there is instruction received from get_config. Otherwise send the plain-text password. For example most of the vBulletin systems requires md5 encryption by default, while SMF systems support SHA-1 encryption. 3
anonymous Boolean API Level 4 only. Allow user to login anonymously so the user does not appear in the Who's Online list. Useful for background login such as pulling unread PM etc. 4

Output Parameters:

Name Type Required? Description Level
result Boolean yes true: OKAY. False: wrong id or password. 3
result_text byte[] Return if there are occasional complication such as the password is expired or the account is waiting for administrator approval, hence the app can show the message to the user. If this key is not returned, the app assumes user has simply entered incorrect password. 3
status String Return '2' if login failed with username does not exist.
user_id String yes Return this user ID. 4
login_name byte[] yes Return user's login name 4
username byte[] yes Return user's display name if the forum system support display name feature. 4
usergroup_id Array of String yes Return a list of usergroup ID that this user belongs to. 4
email byte[] user register email address
icon_url String yes 4
post_count Int Return total number of post of this user 4
user_type byte[] Type of user, valid data: banned/unapproved/inactive/normal/mod/admin
can_pm Boolean This instructs the app to hide the "Messaging" tab so user will not be able to use the PM features in the app. 3
can_send_pm Boolean This instructs the app to disable "Send PM" feature, however it still allows user to read Private Message, just that the user cannot send private message. 3
can_moderate Boolean Return true if this particular user has moderation capability. Moderation is an extension and not part of the Tapatalk API Level 3 3
can_search Boolean Return false if users do not have permission to search in this forum 4
can_whosonline Boolean Return false if this user does not have permission to see current list of online user 4
can_profile Boolean Return false if this user does not have permission to check user profile page (get_user_info) 4
can_upload_avatar Boolean Return true if this user can modify his avatar 3
max_avatar_size Int Return the maximum avatar file size in bytes the user can upload.
max_avatar_width Int Max upload avatar file diimensions in width.
max_avatar_height Int Max upload avatar file diimensions in height.
max_attachment Int Return the maximum allowed attachments the user can be uploaded in a single post. If max_attachment is missing, it assumes the plugin does not support attachment upload. If a user is restricted from uploading attachment, it should use the "can_upload" flag in get_topic and get_thread to determine whether user can upload attachment, regardless how many attachments user can upload within a single post. 4
allowed_extensions String List the file extensions that are allowed to be uploaded. Use comma between extensions.
max_attachment_size Int Return the maximum attachment file size in bytes the user can upload in a single message. If this flag was missing, check flag 'max_{ext}_size' for file with specific extension.
max_png_size Int Return the maximum allowed PNG file size that the user can upload. This field is used in conjunction with the Attachment section. This number should be in byte. 4
max_jpg_size Int Return the maximum allowed JPEG file size that the user can upload. This field is used in conjunction with the Attachment section. This number should be in byte. 4
ignored_uids String A list of ignored user id, separated with comma. Posts from ignored user will be hidden in thread list.
post_countdown Int Time required between posts from the same user or IP
can_active Boolean Return true if this user can active or approve other user

# get_inbox_stat

Function:

Function Name Description Level
get_inbox_stat returns inbox related statistic for the user. In API Level 3 there is no input parameter need to pass into this function. 3

Input Parameters:

Name Type Required? Description Level

Output Parameters:

Name Type Required? Description Level
inbox_unread_count Int yes returns total number of unread message in inbox 3
subscribed_topic_unread_count Int yes returns total number of subscribed topics that are unread. 4

# logout_user

Function:

Function Name Description Level
logout_user Logout user, no input and output required. 3

Input Parameters:

Name Type Required? Description Level

Output Parameters:

Name Type Required? Description Level

# get_online_users

Function:

Function Name Description Level
get_online_users Returns a list of user who are currently online. You can specify forum and thread to limit the users you need. 3,4

Input Parameters:

Name Type Required? Description Level
page Int 4
perpage Int 4
id String return a list of online users who are currently viewing this sub-forum or thread 4
area String Indicate the id is for forum or topic. default is for forum. Valid value is 'forum' and 'topic' 4

Output Parameters:

Name Type Required? Description Level
member_count Int yes number of members 3
guest_count Int yes number of guest users 3
list Array of Hash table yes 3
user_id String yes 4
username byte[] yes required in API level 4 as display name, if no display name, return login name 4
icon_url String user avatar full url 3. Obsoleted in Level 4.
user_name byte[] yes Will be replaced by key 'username' in API level 4 3. Obsoleted in Level 4
display_text byte[] free text to be displayed under the user name in the online list. E.g. in vBulletin it can display what the user is currently doing. In API Leve 4, it can also returns [TOPIC] BBCode: this is to support clickable topic the user is currently reviewing. 3,4
topic_id String Required if [TOPIC] BBCode is presented in the display_text above. 4
from String Indicate where is this user browsing from. Valid data: browser/mobile/tapatalk/byo. Default as browser. 'byo' means user was on tapatalk 'build your own' app.

# get_user_info

Function:

Function Name Description Level
get_user_info Returns user related information 3,4

Input Parameters:

Name Type Required? Description Level
user_name byte[] yes the user whose info need to be returned. It can be either the request user himself, or someone else. 3
user_id String yes If the user_name is null in the first parameter, app can pass in user_id in second parameter to request the same information 4

Output Parameters:

Name Type Required? Description Level
user_id String yes 4
username byte[] yes User display name 4
post_count Int yes total number of posts that user has posted 3
reg_time Date yes dateTime.iso8601 user registration time 3
timestamp_reg String yes Timestamp of user registration time
last_activity_time Date 3
timestamp String Timestamp of last activity time
is_online Boolean return true if this user is currently online 3
accept_pm Boolean return false if this user does not accept private message. 3
i_follow_u Boolean return true I am following this person. 4
u_follow_me Boolean return true if this person is following me. 4
accept_follow Boolean return true if this person allows people to follow him. 4
following_count Int number of person this user is following to 4
follower Int number of person following this user 4
display_text byte[] this field can be returned if there is any other free text should be displayed on the app. 3
icon_url String user avatar URL 3. Obsoleted in Level 4
current_activity byte[] If the user is currently online, return what the user is currently doing. (For API level 3, but implemented this key. Changed to be 'current_action' when API level is 4) 3
current_action byte[] If the user is currently online, return what the user is currently doing. 4
topic_id String Required if [TOPIC] BBCode is presented in the current_action above. 4
custom_fields_list Array of Hash table It is an expandable field allowing the Tapatalk app to display as many as user information in name/value value. 3
name byte[] yes 3
value byte[] yes 3
update_fields_list Array of Hash table It is an expandable field allowing the Tapatalk app to update user profile 3

# get_user_topic

Function:

Function Name Description Level
get_user_topic Returns a list of topics (max 50) the user has previously created. Sorted by last reply time 3

Input Parameters:

Name Type Required? Description Level
user_name byte[] yes the user whose topics need to be returned. Can be either the request user himself, or someone else. 3
user_id String yes If the user_name is null in the first parameter, app can pass in user_id in second parameter to request the same information 4

Output Parameters:

Name Type Required? Description Level
Array of Hash table 3
forum_id String yes 3
forum_name byte[] yes 3
topic_id String yes 3
topic_title byte[] yes Remove all BBCode in title 3
last_reply_author_name byte[] yes return display name if it has 3
last_reply_author_id String yes 4
icon_url String Return the last post author avatar URL 3
last_reply_time Date yes dateTime.iso8601 format. If this topic has no reply, use the topic creation time. 3
timestamp String yes Timestamp of topic last reply
reply_number Int total number of reply in this topic. If this is no reply in this return, return 0. 3
new_post Boolean yes return true if this topic contains new post since user last login 3
view_number Int yes total number of view in this topic 3
short_content byte[] Characters display rules (should follow this sequence): 1) Remove all BBCode except [ur], [img]. 2) Convert "[url http://...]http://…..[/url]" to "[url]". 3) Convert "[img]http://…..[/img]" to "[img]". 4) Remove "Last edited by..." tag at the end. 5) Remove all non-displayable characters (e.g. \n, \t, etc). 6) Remove all whitespace, /n and /r at the begining and ending of the content. 7) return only first 200 characters 3

# get_user_reply_post

Function:

Function Name Description Level
get_user_reply_post Returns a list of posts (max. 50) that's a particular user has replied to. 3

Input Parameters:

Name Type Required? Description Level
user_name byte[] yes the user whose topics need to be returned. Can be either the request user himself, or someone else. 3
user_id String yes If the user_name is null in the first parameter, app can pass in user_id in second parameter to request the same information 4

Output Parameters:

Name Type Required? Description Level
Array of Hash table 3
forum_id String yes 3
forum_name byte[] yes 3
topic_id String yes 3
topic_title byte[] yes Remove all BBCode in title 3
post_id String yes 3
post_time Date yes dateTime.iso8601 format. If this topic has no reply, use the topic creation time. 3
timestamp String yes Timestamp of topic reply
reply_number Int yes total number of reply in this topic. If this is no reply in this return, return 0. 3
new_post Boolean yes return true if this topic contains new post since user last login 3
view_number Int yes total number of view in this topic 3
short_content byte[] yes Characters display rules (should follow this sequence): 1) Remove all BBCode except [ur], [img]. 2) Convert "[url http://...]http://…..[/url]" to "[url]". 3) Convert "[img]http://…..[/img]" to "[img]". 4) Remove "Last edited by..." tag at the end. 5) Remove all non-displayable characters (e.g. \n, \t, etc). 6) Remove all whitespace, /n and /r at the begining and ending of the content. 7) return only first 200 characters

Function:

Function Name Description Level
get_recommended_user Return a list of recommended users for conversation or pm. Flag 'user_recommended' returned in get_config will indicate the plugin support this function. It will return 20 users at default without any parameter.

Input Parameters:

Name Type Required? Description Level
page Int default 1
perpage Int default 20
mode Int value 1 represent all users, value 2 represent non-Tapatalk users, if no parameter provided, use default 1

Output Parameters:

Name Type Required? Description Level
total Int yes total number of users
list Array of Hash table yes users list
user_id String yes
username byte[] yes User display name
icon_url String
type String User suggestion type, it can be users I have start pm/conversation with, users I followed or liked, etc. Current valid data: contact, following, follower, like, liked, watch.

# search_user

Function:

Function Name Description Level
search_user Return a list of users by giving key word. Flag 'search_user' returned in get_config will indicate the plugin support this function.

Input Parameters:

Name Type Required? Description Level
keywords byte[] yes Key words to search
page Int default 1
perpage Int default 20

Output Parameters:

Name Type Required? Description Level
total Int yes Total number of users in search result
list Array of Hash table yes user list
user_id String yes User id
username byte[] yes User display name
icon_url String User avarat url

# ignore_user

Function:

Function Name Description Level
ignore_user add/remove user in your ignored user list. Ignored user's post will be hidden as default

Input Parameters:

Name Type Required? Description Level
user_id String yes Id of user to be ignored
mode Int set 1 as add user as ignored, set 0 to remove user from ignored list. Default as 1

Output Parameters:

Name Type Required? Description Level
result Boolean yes
result_text byte[]

# update_signature

Function:

Function Name Description Level
update_signature Update user's signature

Input Parameters:

Name Type Required? Description Level
signature byte[] yes Signature content

Output Parameters:

Name Type Required? Description Level
result Boolean yes
result_text byte[]
signature byte[] Signature processed by forum system. Required when result is true

# get_member_list

Function:

Function Name Description Level
get_member_list Get/search the borad all member lists. search user type default is normal users. if admin(or have permission user) can search all user type include inactive user 4

Input Parameters:

Name Type Required? Description Level
page Int 4
perpage Int 4
action String Action default is all , now support ( "all" , "search" ) 4
keyword String if action = search , keyword is search username 4

Output Parameters:

Name Type Required? Description Level
result Boolean yes return true if the action is executed successfully. 4
member_count Int yes number of members 3
list Array of Hash table yes 4

# user_bind_ttid

Function:

Function Name Description Level
user_bind_ttid current login forum user connect current tapatalk id 4

Input Parameters:

Name Type Required? Description Level
token String yes login with tapatalk id will get the token
code String yes md5 of fid, tapatalk id join email of tapatalk id, sample: md5('123|1234|xxxx@gmail.com')

Output Parameters:

Name Type Required? Description Level
result Boolean yes return true if the action is executed successfully. 4
result_text byte[] Propose to add this field for error message returned from the server. 4

# update_profile

Function:

Function Name Description Level
update_profile Update user's profile. Flag 'search_user' returned in get_config will indicate the plugin support this function. 3

Input Parameters:

Name Type Required? Description Level
user_id String yes id of user to be updated
custom_fields Array of Hash table yes the fields that will be updated

Output Parameters:

Name Type Required? Description Level
result Boolean yes
result_text byte[]

# remove_avatar

Function:

Function Name Description Level
remove_avatar Remove current login user avatar. Flag 'remove_avatar' returned in get_config will indicate the plugin support this function. 4

Input Parameters:

Name Type Required? Description Level
user_id String yes User id

Output Parameters:

Name Type Required? Description Level
result Boolean yes
result_text byte[]