Developers
Explore the developer tools we offer
API Version 1.0
This documentation explains how to develop, register and configure your app so you can use our APIs
Create App
To allow your app to access our APIs, you need to register it using the App Dashboard. Registration creates an App ID that helps us identify you and distinguish your app from others..
- You need to create a new app Create New App
- Once you create your app, you will receive your app_id and app_secret.
Sign in with Fankolo
Our authorization system provides a quick and easy way for users to create accounts and log into your app. It supports two scenarios: authentication, and requesting permissions to access user data. You can use it for authentication only, or for both authentication and data access..
-
To start the OAuth login process, use a link like this:
<a href="https://www.fankolo.com/api/oauth?app_id=YOUR_APP_ID">Sign in with Fankolo</a>
The user will be redirected to the 'Sign in with Fankolo' page, which looks like this:
-
After the user confirms signing in with your app, they will be redirected to your App Redirect URL with an auth_key like this:
https://yourdomain.com/your_redirect_url.php?auth_key=AUTH_KEY
This auth_key is valid for one-time use only. After using it, you will need to redirect the user to the sign in link again to generate a new one.
Access Token
Once the user approves your app's access through the 'Sign in with Fankolo' window you'll receive the auth_key, you are ready to retrieve data from our APIs. To start, you need to authorize your app and obtain an access_token. Follow the steps below to learn how to get it.
-
To get an Access Token, make an HTTP GET request to the following Endpoint:
api/authorize
<?php $app_id = "YOUR_APP_ID"; // your app id $app_secret = "YOUR_APP_SECRET"; // your app secret $auth_key = $_GET['auth_key']; // the returned auth key from previous step $get = file_get_contents("https://www.fankolo.com/api/authorize?app_id=$app_id&app_secret=$app_secret&auth_key=$auth_key"); $json = json_decode($get, true); if(!empty($json['access_token'])) { $access_token = $json['access_token']; // your access token } ?>
This access_token is valid for one hour only. Once it expires, you will need to redirect the user to the log in link again to generate a new one.
APIs
Once you have your access_token, you can retrieve information from our system via HTTP GET requests using the following parameters.
Endpoint | Description |
---|---|
api/get_user_info |
Get user info |
You can retrieve user info like this:
if(!empty($json['access_token'])) { $access_token = $json['access_token']; // your access token $get = file_get_contents("https://www.fankolo.com/api/get_user_info?access_token=$access_token"); }
The response will be in JSON format:
{ "user_info": { "user_id": "", "user_name": "", "user_email": "", "user_firstname": "", "user_lastname": "", "user_gender": "", "user_birthdate": "", "user_picture": "", "user_relationship": "", "user_biography": "", "user_website": "" } }
In case of error the response will be:
{ "error":true, "message":"Error description" }