SocialEngine REST API
What is REST API? Simply, REST API is the set of functions to which the developers can perform requests and receive responses. The interaction is performed via the HTTP/HTTPS protocol. An advantage of such an approach is the wide usage of HTTP/HTTPS that’s why REST API can be used practically for any programming language.
Below are the characteristics of the SocialEngineAddOns REST API:
-
When a request is sent to the REST API server, the server will return a response that contains either the data you requested, or the status code, or both.
-
oauth_consumer_key / oauth_consumer_secret? The
Consumer Key
andConsumer Secret Key
are used to make a connection between API client and server. These keys are also used for creatingOAuth Tokens
for site members to access server resources without sharing their credentials.
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
- oauth_token / oauth_secret? The
OAuth Token
andOAuth Secret
are used for identifying site members.
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
oauth_token: 276ed9327d0478c2606adea438f4fd15
oauth_secret: ffaff6754b5d4ca5f2fc4cc2a3a75478
Base URL
All requests to this REST API should have the base URL: [https://example.com/api/rest/]
HTTP Verbs
In REST API, there are four verbs that are used to manage resources: GET, POST, PUT, and DELETE. You can get the contents of a data using GET, delete the data using DELETE, and create or update the data using POST/PUT.
Supported Features
Official SocialEngine Plugins
-
Blogs Plugin
-
Photo Albums Plugin
-
Classifieds Plugin
-
Groups Plugin
-
Events Plugin
-
Forums Plugin
-
Polls Plugin
-
Video Sharing Plugin
-
Music Sharing Plugin
Core SocialEngine Features
-
Search
-
Member Links
-
Member Log-in
-
Member Sign-up With Profile Fields
-
Edit Member Profile Fields
-
Activity Feeds
-
Notifications
-
Friend Requests
-
Messages
-
Member Settings
-
Likes and Comments
-
Easy Implementation of Photo Lightbox.
-
Footer Menus
SocialEngineAddOns Plugins:
-
Advanced Activity Feeds / Wall Plugin
-
Geo-Location, Geo-Tagging, Check-Ins & Proximity Search Plugin [only for Advanced Activity Feed’s location features]
Suggestions Plugin ¶
These are the APIs for SocialEngine’s official Suggestions Plugin.
Suggestion Listing ¶
Get Suggestions ListGET/suggestions/suggestion-listing{?page}{&limit}
Returns the suggestions list.
Example URI
- page
integer
(optional) Example: page=2Returns the suggestions according to the specified page from suggestion list.
- limit
integer
(optional) Example: limit=1Returns specified number of suggestions per page. Default limit is 3.
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
oauth_token: 276ed9327d0478c2606adea438f4fd15
oauth_secret: ffaff6754b5d4ca5f2fc4cc2a3a75478
200
Headers
Content-Type: application/json
Body
[
{
"user_id": 1,
"email": "joe@gmail.com",
"username": "joe",
"displayname": "joe",
"photo_id": 161,
"status": "",
"status_date": "0000-00-00 00:00:00",
"password": "9ef08ef0cb2575e691cdc4429c333f86",
"salt": 7688854,
"locale": "auto",
"language": "en_US",
"timezone": "US/Pacific",
"search": 1,
"show_profileviewers": 1,
"level_id": 1,
"invites_used": 0,
"extra_invites": 0,
"enabled": 1,
"verified": 1,
"approved": 1,
"creation_date": "2016-07-25 10:09:59",
"creation_ip": 2130706433,
"modified_date": "2016-09-27 10:00:18",
"lastlogin_date": "2016-10-04 07:56:07",
"update_date": null,
"member_count": 1,
"view_count": 13,
"image": "www.example.com/public/user/a1/00a1_d37c.png?c=40b4",
"image_normal": "www.example.com/public/user/a3/00a3_5759.png?c=4050",
"image_profile": "www.example.com/public/user/a2/00a2_ce49.png?c=7d3f",
"image_icon": "www.example.com/public/user/a4/00a4_d2b0.png?c=c40c",
"content_url": "www.example.com/profile/admin",
"menus": [
{
"label": "Add Friend",
"name": "add_friend",
"url": "user/add",
"urlParams": {
"user_id": 1
}
},
{
"label": "Remove Suggestion",
"name": "remove_suggestion",
"url": "suggestions/remove",
"urlParams": {
"user_id": 1
}
}
]
}
]
401
Body
{
"status_code": 401,
"error": true,
"error_code": "unauthorized",
"message": "User does not have access to this resource."
}
404
Body
{
"status_code": 404,
"error": true,
"error_code": "no_record",
"message": "No record found"
}
Suggestion Remove ¶
Remove Suggestion From ListDELETE/suggestions/remove{?user_id}
Removes specified suggestion from suggestions list.
Example URI
- user_id
integer
(required) Example: 154User id of profile owner. Default value is logged-in user’s ID.
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
oauth_token: 276ed9327d0478c2606adea438f4fd15
oauth_secret: ffaff6754b5d4ca5f2fc4cc2a3a75478
204
401
Body
{
"status_code": 401,
"error": true,
"error_code": "unauthorized",
"message": "User does not have access to this resource."
}
404
Body
{
"status_code": 404,
"error": true,
"error_code": "no_record",
"message": "No record found"
}