Back to top

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 and Consumer Secret Key are used to make a connection between API client and server. These keys are also used for creating OAuth 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 and OAuth 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:

  • Group Content Profiles - Cover Photo, Banner & Site Branding Plugin

Content Profiles - Cover Photo, Banner & Site Branding Plugin

These are the APIs for SocialEngine’s official Content Profiles - Cover Photo, Banner & Site Branding Plugin.

Get Cover photo

Cover Photo
GET/advancedevents/view/

Get Cover photo of the content uploaded by the owner or default cover photo uploaded by the admin in parameter cover_image in response of any profile page API response.

Example URI

GET /advancedevents/view/
Request  valid
HideShow
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
        "response":{
            "event_id":600,
            "package_id":5,
            "title":"Global Citizen Festival ",
            "body":"Global citizen festival in mumbai",
            "owner_id":19658,
            "profile_type":11,
            "photo_id":101589,
            "category_id":47,
            "rating_editor":0,
            "rating_users":0,
            "location":"Mumbai, Maharashtra, India",
            "price":0,
            "review_count":0,
            "view_count":126,
            "comment_count":1,
            "like_count":3,
            "member_count":1,
            "search":1,
            "closed":0,
            "approved_date":"2016-12-19 08:15:39",
            "canUpload":1,
            "ledby":"<a  href="/profile/test1\">Alen J</a>",
            "rsvp":1,
            "image":"http://example.com//siteevent_event/63/8f/01/18cd5_1ff7.jpg?c=47ec",
            "image_normal":"http://example.com//siteevent_event/65/8f/01/18cd7_b468.jpg?c=04eb",
            "image_profile":"http://example.com//siteevent_event/64/8f/01/18cd6_fff9.jpg?c=b042",
            "image_icon":"http://example.com//siteevent_event/67/8f/01/18cd9_d9c8.jpg?c=a089",
            "content_url":"http://example.com/600/slug/global-citizen-festival",
            "default_cover":1,
            "cover_image":"http://example.com//system/6d/74/01/171fa_2ad9.jpg?c=1504",
            "owner_title":"Alen J",
            "owner_image":"http://example.com//user/b6/bf/01/1bcf8_739f.jpg?c=4121",
            "owner_image_normal":"http://example.com//user/b8/bf/01/1bcfa_de28.jpg?c=0293",
            "owner_image_profile":"http://example.com//user/b7/bf/01/1bcf9_f0cc.jpg?c=ad85",
            "owner_image_icon":"http://example.com//user/b9/bf/01/1bcfb_ebe1.jpg?c=9931",
            "get_attending_count":0,
            "get_maybe_count":1,
            "get_not_attending_count":0,
            "get_awaiting_reply_count":1
    }            
Response  401
HideShow
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}

Get Cover Photo Menus

Cover Photo Menus
GET/coverphoto/get-cover-photo-menu{?subject_id}{&subject_type}{&special}{&cover_photo}{&profile_photo}

Get Content Cover Photo / Profile Photo Menus

Example URI

GET /coverphoto/get-cover-photo-menu?subject_id=&subject_type=&special=special=cover&cover_photo=&profile_photo=
URI Parameters
HideShow
subject_id
integer (required) 

subject id

subject_type
string (required) 

subject type

special
string (optional) Example: special=cover

type of photo profile,cover, both

cover_photo
integer (optional) 

if cover photo uploaded

profile_photo
integer (optional) 

if profile photo uploaded

Request  valid
HideShow
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
oauth_token: 276ed9327d0478c2606adea438f4fd15
oauth_secret: ffaff6754b5d4ca5f2fc4cc2a3a75478
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    {
        "coverPhotoMenu":[
            {
                "label":"Upload Cover Photo",
                "name":"upload_cover_photo",
                "url":"coverphoto/upload-cover-photo",
                "urlParams":{
                    "subject_type":"siteevent_event",
                    "subject_id":600
                }
            },
            {
                "label":"Choose from Albums",
                "name":"choose_from_album",
                "urlParams":[

            ]
        }
    ]
}
}
Response  401
HideShow
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}

Upload Content Cover/Profile Photo

Upload Content Cover/Profile Photo
POST/coverphoto/upload-cover-photo/

Upload Content Cover/Profile Photo use special parameter to upload specific type of photo for cover photo use special=cover or special=profile for profile photo.

Parameter Required Type Example Description
photo_id no integer 1342 photo_id
photo no FILE Multipart photo = Photo1.jpg
subject_id yes integer 78 subject id
subject_type yes string event subject type
special no string cover cover or profile

Example URI

POST /coverphoto/upload-cover-photo/
Request
HideShow
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
oauth_token: 276ed9327d0478c2606adea438f4fd15
oauth_secret: ffaff6754b5d4ca5f2fc4cc2a3a75478
Response  204
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}

Remove Content Cover/Profile Photo

Remove Content Cover/Profile Photo
DELETE/coverphoto/remove-cover-photo/{?subject_id}{&subject_type}

Remove Content Cover/Profile Photo use ‘special’ parameter to remove specific type of photo, for cover photo use special=cover or special=profile for profile photo.

Example URI

DELETE /coverphoto/remove-cover-photo/?subject_id=&subject_type=
URI Parameters
HideShow
subject_id
integer (required) 

subject id

subject_type
string (required) 

subject type

special
string (optional) Example: special=cover

type of photo profile,cover, both

Request
HideShow
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
oauth_token: 276ed9327d0478c2606adea438f4fd15
oauth_secret: ffaff6754b5d4ca5f2fc4cc2a3a75478
Response  204
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}

Generated by aglio on 13 Jan 2017