Favcy

Document Title:  Favcy User API for Calling User Data: Name, Image, Social Group Coin Balance

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 use to build an application using the Favcy User API

  1. Purpose: This document defines the API calls used to build applications on web and mobile assets by clients for creating a personalised user experience on their assets.
  2. Conventions: Sample code is written in Courier New Font
  3. Intended Audience: This document is intended for Developers wishing to build an application for personalised user experience 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

Overview

Favcy User API lets you showcase user information like their photograph, name and social coin values if the user is logged in to your asset via the Application Social Bot.

Customization  of the application is in the hands of the developers.

Favcy Status Overview

STATUS OVERVIEW

The following are the components of the STATUS_ERROR_TRUE

1

STATUS_BLANK

No parameter received or sent. Invalid Argument supplied.

2

STATUS_INVALID_MEMBERID

Combination irrelevantly tried

3

STATUS_MEMBER_NOT_PART_OF_GROUP

Member ID called which was part of Favcy but not part of the Group.

4

STATUS_API_KEY_MISSING

API key not entered while the Calling the API

5

STATUS_API_KEY_INCORRECT

Incorrect API key entered while calling the API

The following are the components of the STATUS_ERROR_FALSE

1

STATUS_ERROR_FALSE

By definition success. The call will generate User Photo (default photo sent if no photo available ), User Name, User Social Group Points/Coins

REQUEST PARAMETER

All Requests to be sent with the REQUEST AUTHORIZATION HEADER- HTTP HEADER (Refer to REQUEST AUTHORIZATION HEADER Subset)

1

/**

 * Get Userdata

 * url - /userdata

 * method - POST

 * params - favcy_app_id

           response - name, profile_pic, member_coins

 */

Response : STATUS_ERROR_FALSE

The Developer should obtain

Name of the User

Profile Picture

Member Coins

REQUEST AUTHORIZATION HEADER- HTTP HEADER

All REQUESTS are checked for app_id. app_secret

STATUS OVERVIEW : AUTHORIZATION HEADER: HTTP HEADER

1

STATUS_ERROR_TRUE  

Message Subset: API Key is Missing

2

STATUS_ERROR_TRUE

Message Subset: Access Denied, Invalid API

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/userdata");

curl_setopt($ch, CURLOPT_HTTPHEADER, array('app_secret:ENTER APP SECRET HERE',  'app_id:ENTER APP ID HERE'));

curl_setopt($ch, CURLOPT_POSTFIELDS,

http_build_query(array('favcy_member' => 'MEMBERID', 'app_id'=>'ENTER APP ID HERE')));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);

curl_close ($ch);

?>

//MEMBER ID comes via a Call Back Function.

When using this API, Implement this function after Application Social Bot Code (ASB) code

function widget_Login_Callback(favcymember) {

 }