Setup & Configuration

SDK that allows you to add, edit or remove users to MQTT chat through a REST API.
Since you do not have direct access to our database, you need an SDK as an intermediary to add your users to MQTT chat, edit user's informations etc . SDKs are based on calls to the REST API hosted on our web servers. All queries are authenticated using HTTP Basic Authentification.
In this documentation we will see differents operations you can do with MQTT chat SDKs in the programming languages currently available: php.

Setup

Before you can use the SDK, you must install it in the environment in which you want to use.
PHP
You can install PHP SDK using two methods:
  • Using PHP composer: The easiest way is to use php Composer, you should first install php composer software then install the sdk using this command line.
composer require med_aboub/mqttchat-php-sdk
  • Download latest release from Github repository and extract the zip content in your website root path.

Configuration

You should now create MQTTchat account and activate a free or paied subscription for your domain. Once activation is successful, you will receive in your admin panel (settings tab) the two parameters APP_ID and APP_SECRET. These two parameters are required to authenticate with our API.
PHP
You should add authentication settings to config file of your PHP SDK located at : src/telifoun/mqttchat/config.php.
namespace telifoun\mqttchat;
class config{
/** telifoun mqttchat app_id **/
const APP_ID="mqttchat-xxxxxxxx";
/** telifoun mqttchat app_secret **/
const APP_SECRET="mqttchat-xxxxxxxxxxxxxxxx";
/* .... */
}