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:

  • Advanced Activity Feeds / Wall Plugin

  • Geo-Location, Geo-Tagging, Check-Ins & Proximity Search Plugin [only for Advanced Activity Feed’s location features]

Geo-Location Geo-Tagging Check-Ins Proximity & Search Plugin

These are the APIs for SocialEngine’s official Geo-Location, Geo-Tagging, Check-Ins Proximity Search Plugin.

Suggest Locations

Suggest Locations
GET/sitetagcheckin/suggest{?suggest}{&longitude}{&latitude}

Get the list of locations to be suggested to the user. This API call is useful for auto-suggest fields.

Example URI

GET /sitetagcheckin/suggest?suggest=suggest=california&longitude=longitude=9872&latitude=latitude=6782
URI Parameters
HideShow
suggest
string (optional) Example: suggest=california

string to be matched with locations’ names.

location_detected (optional, string, `location_detected
string (required) Default: california`) 

get detected location title.

longitude
integer (optional) Example: longitude=9872

get detected location longitude.

latitude
string (optional) Example: latitude=6782

get detected location latitude.

Request  valid
HideShow
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "resource_guid": 0,
    "label": "California, United States",
    "place_id": "ChIJPV4oX_65j4ARVW8IJ6IJUYs",
    "id": "sitetagcheckin_0",
    "type": "place",
    "prefixadd": "in"
  },
  {
    "resource_guid": 0,
    "label": "California Pizza Kitchen, City Avenue, Philadelphia, PA, United States",
    "place_id": "ChIJ7-P252LHxokRQQO--3PQsiU",
    "id": "sitetagcheckin_1",
    "type": "place",
    "prefixadd": "in"
  }
]
Response  401
HideShow
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}

Post Content Checkin

Post Content Checkin
POST/sitetagcheckin/content-checkin

Post content checkin in for particular content.

Parameter Required Type Example Description
body yes integer 1342 action id
subject_id yes integer 1342 action id
subject_type yes string blog content type
month no integer 2 month
day no integer 12 date
date no integer 22 day

Example URI

POST /sitetagcheckin/content-checkin
Request  valid
HideShow
Headers
Accept: application/json
oauth_consumer_key: e6a5845684bf49df63d9eef489acfee1
oauth_consumer_secret: 42b9eef48e96c65f9ca29d07712d39fb
Response  200
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Body
{
  "status_code": 400,
  "error": true,
  "error_code": "oauth_parameter_missing",
  "message": "Certain OAuth parameters are missing in your request."
}
Response  401
HideShow
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}
Response  404
HideShow
Body
{
  "status_code": 404,
  "error": true,
  "error_code": "no_record",
  "message": "No record found"
}
Response  500
HideShow
Body
{
  "status_code": 500,
  "error": true,
  "error_code": "internal_server_error",
  "message": null
}
Response  204
HideShow
Body
{
  "status_code": 204
}

Get Checkin Counts

Get Checkin Counts
GET/sitetagcheckin/checkin-count{?subject_id}{&subject_type}

Get Checkin Counts for a specific content if the content is integrated with the plugin from Admin Section

Example URI

GET /sitetagcheckin/checkin-count?subject_id=&subject_type=
URI Parameters
HideShow
subject_id
integer (required) 

subject id

subject_type
string (required) 

subject type

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
{
  "check_in_count": 2,
  "user_check_in_count": 2
}
Response  400
HideShow
Body
{
  "status_code": 400,
  "error": true,
  "error_code": "oauth_parameter_missing",
  "message": "Certain OAuth parameters are missing in your request."
}
Response  401
HideShow
Body
{
  "status_code": 401,
  "error": true,
  "error_code": "unauthorized",
  "message": "User does not have access to this resource."
}
Response  404
HideShow
Body
{
  "status_code": 404,
  "error": true,
  "error_code": "no_record",
  "message": "No record found"
}
Response  500
HideShow
Body
{
  "status_code": 500,
  "error": true,
  "error_code": "internal_server_error",
  "message": null
}

Generated by aglio on 13 Jan 2017