Doc of Friends Inviter-API V5.0
The StesCodes Friends Inviter provides the ability to send invitation to social networks friends in seconds. The below is the technical document to configure the inviter.
Friends Inviter Documentation
 
OAuth method
Friends Inviter
  1. Add reference to the script file "StesCodes.js" file on your project, which helps to create formatted signature key
  2. Configure APP for Gmail, Yahoo and Windows Live to get API keys
  3. If you don't have signature key then use the trial signature key
    • You can get the trial signature from here
  4. Include the below in your project if you have analytics enabled.
                        
    <!-- analytics code starts here -->
    <div id="stescodes-root"></div>
     < script  id="stesanalytics" type="text/javascript" src='http://stescodes.com/js/stescodesanalytics.js?id=your license key&pdt=friendsinviter"></ script >
    <!-- analytics code ends here -->
    
    < script  language="javascript" type="text/javascript">
        friendsinviter.storeAnalytics = function() {
            StesCodesAnalytics.regGrab(friendsinviter.getAllContacts(), friendsinviter.getSelectedService());
        }
    </ script >
                        
                        
Fill the api keys and license keys in the below configuration and add it to your configuration file.
                        
  <appSettings>
        <!-- API EndPoint URL-->
        <add key="APIUrl" value="https://stescodes.com/api/friendsapi.aspx"/>
    
    <!-- Your Licese key here -->
    <add key="FIlicense" value="*********************************"/>
    
    <!-- Default Message-->
    <add key="Message" value="your sample message here"/>

    <!-- Configure Twitter API here https://dev.twitter.com/apps  -->
    <add key="TwApiKey" value="your twitter api key"/>
        <add key="TwSecretKey" value="your twitter api secret key"/>
    
    <!-- Configure LinkedIn API here https://www.linkedin.com/secure/developer -->
    <add key="LnApiKey" value="your linkedin api key"/>
        <add key="LnSecretKey" value="your linkedin api secret key"/>
    
    <!-- Skyrock https://www.skyrock.com/developer/application/   -->
    <add key="SkyconsumerKey" value="your skyrock api key"/>
        <add key="SkyconsumerSecret" value="your skyrock api secret key"/>
    
    <!-- Sonico https://www.sonico.com/api_request_keys.php   -->
    <add key="sonicoapiKey" value="your sonico api key"/>
    
    <!-- Facebook https://developers.facebook.com/apps -->
    <add key="FbAppId" value="your Facebook APP id here"/>
        <add key="FBLink" value="http://stescodes.com/invitefriends.aspx"/>
        <add key="FBPicture" value="http://stescodes.com/images/friendsinviter.jpg"/>

</appSettings>
                        
                    
OAuth Authentication
To start grabbing contacts using OAuth Method, you have to make request to three functions in order.
GetAuthenticationUrl
GetAccessToken
GrabContacts OAuth
If the StesCodes friendsinviter.js file is referenced on the project and if the friendsinviter functions are used to display the contacts then you don't have to explicitly call the analytics function to store analytics because its handled internally by the friendsinviter scrips. You can explicitly store the analytics by calling the below function

< script  language="javascript" type="text/javascript">
    friendsinviter.storeAnalytics();
</ script >
                    
If you are not using StesCodes friendsinviter scripts, then call the below function to log the analytics.

< script  language="javascript" type="text/javascript">
    StesCodesAnalytics.regGrab(<array of friends>,<service name>);
    
    example:
    StesCodesAnalytics.regGrab([{name:"":imageurl:"",id:""}], "twitter");
</ script >
                    
All the analytics can be view by following the below steps
  1. Login to your account here
  2. Navigate to view analytics
Format Signature
Inorder to format the signature key, the below file should be referenced on your project

                    
//Include on your page
 < script  type="text/javascript" src="js/StesCodes.js"></ script >

//Have the hidden field on your page
<input type="hidden" id="hdnLicKey" name="hdnLicKey" value=""/>

< script  language="javascript" type="text/javascript">
    //callback function for signature formatter
    var callbackFn = function(data) {
        //console.log(JSON.stringify(data));
        //your logic here
    }
    var formatSignature = function(license) {
        document.getElementById("hdnLicKey").value = license;
        //Syntax: StesCodes.init(,);
        //Example: StesCodes.init(<(required) - array of license keys>,<(optional) - callback frunction name>);
        StesCodes.init(license, "callbackFn");
    }
    var getFormattedKey = function() {
        //Syntax: StesCodes.getSignatureKey()
        //Example: StesCodes.getSignatureKey(<(optional) - license key>)
        return StesCodes.getSignatureKey(document.getElementById("hdnLicKey").value);
    }
    //Finally call
    formatSignature(['tx_6asasas7-ab45-bd97easas08ddsadas0']);
    
    //To get the formatted signature key call getFormattedKey() 
    var formattedSignatureKey = getFormattedKey();
</ script >
Error Handling
There are few error messages you need to taken care on your end
Error Description
1. Invalid domain The license(Signature Key) is not registered for this domain. You can change/edit your domain by following the steps listed in "Domain Change"
2. Invalid signature key The Signature Key is provided is invalid, please reference the receipt email from StesCodes to revalidate the entry of correct signature key. If still unable to resolve, please contact support@stescodes.com
3. Missing input Input parameters required for the call is missing. Please review the documentation for the required input parameters
4. This service is not available on your plan The service requested to grab contacts is not available on the purchased plan. Please purchase the required plan for this service and try again.
5. Signature key must be formatted, please refer Please refer here to format the signature key The signature key must be formatted using the StesCodes.js
6. This domain is not registered with StesCodes.com The license is valid for the domain which you provided on your account.
7. Invalid username & password The provided username and password is wrong.
8. Update email & mobile number on your aol account and retry Update your email and moble number by login to your AOL account.
Change Domain
If you want to change your domain or if you get the error message "invalid domain" (API response), please follow the steps below
To edit or change your domain
back to top