Kojib Connect (API)

API request to join/add user to an existing Group

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘joingroup’, ‘groupid’ => ‘groupid’,//Specify the groupid (You will find group id in gr_options table id column) ‘userid’ => ‘user@email.com’, ‘role’ => 0, ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_close($ch); $res = json_decode($res); if […]

API request to create a new group

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $datas = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘creategroup’, ‘name’ => ‘Group Name’, ‘password’ => 0, //Specify password for password protected group ‘visibility’ => true, //Specify false for Secret Group ‘sendpermission’ => 0, // Specify adminonly for granting send messages permission only to Group Admins […]

API request to delete a user

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘deleteuser’, ‘user’ => ‘user@email.com’,//username or email address ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_close($ch); $res = json_decode($res); if ($res->result) { } else { return $res->error; } ?>

API request to login or generate login link

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘login’, ‘user’ => ‘user@email.com’,//username or email address ‘redirect’ => ”,//You can specify URL to load after login (optional) ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_close($ch); $res = json_decode($res); if ($res->result) { return $res->loginlink; […]

API request to force logout a user

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘logout’, ‘user’ => ‘user@email.com’,//username or email address ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_close($ch); $res = json_decode($res); if ($res->result) { } else { return $res->error; } ?>

API request to get User info

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘getinfo’, ‘user’ => ‘user@email.com’,//username or email address ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_close($ch); $res = json_decode($res); if ($res->result) { return $res; //returns user information } else { return $res->error; } ?>

API request to edit existing user

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’, ‘do’ => ‘edituser’, ‘changename’ => ‘Change Name’, ‘changeusername’ => ‘Change Username’, ‘changeemail’ => ‘changeemail@esmail.com’, ‘changepass’ => ‘changepassword’, ‘changeavatar’ => ‘https://imageurlgoeshere’, ‘changerole’ => ‘3’, ‘cf_identifier’ => ‘customfieldvalue’,//Check edit custom field area for custom field Identifier ‘user’ => ‘user@email.com’,//username or email […]

API request to create new user

 Kojib Connect (API)

<?php $url = ‘https://Kojib.com/connect/’; $ch = curl_init($url); $data = array( ‘key’ => ‘Kojib Connect Secret Key’,//You will find this in Kojib Settings ‘do’ => ‘createuser’, ‘name’ => ‘Full Name’, ‘user’ => ‘username’, ’email’ => ‘user@email.com’, ‘pass’ => ‘password’, ‘avatar’ => ‘https://imageurlgoeshere’, ‘cf_identifier’ => ‘customfieldvalue’,//Check edit custom field area for custom field Identifier ‘role’ => ‘3’, […]