JSON API User Plus extends the JSON API Plugin to allow RESTful user registration, authentication and many other User Meta, Posts, CPT, Custom Fields, BuddyPress Messages, xProfile, Activity, Friends, Notifications, Settings & Member functions.
JSON API User Plus API will allow you to quickly build BuddyPress & WordPress Mobile apps to bring your website to mobile users using both Native & HTML5 mobile apps.
Freely available in WordPress directory, ‘JSON API Auth‘ & ‘JSON API User‘ were initially developed for crucial missing features in RESTful JSON API Plugin. Since these plugins are used to integrate data in third party apps and mostly in mobile apps, a pro version JSON API User Plus is upgrade for JSON API User plugin and has over 100 endpoints especially for BuddyPress components.
User Plus All available endpoints
Most of the BuddyPress components features are now available as endpoints (More than 100 endpoints are available, many undocumented endpoints are not listed here as they are continuously being developed and added). Please see the full list for available endpoints below:
WordPress Posts endpoints
get_posts, add_post, update_post, update_cpt, delete_post, delete_cpt, get_post_meta, update_post_taxonomy, update_post_meta, delete_post_meta, post_comment, delete_comment, comment_status, comments, taxonomies, terms
WordPress User endpoints
info, email_exists, username_exists, register, get_avatar, get_userinfo, retrieve_password, update_password, reset_password, update_user, validate_auth_cookie, generate_auth_cookie, get_currentuserinfo, get_user_meta_id, get_user_meta, update_user_meta, update_user_meta_vars, update_user_meta_admin, delete_user_meta, user_role, xprofile, xprofile_update, fb_connect, google_connect, profile, avatar_upload, delete_account, delete_user, search_user, get_user_by users
BuddyPress Messages endpoints
threads, thread, new_message, mark_thread_read, mark_thread_unread, messages_count
BuddyPress Activities endpoints
activities activities_post_update, activities_delete_activity, activities_new_comment, activities_delete_comment, activities_get_user_favorites, activities_total_favorites_for_user, activities_add_user_favorite, activities_remove_user_favorite, activities_find_mentions, activities_get_user_mentionname, activities_get_userid_from_mentionname, activities_clear_new_mentions
BuddyPress Friends endpoints
friends friends_add_friend, friends_remove_friend, friends_accept_friendship, friends_reject_friendship, friends_withdraw_friendship, friends_check_friendship, friends_friendship_status, friends_friend_count, friends_has_friends, friends_friendship_id, friends_friend_ids, friends_search_friends, friends_friendship_request_user_ids, friends_listing, friends_get_bulk_last_active, friends_group_invite_list, friends_count_invitable_friends, friends_friend_count_for_user, friends_is_friendship_confirmed
BuddyPress Members endpoints
members members_bp_has_members
BuddyPress Notifications endpoints
notifications notifications_unread_count notifications_delete notifications_mark_all notifications_mark_all_by_type settings_get_notifications settings_update_notifications
BuddyPress Groups endpoints
groups, groups_bp_has_groups groups_members, groups_create_group, groups_update_group, groups_edit_group_settings, groups_delete_group, groups_join_group, groups_join_group_admin, groups_send_membership_request, groups_invite_user, groups_invite_users_admin, groups_is_user_admin, groups_is_user_mod, groups_is_user_member, groups_leave_group
Misc endpoints
em_event, em_event_tickets, em_has_booking, em_get_bookings, em_cancel_booking, add_em_event, em_delete_event, book_em_event, wlm_update_user_meta, wlm_get_user_meta, wlm_get_levels, wlm_add_user_to_level
Features include:
- Generate Auth Cookie for user authentication
- Validate Auth Cookie
- RESTful User Registration
- RESTful Facebook Login/Registration with valid access_token
- RESTful BuddyPress xProfile fields update
- Get User Meta and xProfile fields
- Update User Meta and xProfile fields
- Delete User Meta
- Password Reset
- Get/Upload Avatar
- Get User Info
- Post Comment
- Add Post, Update Post, Delete Post
- Add/Edit/Delete Custom Post Type, Custom Fields
- Search User
- BuddyPress Activities
- BuddyPress Members
- BuddyPress Friends
- BuddyPress Groups
- BuddyPress Notifications
- BuddyPress Settings
JSON API User Plus plugin is upgrade for ‘JSON API User‘ plugin and includes all of its endpoints. JSON API User Plus includes API key which protects and restricts the endpoint calls. This key can be updated from Settings > User Plus options page. Your app must include this key with every call to get the data from REST API. Please see documentation for calling endpoints examples.
Overview
JSON API User Plus extends the JSON API Plugin with a new Controller to allow RESTful user registration, authentication, password reset, RESTful Facebook Login, RESTful User Meta and BuddyPress xProfile get and update methods. JSON API User Plus plugin is for WordPress/Mobile app developers who want to use WordPress as mobile app data backend.
WordPress Versions
- Requires at least: WordPress 3.0.1
- Tested up to: WordPress 5.2.2
- Current released version: 2.5.0
- Dev version available on request: 2.9.9
Plugin Settings Page
API Key
JSON API User Plus includes API key variable which protects and restricts the API endpoint calls. This key is available and can be updated from Settings > User Plus options page. Your app must include this key with every call to get the data from REST API.
Please see below for calling endpoints examples.
Secret Key
You can set a secret key here. Secret key variable will be used with specific endpooints which need double protection such as ‘user_role’. This key is available and can be updated from Settings > User Plus options page.
Disable Nonce
Nonce is required for some endpoints such as registration, add_post, update_post, delete_account.
If you want to disable nonce check protection in some endpoints, such as registration, new_post, update_post, delete_account, you can disable it in the plugin settings panel. Settings > User Plus
Allow Post Submission
If you want to disable check protection for `add_post`, `update_post`, `delete_post` endpoint calls, check this option. This will disable Post editing capability requirement for `add_post`, `update_post`, `delete_post` endpoints.
You can disable it in the plugin settings panel. Settings > User Plus
Notify New Post
Enable/disable sending admin email notification for new post submission via `add_post` endpoint.
General
Method: get_nonce
nonce can be created by calling if you are registering user or use it in any endpoint where it is required. This method is from JSON API Plugin core controller.
Example
http://localhost/api/get_nonce/?controller=userplus&method=register
You can then use ‘nonce’ value to register user.
How to get nonce
http://localhost/api/get_nonce/?controller=CONTROLLER-NAME-HERE&method=METHOD-NAME-HERE
Method: info
Required argument
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/info/?key=KEY-HERE
This endpoint will return the plugin current version.
User
Method: register
This endpoint allows user registration.
Required arguments
- username
- nonce – you can disable it from Settings > User Plus
- display_name
- key – get API key from Settings > User Plus
Optional arguments
- notify – send ‘no’ value to disable registration notification to user. Possible values, ‘admin’ or ‘both’; ’both’ will send email to both admin and user, ’admin’ will send only to admin.
- reference – to distinguish user for any reference, i.e. website, app, or via other user etc
Example
http://localhost/api/userplus/register/?key=KEY-HERE &username=john&email=john@domain.com&nonce=8bdfeb4e16&display_name=John
Optional params: ‘notify’, ‘user_nicename’, ‘user_url’, ‘nickname’, ‘first_name’, ‘last_name’, ‘description’.
Please make sure you provide valid values that these fields expect in correct format.
To disable registration email notification to user:
http://localhost/api/user/register/?key=KEY-HERE &username=john&email=john@domain.com&&display_name=John¬ify=both
Method: fb_connect
Required argument
- access_token – Provide valid access_token with email extended permission
- key – get API key from Settings > User Plus.
Example
http://localhost/api/userplus/fb_connect/?key=KEY-HERE&access_token=CAACEdEose0cBADLKmcHWOZCnW4RGU8emG
Provide valid access_token with email extended permission. To generate test access_token, try this tool https://developers.facebook.com/tools/explorer/ and select the app from above drop down that you want to get access_token (You must have joined that app already with email permission to generate access_token) for and then select email from the fields. By default, only ‘id’ and ‘name’ are added but you need to include ’email’ for user identification.
You will have to first allow extended permission for email in the app joining screen. Please note that above tool is only for testing, you generate valid access_token using the Graph API in your app. You should have prior knowledge of Facebook Graph API to use this endpoint.
Method: email_exists
Required argument
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/email_exists/?key=KEY-HERE&email=xyz@abc.com
This endpoint will check if the given email address is available for registration or not.
Method: username_exists
Required argument
- username
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/username_exists/?key=KEY-HERE&username=john
This endpoint will check if the given ‘username’ is available for registration or not.
Method: retrieve_password
Required argument
- user_login
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/retrieve_password/?key=KEY-HERE&user_login=john
Method: update_password
This endpoint allows user to change his password.
Required argument
- cookie
- password
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/update_password/?key=KEY-HERE&cookie=COOKIE-HERE&password=newCastle1980
Method: update_user
This endpoint is used to update user_meta and other details including password. Please see optional arguments for details.
Required argument
- cookie
- key – get API key from Settings > User Plus
Optional argument
- user_nicename
- user_url
- user_email – must be valid email address that is not already used.
- user_pass – new password
- display_name
- nickname
- last_name
Example
http://localhost/api/userplus/update_password/?key=KEY-HERE&cookie=COOKIE-HERE&password=newCastle1980
Method: user_role
This endpoint allows user_role change.
Required argument
- key – get API key from Settings > User Plus
- secret – get API secret from Settings > User Plus
- user_id
- role – provide valid role to be set for the user_id.
Example
http://localhost/api/userplus/user_role/?key=KEY-HERE&secret=239857hfd&user_id=2&role=editor
Method: delete_account
Required arguments
- cookie
- nonce – use get_nonce for controller= userplus & method=delete_account
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/delete_account/?key=KEY-HERE&cookie=COOKIE-HERE&nonce=NONCE-HERE
You can get nonce value to be used with this endpoint by going to
http://localhost/api/get_nonce/?controller= userplus&method=delete_account
Be very careful using ‘delete_account’, this will delete the user account.
Method: search_user
Required arguments
- cookie
- search
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/search_user/?key=KEY-HERE&search=ja
Authentication
Method: validate_auth_cookie
Required argument
- Cookie
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/validate_auth_cookie/?key=KEY- HERE &cookie=admin|43 089754375034fjwfn39u8
Method: generate_auth_cookie
This endpoint is used to generate auth cookie for the user. This cookie is used for user authentication throughout the user related endpoints.
Required arguments
- username
- password
- key – get API key from Settings > User Plus
Optional argument
- seconds – 60 means 1 minute – default is for 14 days
Example
http://localhost/api/userplus/generate_auth_cookie/?username=john&password=PASSWORD-HERE
Optional ‘seconds’ var. If provided, generated cookie will be valid for that many seconds, otherwise default is for 14 days.
Generate cookie for 1 minute: http://localhost/api/userplus/generate_auth_cookie/? username=john&password=PASSWORD-HERE&seconds=60
Posts
Method: new_post
This endpoint will allow you to add new posts. You can also add CPT by providing type var. Featured image can also be attached with the post.
Custom fields can be added via `update_post_meta` endpoint using post_id.
`nonce` requirement can be disabled from Settings > UserPlus. Admin notification for any new submitted posts can also be enabled/disabled from Settings > UserPlus.
Note: User must have capability to add post. Change user role if needed.
Required argument
- cookie – for user authentication
- nonce – available from the get_nonce method (call with vars controller=userplus and method=new_post)
- status – sets the post status (“draft” or “publish”)
- title – the post title
- content – the post content
- key – get API key from Settings > User Plus
Optional arguments
- type – Post Type. Default is `post`.
- categories – a comma-separated list of categories (URL slugs)
- tags – a comma-separated list of tags (URL slugs)
- attachment – upload field will cause an attachment to be stored with new post with image set as featured thumbnail
Example
URL to POST values: http://localhost/api/userplus/new_post/
Method: update_post
This endpoint will allow you to update posts. You can also add CPT by providing type var. Featured image can also be attached with the post.
Custom fields can be added via `update_post_meta` endpoint using post_id.
`nonce` requirement can be disabled from Settings > UserPlus. Admin notification for any new submitted posts can also be enabled/disabled from Settings > UserPlus.
Note: User must have capability to update post. Change user role if needed. Only author of post or admin can update it.
Required argument
- cookie – for user authentication
- post_id – post ID to be updated
- nonce – available from the get_nonce method (call with vars controller=userplus and method=update_post)
- key – get API key from Settings > User Plus
Optional arguments
- type – Post Type. Default is `post`.
- status – sets the post status (“draft” or “publish”)
- title – the post title
- content – the post content
- categories – a comma-separated list of categories (URL slugs)
- tags – a comma-separated list of tags (URL slugs)
- post_media – to delete all previously attached images from post, pass value ‘delete’
- attachment – upload field will cause an attachment to be stored with new post with image set as featured thumbnail. Previously uploaded images will still be attached to post. Old media can be deleted by sending post_media=delete
Example
URL to POST values: http://localhost/api/userplus/update_post/
Method: delete_post
This endpoint will allow you to delete posts. Provide `post_media` var – to delete all previously attached images from post, pass value ‘delete`.
`nonce` requirement can be disabled from Settings > UserPlus. Admin notification for any new submitted posts can also be enabled/disabled from Settings > UserPlus.
Note: User must have capability to delete post. Change user role if needed. Only author of post or admin can delete it.
Required argument
- cookie – for user authentication
- post_id – post ID to delete
- nonce – available from the get_nonce method (call with vars controller=userplus and method=delete_post)
- key – get API key from Settings > User Plus
Optional arguments
- post_media – to delete all previously attached images from post, pass value ‘delete’
- force_delete – if set to ‘true’, it will delete the post bypassing the WordPress trash.
Example
URL to POST values: http://localhost/api/userplus/delete_post/
Note: User must have capability to delete post. Change user role if needed.
Method: get_post_meta
This endpoint is used to get post meta for any custom fields of post. If you provide meta_key, only that data will be provided otherwise, all post_meta will be fetched.
Required argument
- cookie – for user authentication
- post_id
- key – get API key from Settings > User Plus
Optional arguments
- meta_key – provide meta_key to get data for that post.
Example
You must include one or more vars in your request to add or update post_meta. e.g. ‘name’, ‘website’, ‘skills’. You must provide multiple meta_key vars in this format:
http://localhost/api/userplus/get_post_meta/?key=KEY=HERE&post_id=110&meta_key=website,score
Method: update_post_meta
This endpoint is used to add/update post meta for any custom fields to post.
Required argument
- cookie – for user authentication
- post_id
- key – get API key from Settings > User Plus
- At least one meta_key to be added to post as custom post field.
Example
You must include one or more vars in your request to add or update post_meta. e.g. ‘name’, ‘website’, ‘skills’. You must provide multiple meta_key vars in this format:
http://localhost/api/userplus/update_post_meta/?key=KEY=HERE&cookie=COOKIE-ERE&post_id=110&my_score=200&website=parorrey.com
Note: Only author of post or admin user can do this.
Method: delete_post_meta
This endpoint is used to delete post meta ( custom fields ) of post.
Note: Only author of post or admin user can do this.
Required argument
- cookie – for user authentication
- post_id
- key – get API key from Settings > User Plus
- At least one meta_key to be deleted.
Example
You must include one or more vars in your request to delete post_meta. e.g. ‘name’, ‘website’, ‘skills’. You must provide multiple meta_key vars separated by comma:
http://localhost/api/userplus/delete_post_meta/?key=KEY=HERE&cookie=COOKIE-ERE& post_id=110& meta_key=my_score,website
Method: post_comment
This endpoint is used to submit comments to any post.
Required arguments
- cookie
- post_id
- content
- comment_status
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/post_comment/?key=KEY-HERE&cookie=COOKIE-HERE&post_id=ID&content=Comment contents here&comment_status=1
Method: comments
This endpoint will fetch comments. Pagination of comments is also available.
Required arguments
- post_id
- key – get API key from Settings > User Plus
Optional argument
- per_page – number of comments per page. Default is 10
- page – page number for pagination based on per_page number. Default is 1.
- sort – order of comments. Possible values ‘ASC’, ‘DESC’. Default is ‘DESC’.
Example
http://localhost/api/userplus/comments/?key=KEY-HERE&post_id=1
Method: delete_comment
This endpoint trashes or deletes a comment.
The comment is moved to trash instead of permanently deleted unless trash is disabled, item is already in the trash, or $force_delete is true.
Required arguments
- comment_id
- key – get API key from Settings > User Plus
- cookie
Optional argument
- force_delete – false or true, default false.
Example
http://localhost/api/userplus/delete_comment/?key=KEY-HERE&cookie=COOKIE-HERE&comment_id=50
http://localhost/api/userplus/delete_comment/?key=KEY-HERE&cookie=COOKIE-HERE&comment_id=51&force_delete=true
Method: comment_status
This endpoint gets the comment status.
Required arguments
- comment_id
- key – get API key from Settings > User Plus
- cookie
Example
http://localhost/api/userplus/comment_status/?key=KEY-HERE&cookie=COOKIE-HERE&comment_id=50
Profile
Method: get_user_meta
This endpoint is used to get user meta.
Required argument
- user_id
- key – get API key from Settings > User Plus
Optional argument
- meta_key
http://localhost/api/userplus/get_user_meta/?key=KEY-HERE&cookie=COOKIE-HERE&meta_key=KEY-HERE
Method: update_user_meta_vars
This endpoint allows you update user_meta variables in one single call. It will cut http requests if you have to add/update multiple meta_key vars in a single call.
In the example call below, ‘website’, ‘city’, ‘country’ and ‘skills’ are meta_key for WordPress user_meta. It is different from BuddyPress xProfile fields.
Please make sure you provide ending comma for all those fields which have multiple values or supposed to have multiple values. e.g. If ‘skills’ field has multiple values, pass them like http://localhost/api/userplus/update_user_meta_vars/?cookie=COOKIE-HERE&skills=PHP,MySQL, or &skills=PHP, make sure you always pass ending comma for multi-select fields to be added in array format even if it has just one value on occasions since it can have multiple values.
Required arguments
- cookie
- key – get API key from Settings > User Plus
- meta_key
- meta_value – You may send multiple values separated by comma.
This endpoint allows you cut http requests if you have to add/update multiple meta_key vars in a single call.
Example
http://localhost/api/userplus/update_user_meta_vars/?key=KEY-HERE&cookie=COOKIE-HERE&website=user-website.com&city=Chicago&country=USA&skills=php,css,js,web design
In the above call, ‘website’, ‘city’, ‘country’ and ‘skills’ are meta_key for WordPress user_meta. It is different from BuddyPress xProfile fields.
Method: update_user_meta
This endpoint allows you update user meta using meta_key variable.
In the example below: meta_key is for WordPress user_meta. It is different from BuddyPress xProfile fields.
Required arguments
- cookie
- key – get API key from Settings > User Plus
- meta_key
- meta_value – You may send multiple values separated by comma.
Example
http://localhost/api/userplus/update_user_meta/?key=KEY-HERE&cookie=COOKIE-HERE&meta_key=KEY-HERE&meta_value=VALUE-HERE
Method: delete_user_meta
Required arguments
- cookie
- meta_key
- meta_value
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/delete_user_meta/?key=KEY-HERE&cookie=COOKIE-HERE&meta_key=website,city,country,skills
Method: xprofile
This endpoint will fetch BuddyPress extended profile fields data. Just provide field label and user_id.
Required arguments
- user_id
- any profile ‘field’ var – call by exact label
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/xprofile/?key=KEY-HERE&user_id=USERID-HERE&field=FIELD-LABEL-HERE
Method: xprofile_update
This endpoint will update BuddyPress extended profile fields data. Just provide field label, values and cookie of user.
Required arguments
- cookie
- any profile ‘field’ var and ‘value’
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/xprofile_update/?key=KEY-HERE&cookie=COOKIE-HERE&exact-xprofile-field-label=value
http://localhost/api/userplus/xprofile_update/?key=KEY-HERE&cookie=COOKIE-HERE&field=value&field2=value&multi-value-field=value1,value2,value3
Please make sure you provide ending comma for all those fields which have multiple values. e.g. If ‘skills’ xProfile field has multiple values, pass them like
http://localhost/api/userplus/xprofile_update/?key=KEY-HERE&cookie=COOKIE-HERE&skills=PHP,MySQL, or &skills=PHP,
Please make sure you always pass ending comma for multi-select fields to be added in array format.
Method: get_avatar
This endpoint is used to get user avatar.
Required argument
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/get_avatar/?key=KEY-HERE&user_id=1
Method: get_userinfo
This endpoint will get user WordPress profile data.
Required argument
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/get_userinfo/?key=KEY-HERE&user_id=1
Method: profile
This endpoint is used to get BuddyPress extended profile (xprofile) data with all the fields groups.
Required argument
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/profile/?key=KEY-HERE&user_id=1
Method: avatar_upload
This endpoint is used to upload BuddyPress avatar for user profile.
You must POST the form with avatar image in file upload field var with other required and optional variables as hidden fields.
Required argument
- cookie
- avatar – file upload type var
- key – get API key from Settings > User Plus
Optional arguments
- full – BuddyPress avatar width and height (default is BP_AVATAR_FULL_WIDTH or 300).
- thumb – BuddyPress avatar width and height (default is BP_AVATAR_THUMB_WIDTH or 100).
Example
http://localhost/api/userplus/avatar_upload/
Friends
Method: friends
This endpoint will provide user’s BuddyPress friends. xProfile fields can also be included in response if you include `xprofile` var and provide comma separated BuddyPress xprofile field labels for friends’ additional data.
Required argument
- user_id
- key – get API key from Settings > User Plus
Optional arguments
- xprofile – comma separated BuddyPress xprofile fields for friends data
Example
http://localhost/api/userplus/friends/?key=KEY-HERE&user_id=1
Friends with xProfile Fields data
http://localhost/api/userplus/friends/?key=KEY=HERE&user_id=1&xprofile=Birthday,City,Address
Method: friends_add_friend
This endpoint is used to send a BuddyPress friend request. `force_accept` can be included whether to force acceptance. When true, this endpoint will result in an accepted friendship, with no notifications being sent.
Required argument
- cookie
- friend_id – ID of the “friend” user (the user whose friendship is being requested).
- key – get API key from Settings > User Plus
Optional arguments
- force_accept – Whether to force acceptance. When true, this endpoint will result in an accepted friendship, with no notifications being sent. Default: false.
Example
http://localhost/api/userplus/friends_add_friend/?key=KEY-HERE&cookie=Cookie-here& friend_id=1
Add new friend with forced accept
http://localhost/api/userplus/friends_add_friend/?key=KEY-HERE&cookie=Cookie-here& friend_id=1&force_accept=true
Method: friends_remove_friend
This endpoint is used to remove a user as friend (in BuddyPress).
Required argument
- cookie
- friend_id – ID of the “friend” user (the user whose friendship is being removed).
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_remove_friend/?key=KEY-HERE&cookie=Cookie-here& friend_id=1
Method: friends_accept_friendship
This endpoint is used to mark a friendship request as accepted.
Required argument
- cookie
- friendship_id – ID of the pending friendship object.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_accept_friendship/?key=KEY-HERE&cookie=Cookie-here& friendship_id =1
Method: friends_reject_friendship
This endpoint is used to mark a friendship request as rejected.
Required argument
- cookie
- friendship_id – ID of the pending friendship object.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_reject_friendship/?key=KEY-HERE&cookie=Cookie-here& friendship_id =1
Method: friends_withdraw_friendship
This endpoint is used to withdraw a friendship request.
Required argument
- cookie
- friendship_id – ID of the pending friendship object.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_withdraw_friendship/?key=KEY-HERE&cookie=Cookie-here& friendship_id =1
Method: friends_check_friendship
This endpoint is used to check whether two users are friends.
Required argument
- user_id
- friend_id – possible_friend_id of the other user.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_check_friendship/?key=KEY-HERE&user_id=1&friend_id =3
Method: friends_friendship_status
This endpoint is used to get the friendship status of two friends.
Required argument
- user_id
- friend_id – possible_friend_id of the other user.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_friendship_status/?key=KEY-HERE&user_id=1&friend_id =3
Method: friends_friend_count
This endpoint is used to get the friend count of a given user.
Required argument
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_friend_count/?key=KEY-HERE&user_id=1
Method: friends_has_friends
This endpoint is used to check whether a given user has any friends.
Required argument
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_has_friends/?key=KEY-HERE&user_id=1
Method: friends_friendship_id
This endpoint is used to get the ID of two users’ friendship, if it exists.
Required argument
- user_id
- friend_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_friendship_id/?key=KEY-HERE&user_id=1&friend_id=3
Method: friends_friend_ids
This endpoint is used to get the IDs of a given user’s friends.
Required argument
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_friend_ids/?key=KEY-HERE&user_id=1
Method: friends_search_friends
This endpoint is used to search the friends of a user by a search string.
Required argument
- user_id – ID of the user whose friends are being searched.
- search – The search string, matched against xprofile fields (if available), or usermeta ‘nickname’ field.
- key – get API key from Settings > User Plus
Optional arguments
- per_page – Max number of friends to return. Default : 10
- page – The page of results to return. Default: null (no pagination – return all results).
Example
http://localhost/api/userplus/friends_search_friends/?key=KEY-HERE&user_id=1&search=john
http://localhost/api/userplus/friends_search_friends/?key=KEY-HERE&user_id=1&search=john&page=2&per_page=5
Method: friends_friendship_request_user_ids
This endpoint is used to get a list of IDs of users who have requested friendship of a given user.
Required argument
- user_id – The ID of the user who has received the friendship
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_friendship_request_user_ids/?key=KEY-HERE&user_id=1
Method: friends_listing
This endpoint is used to search the friends of a user by a search string.
Required argument
- user_id – ID of the user whose friends are being retrieved.
- key – get API key from Settings > User Plus
Optional arguments
- type – Possible values- active, newest, alphabetical. Default – active
- per_page – Number of results to return per page. Default: 0 (no pagination; show all results).
- page – Number of the page of results to return. Default: 0 (no pagination; show all results).
- search – The search string, Limit results to those matching a search string.
Example
http://localhost/api/userplus/friends_listing/?key=KEY-HERE&user_id=1
http://localhost/api/userplus/friends_listing/?key=KEY-HERE&user_id=1&type=newest
http://localhost/api/userplus/friends_listing/?key=KEY-HERE&user_id=1&type=alphabetical
http://localhost/api/userplus/friends_search_friends/?key=KEY-HERE&user_id=1 &page=1&per_page=10
Method: friends_get_bulk_last_active
This endpoint is used to get the last active date of many users at once.
Required argument
- friend_ids – comma separated IDs of the friends
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_get_bulk_last_active/?key=KEY-HERE&friend_ids=1,2,4,6,7,8,12
Method: friends_group_invite_list
This endpoint is used to get a list of friends that a user can invite into this group.
Required argument
- user_id – User ID whose friends to see can be invited.
- group_id Group to check possible invitations against.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_group_invite_list/?key=KEY-HERE&user_id=1&group_id=3
Method: friends_count_invitable_friends
This endpoint is used to get a count of a user’s friends who can be invited to a given group
Required argument
- user_id ID of the user whose friends are being counted.
- group_id ID of the group friends are being invited to.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_count_invitable_friends/?key=KEY-HERE&user_id=1&group_id=3
Method: friends_friend_count_for_user
This endpoint is used to get a total friend count for a given user.
Required argument
- user_id ID of the user whose friends are being counted.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_friend_count_for_user/?key=KEY-HERE&user_id=1
Method: friends_is_friendship_confirmed
This endpoint is used to update user friend counts
Required argument
- friendship_id – The ID of the friendship being checked.
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/friends_is_friendship_confirmed/?key=KEY-HERE&friendship_id=16
Messages
Method: threads
This endpoint will fetch the message threads for user. There are number of optional parameters are available to filter and sort results.
Required argument
- cookie
- key – get API key from Settings > User Plus
Optional arguments
- box – possible values are ‘inbox’, ‘sentbox’ (default is ‘inbox’)
- page – returns a specific page number from the paginated results (default is 1)
- per_page – determines how many threads per page are returned (default value is 10)
- tsort – determines the threads sorting, possible values are ‘asc’ or ‘desc’ (default is ‘desc’)
- search – allows to search the term in the threads
- sender_id – restricts the results to this sender_id (this is beta feature)
Example
http://localhost/api/userplus/threads/?key=KEY-HERE&cookie=COOKIE-HERE
Method: thread
This endpoint is used to fetch the message thread conversation of the user with his friend(s).
Required arguments
- cookie
- thread_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/thread/?key=KEY-HERE&cookie=COOKIE-HERE&thread_id=23
Method: new_message
This endpoint is used to send new message to friend(s). You can also use to send reply a message. To reply existing thread, include the `thread_id` of the message.
Required arguments
- cookie
- recipient_ids – can be more than one id. Multiple recipient_ids must be comma separated
- subject
- content
- key – get API key from Settings > User Plus
Optional arguments
- thread_id – to reply existing thread message, include ‘thread_id’ variable, otherwise new thread will be started.
Example
http://localhost/api/userplus/new_message/?key=KEY-HERE&cookie=COOKIE-HERE&recipient_ids=COMMA-SEPARATED-IDs&subject=Test Msg&content=Content is here
Method: mark_thread_read
This endpoint is used to mark message thread as read.
Required arguments
- cookie
- thread_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/mark_thread_read/?key=KEY-HERE&cookie=COOKIE-HERE&thread_id=12
Method: mark_thread_unread
This endpoint is used to mark message thread as unread.
Required arguments
- cookie
- thread_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/mark_thread_unread/?key=KEY-HERE&cookie=COOKIE-HERE&thread_id=12
Method: messages_count
This endpoint is used to get unread messages count for the user.
Required arguments
- cookie
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/messages_count/?key=KEY-HERE&cookie=COOKIE-HERE
Activities
Method: activities
This endpoint is used to get BuddyPress activities. There are many optional parameters available to filter activities results. please check following examples for usage.
Required arguments
- key – get API key from Settings > User Plus
Optional arguments
- user_id – filter activity feed by user.
Default: false - type – filter activity feed by type, possible types: new_forum_post, new_blog_comment, new_blog_post, friendship_created, joined_group, created_group, new_forum_topic, activity_update, rtmedia_update.
Default: false - comments – whether or not to display comments along with activity items. Possible values: true, false.
Default: true - include – pass an activity_id or string of comma separated ids to show only these entries.
Default: false - sort – Sort the stream chronologically ascending or descending.
Possible values: ASC, DESC.
Default DESC. - limit – Number of activity items to show per page.
Default is 10. - page – Which page to return based on the number limit value.
Default= 1. - search_terms – search activities for any given term
- scope: pre-defined filtering of the activity stream. Show only activity for the scope you pass for user_id. ‘user_id’ must be provided for ‘scope’ call.
Accepted arguments: just-me, friends, groups, favorites, mentions
default value: just-me - primary_id: The ID to filter on for a specific object. For example if you used groups as the object you could pass a group_id as the primary_id and restrict to that group.
Possible arguments: Any specific object ID
Default value: false (no filter) - secondary_id: The secondary ID to filter on for a specific object. For example if you used blogs as the object you could pass a blog_id as the primary_id and a post_id as the secondary_id the list all comments for that post usingnew_blog_comment as the action.
Possible arguments: Any specific object ID
Default value: false (no filter) - component – The object type to filter on (can be any active component ID as well as custom component ID’s)
Example arguments: groups, friends, profile, status, blogs
Default value: false (no filter)
Examples
App wide Activities
http://localhost/api/userplus/activities/?key=KEY-HERE
Search terms within App wide Activities
http://localhost/api/userplus/activities/?key=KEY-HERE&search_terms=Testing
Search terms within User Activities
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&search_terms=Testing
User Activities
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1
User Activities in Groups
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&scope=groups
User Mentioned in Activity
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&scope=mentions
User Favorites in Activity
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&scope=favorites
User Activity by Action Type
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&type=new_forum_post
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&type=friendship_created
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&type=joined_group
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&type=created_group
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&type=new_forum_topic
http://localhost/api/userplus/activities/?key=KEY-HERE&user_id=1&type=activity_update
Method: activities_post_update
This endpoint is used to post an activity update.
Required arguments
- cookie
- content
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_post_update/?key=KEY-HERE&cookie=COOKIE-HERE &content=Content is here
Method: activities_delete_activity
This endpoint is used to delete an activity item by activity id. Only author of activity or the user who has capability can delete.
Required arguments
- cookie
- activity_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_delete_activity/?key=KEY-HERE&cookie=COOKIE-HERE&activity_id=12
Method: activities_new_comment
This endpoint is used to post a comment on activity item.
Required arguments
- cookie
- activity_id
- content
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_new_comment/?key=KEY-HERE&cookie=COOKIE-HERE &activity_id=12&content=comment content is here
Method: activities_delete_comment
This endpoint is used to delete a comment by comment id. Only author of comment or the user who has capability can delete comment.
Required arguments
- cookie
- activity_id
- comment_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_delete_activity/?key=KEY-HERE&cookie=COOKIE-HERE&activity_id=12&comment_id=13
Method: activities_get_user_favorites
This endpoint is used to get user’s favorite activity stream items.
Required arguments
- cookie
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_get_user_favorites/?key=KEY-HERE&cookie=COOKIE-HERE &user_id=12
Method: activities_total_favorites_for_user
This endpoint is used to retrieve the number of favorite activity stream items a user has.
Required arguments
- cookie
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_total_favorites_for_user /?key=KEY-HERE&cookie=COOKIE-HERE &user_id=12
Method: activities_add_user_favorite
This endpoint is used to add an activity stream item as a favorite for a user.
Required arguments
- cookie
- activity_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_add_user_favorite/?key=KEY-HERE&cookie=COOKIE-HERE &activity_id=12
Method: activities_remove_user_favorite
This endpoint is used to remove an activity stream item as a favorite for a user.
Required arguments
- cookie
- activity_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_remove_user_favorite/?key=KEY-HERE&cookie=COOKIE-HERE &activity_id=12
Method: activities_find_mentions
This endpoint is used to locate usernames in an activity content string, as designated by an @ sign.
Required arguments
- content
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_find_mentions/?key=KEY-HERE&content=content here
Method: activities_get_user_mentionname
This endpoint is used to determine a user’s “mentionname”, the name used for that user in @-mentions.
Required arguments
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_get_user_mentionname/?key=KEY-HERE&user_id=1
Method: activities_get_userid_from_mentionname
This endpoint is used to get a user ID from a “mentionname”, the name used for a user in @-mentions.
Required arguments
- mentionname
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_get_userid_from_mentionname/?key=KEY-HERE&mentionname=john
Method: activities_clear_new_mentions
This endpoint is used to reset a user’s unread mentions list and count.
Required arguments
- user_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/activities_clear_new_mentions/?key=KEY-HERE&user_id=1
Members
Method: members
Required arguments
- key – get API key from Settings > User Plus
Optional arguments
- type – Defines the type of users to return.
Accepted arguments: active, newest, popular, alphabetical, random
Default value: active - user_id – filter friends from members by user_id.
Default: false - include – Pass a user_id or string of comma separated user_ids to return on these users.
Default value: false - exclude – Pass a user_id or string of comma separated user_ids to exclude those users in the return.
Default value: false - limit – Number of activity items to show per page.
Default is 10. - page – Which page to return based on the number limit value.
Default= 1. - search_terms – Return members that match these search terms
Default value: false - meta_key – Only return users with this usermeta field.
Default value: false - meta_value – Only return users where the usermeta value matches. Requires meta_key.
Default value: false
Examples
All Members – Active
http://localhost/api/userplus/members/?key=KEY-HERE
All Members – Random
http://localhost/api/userplus/members/?key=KEY-HERE&type=random
All Members – Popular
http://localhost/api/userplus/members/?key=KEY-HERE&type=popular
All Members – Aphabetical
http://localhost/api/userplus/members/?key=KEY-HERE&type=alphabetical
All Members – Newest
http://localhost/api/userplus/members/?key=KEY-HERE&type=newest
Friends of User from Members
http://localhost/api/userplus/?key=KEY-HERE&user_id=1
Friends of User from Members with xprofile fields
http://localhost/api/userplus/?key=KEY-HERE&user_id=1&xprofile=Birthday,Beruf,Kinder
All Members – include only provided user_ids
http://localhost/api/userplus/members/?key=KEY-HERE&include=1,3,5,7
All Members – exclude provided user_ids
http://localhost/api/userplus/members/?key=KEY-HERE&exclude=1,3,5,7
Search Members – search_terms
http://localhost/api/userplus/members/?key=KEY-HERE&search_terms=john
Notifications
Method: notifications
This endpoint is used to get a user’s BuddyPress notifications. There are many optional parameters available to filter and sort the results.
Required arguments
- cookie
- key – get API key from Settings > User Plus
Optional arguments
- component_name – Name of the component to filter by.
- component_action – Name of the action to filter by.
- item_id – ID of associated item.
- is_new – Whether to limit to new notifications.
True returns only new notifications, false returns only non-new notifications. ‘both’ returns all. Default: true. - search_terms – Term to match against component_name or component_action fields.
- order_by – Database column to order notifications by. Default: date_notified
- sort_order – Either ‘ASC’ or ‘DESC’. Default: DESC
- page – Number of the current page of results. Default: false (no pagination – all items).
- per_page – Number of items to show per page. Default: false (no pagination – all items).
Example
http://localhost/api/userplus/notifications/?key=KEY-HERE&cookie=COOKIE-HERE
Method: notifications_unread_count
This endpoint is used to get a count of unread notification items for a user.
Required arguments
- cookie
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/notifications_unread_count/?key=KEY-HERE&cookie=COOKIE-HERE
Method: notifications_delete
This endpoint is used to delete a specific notification by its ID. This should only be used to remove spam notifications.
Required arguments
- cookie
- notification_id
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/notifications_delete/?key=KEY-HERE&cookie=COOKIE-HERE
Method: notifications_mark_all_by_type
This endpoint is used to mark notifications read/unread for a user by type.
Required arguments
- cookie
- component_name
- component_action
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/notifications_mark_all_by_type/?key=KEY-HERE&cookie=COOKIE-HERE&component_name=activity&component_action= mention
Method: notifications_mark_all
This endpoint is used to mark all notifications from a user as read.
Required arguments
- cookie
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/notifications_mark_all/?key=KEY-HERE&cookie=COOKIE-HERE
BuddyPress Settings
Method: settings_get_notifications
This endpoint is used to get a user’s BuddyPress settings for email notifications.
Required arguments
- cookie
- key – get API key from Settings > User Plus
Example
http://localhost/api/userplus/settings_get_notifications/?key=KEY-HERE&cookie=COOKIE-HERE
Method: settings_update_notifications
This endpoint is used to change a user’s BuddyPress settings for email notifications.
Required arguments
- cookie
- key – get API key from Settings > User Plus
Optional arguments
- notification_activity_new_mention – Possible values: ‘yes’, ‘no’. Default – yes
- notification_activity_new_reply – Possible values: ‘yes’, ‘no’. Default – yes
- notification_friends_friendship_request – Possible values: ‘yes’, ‘no’. Default – yes
- notification_friends_friendship_accepted – Possible values: ‘yes’, ‘no’. Default – yes
- notification_groups_invite – Possible values: ‘yes’, ‘no’. Default – yes
- notification_groups_group_updated – Possible values: ‘yes’, ‘no’. Default – yes
- notification_groups_admin_promotion – Possible values: ‘yes’, ‘no’. Default – yes
- notification_groups_membership_request – Possible values: ‘yes’, ‘no’. Default – yes
- notification_messages_new_message – Possible values: ‘yes’, ‘no’. Default – yes
Example
http://localhost/api/userplus/settings_update_notifications/?key=KEY-HERE&cookie=COOKIE-HERE
Single Domain License | Developer License | Business License |
|
|
|
$65.00 | $399.00 | $200.00 |