Document Title: Favcy API for Displaying Community Feed
All rights reserved. Unauthorized copying is prohibited.
Unless expressly agreed in writing, this document and its contents are the property of Favcy Dot Com. The enclosed information should not be duplicated, re-used, published or disclosed in any part or in whole for any purposes other than those intended. All contents of this information are considered confidential. Existence of the document does not constitute a publication of the information.
Introduction
This document defines the API that clients will utilize for Displaying Community Feeds.
1. Purpose: This document defines the API calls used to build applications on web and mobile assets by clients where they seek to display community feeds over and above the ones displayed through the ASB.
2. Conventions: Sample code is written in Courier New Font
3. Intended Audience: This document is intended for Developers wishing to build an application with the usage of the ASB and who are familiar with PHP, ASP programming.
This document contains confidential information proprietary to Favcy Dot com.
This document cannot be copied, circulated or substantively discussed without prior written approval.
FRAMEWORK: SLIM
DEPENDENT FRAMEWORK: Nil
BASE URL: http://www.favcy.com/favcy-rest/v1
SUB URL : /communityfeed
Overview
Favcy API for Displaying Community Feeds is agnostic of the ASB.
Developers are advised to visit the admin panel for obtaining the API key
Customization of the application is in the hands of the developers.
Favcy Status Overview
STATUS OVERVIEW
The following are the components of the fail STATUS
1 | STATUS_BLANK | No parameter received or sent. Invalid Argument supplied. |
2 | STATUS_API_KEY_MISSING | API key not entered while the Calling the API |
3 | STATUS_API_KEY_INCORRECT | Incorrect API key entered while calling the API |
The following are the components of the success STATUS
1 | STATUS_ERROR_FALSE Or STATUS:200 | By definition success. The call will generate a sub status: 'STATUS:200' and data (array) Data Array includes TID: Transaction ID TMESSAGE: Action Message TPROFILEPIC: Picture of the user TNAME: Name of the user TCOIN: Coin Value to be Displayed TCASH: Cash Advance figure if available.
|
REQUEST FORMAT
All Requests to be sent with the REQUEST AUTHORIZATION HEADER- HTTP HEADER (Refer to REQUEST AUTHORIZATION HEADER Subset)
1 | url - communityfeed
Get Community Feeds * url - /communityfeed * method - POST * params - app_id, trans_id(optional)
Response : error, status, data(array),
| Data Array includes TID: Transaction ID TMESSAGE: Action Message TPROFILEPIC: Picture of the user TNAME: Name of the user TCOIN: Coin Value to be Displayed TCASH: Cash Advance figure
|
REQUEST AUTHORIZATION HEADER- HTTP HEADER
All REQUESTS are checked for app_id. app_secret
Every API request should have an authorization header with the two fields - app_id and
app_secret. If one of the two parameters is missing, error message with an error code will be
obtained.
1 |
STATUS_ERROR_TRUE |
Message Subset: APP ID or APP SECRET is Missing |
2 |
STATUS_ERROR_TRUE |
Message Subset: Access Denied, Invalid APP ID or APP SECRET Key |
3 |
STATUS_404 |
Message Subset: Request Not Found. in case REQUEST HEADER not entered while Calling the API |
REQUEST EXAMPLE
PHP
<?php $ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.favcy.com/favcy-rest/v1/communityfeed");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('app_secret:ENTER APP SECRET',
'app_id:ENTER APP ID'));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( 'app_id'=>'ENTER YOUR APP ID', 'tid' => 'ENTER LAST TRANSACTION ID')));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec ($ch);
curl_close ($ch);
?>
|
//APP_ID : Received from the Admin Panel or the System Integrator
//TID: Default Last 50 called (Do not require to enter TID for calling last 50 Transactions)
If TID entered, last 50 array called from the TID entered.