Mobli SDK for PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Mobli PHP SDK (v.1.0)

The Mobli API is a set of APIs that allows you to perform GET requests in order to view photos and videos uploaded to mobli, and POST requests for uploading photos, commenting, sharing on other social media networks and more..

This repository contains the open source PHP SDK that allows you to access Mobli from your PHP app. Except as otherwise noted, the Mobli PHP SDK is licensed under the Apache Licence, Version 2.0 ( Mobli PHP SDK is based on Facebook PHP SDK.

You can perform requests as either a guest or as a logged in user. as a guest user you will be able to GET media such as popular photos, live media, etc.. as a logged in user you will be able also to upload media, comment, love photos etc..


require 'Mobli-SDK-PHP/src/mobli.php';

$mobli = new Mobli(array(
  'appId'  => 'YOUR_APP_ID',
  'secret' => 'YOUR_APP_SECRET',

// Get User ID
$user_id = $mobli->getUserId();

To make API calls:

if ($user_id)
		// Proceed knowing you have a logged in user who's authenticated.
		$private_profile = $mobli->get('/me');
	catch (MobliApiException $e)
		echo $e->getMessage();

	// Get a public profile.
	$public_profile = $mobli->get('/user/1');
catch (MobliApiException $e)
	echo $e->getMessage();

Login or logout url will be needed depending on current user state.

if ($user_id) {
  $logoutUrl = $mobli->getLogoutUrl();
} else {
  $loginUrl = $mobli->getLoginUrl();

As a guest you can for example GET popular:


as a logged in user you can perform GET or POST requests like this:

GET: $mobli->get('/me/feed')


posting an image:

$mobli->post_image('/media', array( 'extension' => 'jpg', 'type' => 'photo' // <-- this was missing ), 'image.jpg');

posting a comment:

$mobli->post("/media/7118158/Comments", array( 'text' => "Nice!" ));