The Graph API demonstrated will provide you with all the data that is also available via the admin console at sabek.co.ke
The following code snippet illustrates how to use sabek's graph api in your application, to login to your account and get an authorisation token and log in and request for your data
const async = require("async")
const request = require('request');
var token;
const assert = require("assert")
async.series([
function getAuthKeys(next) {
var query =
`query getToken($username:String!,$password:String!){
auth(username:$username, password:$password){
hash,
message
}
}`;
request.post({
url: 'http://localhost:9000',
form: {
query: query,
variables: JSON.stringify({
"username": "[email protected]",
"password": "testdd"
})
}
}, function(err, response, body) {
assert.ifError(err)
if (!err && response.statusCode == 200) {
// contains the token
var response = JSON.parse(body)
console.log(response.data.auth.hash)
token = response.data.auth.hash
}
next()
})
},
function getData(next) {
var query =
`query finder($id:String!){
organisation(id:$id){
name,
id,
location,
admins{
email,
contact
},
contacts{
id,
name,
number
},
groups{
id,
name,
contacts{
id,
name,
number
}
},
errors{
key,
message
}
}
}`;
request.post({
url: 'http://localhost:9000',
form: {
token: token,
query: query,
variables: JSON.stringify({
"id": "057cc8b0-a95f-11e6-bc3e-371d1cf1f0d6"
})
}
}, function(err, response, body) {
if (!err && response.statusCode == 200) {
console.log(body)
}
next()
})
}
], (err) => {
console.log("complete")
})
hey @GochoMugo sorry for the late responce, if you have an account in sabek.co.ke all the data that you have access to on the admin interface is available to you via this api, everything you can see and every action that is possible including sensing sms.
this means that if you are interested in making another application for your customers whether it be an android app or anything else, you dont have to build a backend, you can use the information that exposed on this api and store your data here too. for free and you get to resell as you please rather than having to mentain your own backend