Download API

You need your JBS Partner Username and API Key for any request to our API. If you don't have an API Key yet, you can register here and await approval.


The JBS API avails a channel to interact with JBS Servers for developers who wish to integrate JBS for Schools into their apps. This will thus enable them to display personalized data for their users as academic records, fees status, library usage, co-curricular activities participation and much more.

You will have to download our REST API class, JBSApi.php, which we avail to make your integration process as simple as possible.

For authenticity, we require that a developer who intends to integrate their apps with JBS must register to acquire an API Key which grants access. You will receive a response with 48hrs upon registration.

Further, an approval letter from the institution to be accessed is required, indicating that the institution granted you permission to access their cloud-data.

Download API

Authentication: accessing user information

In your app, you will require to authenticate users to grant access.

Below is an example of how to fetch user details based on the admission number supplied.

The server expects:
Parameter Location Description Required
API key Header API key issued upon registration as JBS partner/developer Yes
Accept Header This is the format you would like your data formatted. It may be application/xml or application/json. The default is application/xml. The gateway classes provided uses appliaction/json. No
username Body This is your username Yes
jbs_code Body The JBS code of the accessed institution Yes
admNo Body The admission number of the user (student) Yes

Your code:
<?php
// Be sure to include the file you downloaded
require_once('JBSApi.php');

// Specify your authentication credentials
$username   = "YourAppUsername";
$apikey     = "YourAppAPIKey";

// Specify the JBS code of the target institution
$jbs_code = 85;

// And of course the admission number of the specific student
$admNo    = 6701;

// Create a new instance of our API class class
$jbs    = new JBSApi($username, $apikey);

// Any API error will be captured by our custom Exception class below, 
// so wrap the call in a try-catch block

try 
{ 
  // Thats it, now fetch user data through the instance. 
  $results = $jbs->userData($jbs_code, $admNo);
			
  foreach($results as $result) {
    echo " admNo: " .$result->admNo;
    echo " SName: " .$result->SName;
    echo " FName: " .$result->FName;
    echo " MName: " .$result->MName;
    echo " inClass: " .$result->inClass;
    echo " stream: " .$result->stream;
    echo " year: "   .$result->year;
    echo " phone: "   .$result->phone."\n";
  }
}
catch ( JBSException $e )
{
  echo "Error occured: ".$e->getMessage();
}

// That simple!!! 

Upon successful processing, the server responds in the following JSON format:

[
	{"admNo":"7100"},
    {"SName":"PRISICLLA"},
    {"FName":"GITONGA"},
    {"MName":"Athiambo"},
    {"class":"Form 4"},
    {"stream":"B"},
    {"year":"2018"}
    {"phone":"+254725643546"}
 ]
Download API

Academics: fetching list of all exams done by user

To access academic records, you need to get the list of available exams done by the user.

The listing contains an ID for each exam, which you use to fetch results of the user (student) for that exam.

The server expects:
Parameter Location Description Required
API key Header API key issued upon registration as JBS partner/developer Yes
Accept Header This is the format you would like your data formatted. It may be application/xml or application/json. The default is application/xml. The gateway classes provided uses appliaction/json. No
username Body This is your username Yes
jbs_code Body The JBS code of the accessed institution Yes
admNo Body The admission number of the user (student) Yes
clsName Body The class of student of which you need exams done in No
term Body The term in the year of which you need exams done in No

Your code:
<?php
// Be sure to include the file you downloaded
require_once('JBSApi.php');

// Specify your authentication credentials
$username   = "YourAppUsername";
$apikey     = "YourAppAPIKey";

// Specify the JBS code of the target institution
$jbs_code = 85;

// And of course the admission number of the specific student
$admNo    = 6701;

// Optional fields: You can specify the class and term for which to fetch exams. If left, you fetch all exams done.
$clsName    = 'Form 2';
$term    = 2;

// Create a new instance of our API class class
$jbs    = new JBSApi($username, $apikey);

// Any API error will be captured by our custom Exception class below, 
// so wrap the call in a try-catch block

try 
{ 
  // Thats it, now fetch exams list through the instance. 
  $results = $jbs->examsList($jbs_code, $admNo, $clsName, $term);
			
  foreach($results as $exam) {
        echo " id: " .$exam->id;
        echo " exam: " .$exam->exam."\n";
  }
}
catch ( JBSException $e )
{
  echo "Error occured: ".$e->getMessage();
}

// That simple!!! 

Upon successful processing, the server responds in the following JSON format:

[
	[
    	{"id":"291663"},
        {"exam":"Form 2 T2 Opener"}
    ],
    [
     	{"id":"299255"},
        {"exam":"Form 2 T2 Midterm"}
    ],
    [
     	{"id":"342303"},
        {"exam":"Form 2 T2 End of term"}
    ]
 ]
Download API

Academics: results of a given exam for the user

Upon fetching exams list for the user, you can use the ID for each exam to fetch results.

Below is an example of fetching results for a given exam.

The server expects:
Parameter Location Description Required
API key Header API key issued upon registration as JBS partner/developer Yes
Accept Header This is the format you would like your data formatted. It may be application/xml or application/json. The default is application/xml. The gateway classes provided uses appliaction/json. No
username Body This is your username Yes
jbs_code Body The JBS code of the accessed institution Yes
admNo Body The admission number of the user (student) Yes
examID Body The ID of the required exam Yes

Your code:
<?php
// Be sure to include the file you downloaded
require_once('JBSApi.php');

// Specify your authentication credentials
$username   = "YourAppUsername";
$apikey     = "YourAppAPIKey";

// Specify the JBS code of the target institution
$jbs_code = 85;

// And of course the admission number of the specific student
$admNo    = 6701;

// Then you specify the ID of the exam required.
$examID    = 291663;

// Create a new instance of our API class class
$jbs    = new JBSApi($username, $apikey);

// Any API error will be captured by our custom Exception class below, 
// so wrap the call in a try-catch block

try 
{ 
  // Thats it, now fetch exam results through the instance. 
  $results = $jbs->results($jbs_code, $admNo, $examID);
			
  foreach($results as $subjectName) {
        echo " subject: " .$subjectName->subject;
        echo " score: " .$subjectName->score."\n";
  }
}
catch ( JBSException $e )
{
  echo "Error occured: ".$e->getMessage();
}

// That simple!!! 

Upon successful processing, the server responds in the following JSON format:

[
	[
    	{"subject":"ENGLISH"},
        {"score":"70A-"}
    ],
    [
        {"subject":"KISWAHILI"},
        {"score":"61B-"}
    ],
    [
        {"subject":"MATHEMATICS"},
        {"score":"76A"}
    ],
    [
        {"subject":"BIOLOGY"},
        {"score":"88A"}
    ],
    [
    .
    .
    .
    [
        {"subject":"TOTAL MARKS"},
        {"score":"915 out of 1200"}
    ],
    [
        {"subject":"TOTAL POINTS"},
        {"score":"127 out of 144"}
    ],
    [
        {"subject":"MEAN"},
        {"score":"10.58 A-"}
    ],
    [
        {"subject":"CLSPOS"},
        {"score":"12 out of 52"}
    ],
    [
        {"subject":"OVRPOS"},
        {"score":"48 out of 433"}
    ]
]

Download API

Fees status: current fees balance

Fetching the fees balance of a given student is as illustrated below.

P.S unprocessed value in the server response indicates amount that has been paid via mobile money (MPesa, Aitel money) and not processed yet at school. Reduce it in the balance to give current standing.

The server expects:
Parameter Location Description Required
API key Header API key issued upon registration as JBS partner/developer Yes
Accept Header This is the format you would like your data formatted. It may be application/xml or application/json. The default is application/xml. The gateway classes provided uses appliaction/json. No
username Body This is your username Yes
jbs_code Body The JBS code of the accessed institution Yes
admNo Body The admission number of the user (student) Yes
term Body The term of the current year for which to fetch balance upto Yes

Your code:
<?php
// Be sure to include the file you downloaded
require_once('JBSApi.php');

// Specify your authentication credentials
$username   = "YourAppUsername";
$apikey     = "YourAppAPIKey";

// Specify the JBS code of the target institution
$jbs_code = 85;

// And of course the admission number of the specific student
$admNo    = 6701;

// The term of the current year for which to fetch balance upto
$term    = 2;

// Create a new instance of our API class class
$jbs    = new JBSApi($username, $apikey);

// Any API error will be captured by our custom Exception class below, 
// so wrap the call in a try-catch block

try 
{ 
  // Thats it, now fetch fees balance through the instance. 
  $results = $jbs->feesBalance($jbs_code, $admNo, $term);
			
  foreach($results as $result) {
    echo " balance: " .$result->balance;
    echo " unprocessed: " .$result->unprocessed."\n";
  }
}
catch ( JBSException $e )
{
  echo "Error occured: ".$e->getMessage();
}

// That simple!!! 

Upon successful processing, the server responds in the following JSON format:

[
	{"balance":1,000.00},
    {"unprocessed":0.00}
 ]
Download API

Fees status: fetching most recent fees receipts - 30 maximum

Below is an example of how to fetch most recent receipts of a given student.

The server expects:
Parameter Location Description Required
API key Header API key issued upon registration as JBS partner/developer Yes
Accept Header This is the format you would like your data formatted. It may be application/xml or application/json. The default is application/xml. The gateway classes provided uses appliaction/json. No
username Body This is your username Yes
jbs_code Body The JBS code of the accessed institution Yes
admNo Body The admission number of the user (student) Yes

Your code:
<?php
// Be sure to include the file you downloaded
require_once('JBSApi.php');

// Specify your authentication credentials
$username   = "YourAppUsername";
$apikey     = "YourAppAPIKey";

// Specify the JBS code of the target institution
$jbs_code = 85;

// And of course the admission number of the specific student
$admNo    = 6701;

// Create a new instance of our API class class
$jbs    = new JBSApi($username, $apikey);

// Any API error will be captured by our custom Exception class below, 
// so wrap the call in a try-catch block

try 
{ 
  // Thats it, now fetch recent receipts through the instance. 
  $results = $jbs->feesReceipts($jbs_code, $admNo);
			
  foreach($results as $receipt) {
    echo " id: " .$receipt->id;
    echo " amount: " .$receipt->amount;
    echo " mode: " .$receipt->mode."\n";
  }
}
catch ( JBSException $e )
{
  echo "Error occured: ".$e->getMessage();
}

// That simple!!! 

Upon successful processing, the server responds in the following JSON format:

[
	[
    	{"id":"11707"},
        {"amount":"10,710"},
        {"mode":"bank slip"}
    ],
    [
    	{"id":"9085"},
        {"amount":"3,100"},
        {"mode":"bank slip"}
    ],
    [
        {"id":"8588"},
        {"amount":"5,000"},
        {"mode":"cheque"}
    ],
    [
        {"id":"8422"},
        {"amount":"8,000"},
        {"mode":"cheque"}
    ],
    .
    .
    .
 ]