StesCodes

Documentation of Social Event Manager WebService version 1.0

The StesCodes Social Event Manager provides the ability to grab and create events in clicks. The below is the technical document to configure it.
 

AutoUpdate DLL

Autoupdate is the first step in configuring StesCodes Social Event Manager, which will check for updates once every day. Once a update is found, the DLL will download the latest DLL from StesCodes server and update your old DLL automatically. Inorder to perform a manual update, you have to remove a file called "stescodes.im"(which keeps track of update) from your server and start grabbing for any of the service; which will basically force the update process to happen. Most importantly your project bin folder should have read/write permission. We recommend you to check the permission settings HERE. You shall download the autoupdate DLL by login to StesCodes ( http://stescodes.com/sourceupdate.aspx) and download your source code which contains the autoupdate.dll file.

Parameters

Please import namespace "autoupdate"
Parameters Description Required?
1. Context Gets the System.Web.HttpContext object associated with the page Yes
2. Signature Signature Key provided during purchase(license key) Yes
3. Bin Path The physical path to your bin directory to update the DLL. If this parameter were not passed then the default bin location inside the current directory will be choosen to update the DLL. If IMfile path is provided then the path to bin folder should be provided. eg: D:\myproject\bin (no slash after path) Optional
4. IMfile The physical path to some directory where stescodes.im file need to be saved. The IMfile save the information about the updates, so if this file location is passed as 4th parameter then this file location should be passed on "grabfriends" function as additional parameter. The directory should be provided with write permission. If IMfile path is provided then the path to bin folder should be provided. eg: D:\myproject\somepath (no slash after path) Optional
back to top

Social Event Manager

The next step after integrating autoupdate is the Social Event Manager integration.

Reference

For Plan A
  • Add reference to StesCodes_em.dll
  • Import the namespace "socialevent"
back to top

Settings

Add the below appsettings on your web.config file only for Plan D


   <add key="signaturekey" value="Your Signature key"/>


    <!--////////////////   SOCIAL EVENTS   ///////////////-->
    
    <!-- To get Google Events api key use this  https://code.google.com/apis/console/?pli=1#welcome:  -->
    <add key="googleapikey_EM" value="Google API key here"/>
    <add key="googleapisecret_EM" value="Google API secret key here"/>
    
    <!-- To get Yahoo Events api key use this  https://developer.apps.yahoo.com/projects  -->
    <add key="upcomingapikey_EM" value="Upcoming api key here"/>
    <add key="upcomingapisecret_EM" value=""/>
    
    <!-- To get Live Events api key use this  https://manage.dev.live.com  -->
    <add key="liveapikey_EM" value="Live api key here"/>
    <add key="liveapisecret_EM" value="live api secret key here"/>
    <add key="policyurl" value="your policy page url"/>
    
    <!-- To get Facebook Events api key use this http://www.facebook.com/developers/ -->
    <add key="facebookapikey_EM" value="Facebook API key here"/>
    <add key="facebookapisecret_EM" value="Facebook API secret key here"/>
    
    <!-- To get Live Events api key use this  http://www.last.fm/api/account  -->
    <add key="lastfmapikey_EM" value="last.FM API key here "/>
    <add key="lastfmapisecret_EM" value="last.FM secret key here"/>
            
back to top

OAuth method

To start grabbing friends using OAuth Method, you have to make request to three functions(this applies for Twitter and LinkedIn)

  1. getAuthenticationUrl
  2. getAccessToken
  3. GetEvents
  4. CreateEvents

To configure API keys, click here How to configure API keys.

Function for getAuthenticationUrl function

authdetails list_ut = getAuthenticationUrl(servicename, ConsumerKey, ConsumerSecret, callbackurl, policyurl);

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the social networks. Inorder to access a service use the below reference keywords
facebook, google, live, upcoming and lastfm.
Yes
2. callbackurl CallbackURL is the return url which is used, once the user is redirected to authorize, he/she will be redirected to the callbackurl (note: sometimes you might get error with callbackurl between www.xx.com and xx.com, so carefull with www) Yes
3. ConsumerKey Consumer key(API Key) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
4.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
5. policyurl URL of your policy page. Yes

Return type

The return type is collection.
  1. authurl
  2. Token
  3. TokenSecret
  4. TokenVerifier
  5. UID
  6. error
back to top

Function for getAccessToken function

authdetails listau = getAccessToken(servicename, ConsumerKey, ConsumerSecret, callbackurl, token, tokensecret, tokenverifier, signature, Context);

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the social network name. Inorder to access a service use the below reference keywords
facebook, google, live, upcoming and lastfm.
Yes
2. ConsumerKey Consumer key(API Key) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
3.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
4. callbackurl CallbackURL is the return url which is used, once the user is redirected to authorize, he/she will be redirected to the callbackurl (note: sometimes you might get error with callbackurl between www.xx.com and xx.com, so carefull with www) Yes
5. Token Token which you received through callback url after user redirection from authorization page. Yes
6. TokenSecret TokenSecret which you receive from "getAuthenticationUrl" as return parameters. Yes/No
7. TokenVerifier TokenVerifier which you received through callback url after user redirection from authorization page. Yes/No
8. Context Gets the System.Web.HttpContext object associated with the page Yes
9. IMfile If you provide the IMfile path as additional parameter to autoupdate function, then you have to provide the same path here as well. eg: D:\myproject\somepath (no slash after path) Optional

Return type

The return type is collection.
  1. authurl
  2. Token
  3. TokenSecret
  4. TokenVerifier
  5. UID
  6. error
back to top

Function for GetEvents

List<eventdetails> list_ed = GetEvents(servicename, token, tokensecret, ConsumerKey, ConsumerSecret, uid, signature, this.context);

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the mail servers. Inorder to access a service use the below reference keywords
facebook, google, live, upcoming and lastfm.
Yes
2. Token Token which you received from "GetAccessToken" as return parameter. Yes
3. TokenSecret TokenSecret which you receive from "GetAccessToken" as return parameters. Yes/No
4. ConsumerKey Consumer key(API Key) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
5.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
6. uid User ID Yes
7. Signature Signature key Yes
8. Context Gets the System.Web.HttpContext object associated with the page Yes
9. IMfile If you provide the IMfile path as additional parameter to autoupdate function, then you have to provide the same path here as well. eg: D:\myproject\somepath (no slash after path) Optional

Return Types

The return type is collection.
  1. eventurl
  2. calendarname
  3. endtime
  4. id
  5. location
  6. name
  7. rsvp
  8. picture
  9. starttime
  10. description
  11. error
back to top

Function for CreateEvents

string status = sendInvitation(serviceName, Token, TokenSecret, ename, edesc, estartdate, estarttime, eenddate, eendtime, elocation, eRSVP, ConsumerKey, ConsumerSecret, signature);

Parameters

Parameters Description Required?
1. ServiceName Service Name refers to the socialnetwork name. Inorder to access a service use the below reference keywords
facebook, google, live, upcoming and lastfm.
Yes
2. Token Token which you received from "GetAccessToken" as return parameter. Yes
3. TokenSecret TokenSecret which you receive from "GetAccessToken" as return parameters. Yes/No
4. eName Name of your event. Yes
5. eDescription Description of your event. Yes
6.eStartDate Event start date in format mm/dd/yyyy. Yes
7.eStartTime Event start time in format(hh:mm:ss) Yes
8.eEndDate Event end date in format mm/dd/yyyy. Yes
9.eEndTime Event end time in format(hh:mm:ss) Yes
10.eLocation Location where you host your event. Yes
11.eRSVP RSVP Yes
12. ConsumerKey Consumer key(API Key) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
13.ConsumerSecret Consumer Secret(APi Secret) which you received after registering you application on facebook, google, live, upcoming and lastfm. Yes
14. Signature Signature key Yes
15. Context Gets the System.Web.HttpContext object associated with the page Yes
16. IMfile If you provide the IMfile path as additional parameter to autoupdate function, then you have to provide the same path here as well. eg: D:\myproject\somepath (no slash after path) Optional

Return Types

The return type is string.
status
back to top

Debugging

Debugging Windows Live:

Debugging for Hotmail, MSN and msnmessenger is hard when compared to other services because in OAuth method, for the three services, you receive the token in post data other than in querystring. So follow the below steps to debug in local
  1. Upload the auth.aspx page to your server.
  2. Do the below five steps when the user is redirected after authentication.
  3. Get the post data and construct as a url with querystring parameter(for ex: token=xxx&tokensecret=yyyy as http://youdomain.com/auth.aspx?token=xxx&tokensecret=yyyy)
  4. After constructing the parameter change the constructed url to localhost url(for ex: http://youdomain.com/auth.aspx?token=xxx&tokensecret=yyyy to http://localhost:2345/yourproject/auth.aspx?token=xxx&tokensecret=yyyy
  5. Redirect to the localhost url(for ex: Response.Redirect(http://localhost:2345/yourproject/auth.aspx?token=xxx&tokensecret=yyyy);)
  6. Now you will get the token in localhost for debugging.
  7. Remove the redirection part after you done with your debugging.
back to top

Binding

Once the events are grabbed and received in collection object, you should loop through to access the object and bind the data to front end, its all customizable.
back to top

Error Handling

There are few error messages you need to taken care on your end

Error Message

Error Description
1. Invalid domain The license(Signature Key) is not registered for this domain. You shall change/edit your domain here http://stescodes.com/sourceupdate.aspx
2. Invalid key The Signature Key is invalid.
3. File missing! add code to check update Please include the code for autoupdate or some times the path to Imfile was not located. So pass the IMfile location as additional parameter to the grabbing function.
4. Add code to check update Please include the code for autoupdate.
5. Username & Password invalid! The username or password is invalid.
6. Please try again Please try again one more time.
&. This service not available on your plan The service you are requesting to grab friends are not available on your purchased plan.
back to top

Configurations

Inorder to perform the autoupdate process successfully, your project should be read/write enabled. Once found update, two files will be updated, one is Social Event Manager dll which is inside bin folder and other is stescodes.im which is outside the bin folder. The stescodes.im file has the details of update info.

If you don't want to provide write permission for the entire project, then follow the below steps:

  • Create a folder with write permission or specify a folder with write permission for IMfile
  • Pass the location of folder to "checkforupdate" function as fourth parameter(eg: checkforupdate(this.Context, signature,bin location,IMfile location);)
  • Also specify the path as additional parameter to "grabFriends"(specify as third parameter) function

Permissions

Inorder to perform the autoupdate process successfully, your project should be read/write enabled.
back to top

Turn On/Off AutoUpdate

Turn OFF:

In order to turn off autoupdate, login to http://stescodes.com/sourceupdate.aspx then click OFF button. Once autoupdate is set OFF, the DLL with latest updates will not be updated on your server automatically, you have to manually update by downloading the latest DLL from customer login. No need to providing write permission for bin folder.

Even though you turn OFF the autoupdate feature, you should have the below on your project.

  • Either you should create a folder with write permission OR provide write permission to root folder. This process is necessary for the stescodes.im file to be created which keeps track of the service validations.
  • If you create a folder with write permission then specify that location as parameter for "autoupdate" function and "grabFriends" function(refer above for passing parameter).

Turn ON:

In order to turn ON autoupdate, login to http://stescodes.com/sourceupdate.aspx then click ON button. Once autoupdate is set ON, the DLL with latest updates will be updated on your server automatically.

If you turn ON the autoupdate feature, you should have the below on your project

  • Either you should create a folder with write permission OR provide write permission to root folder.
  • If you create a folder with write permission then specify that location as parameter for "autoupdate" function and "grabFriends" function(refer above for passing parameter).

back to top

Change Domain

If you get the domain is invalid and you purchased license for that domain, then you shall follow the below steps to update your domain.

Edit/Change Domain

To edit or change your domain
  • Login to http://stescodes.com/sourceupdate.aspx
  • You shall login using email and password which you received in email during purchase or you shall use the StesCodes transaction id
  • Once you login, click the edit link near website
  • Enter the domain details
  • Click "proceed" to save.
back to top
HOME | TERMS OF SERVICE | PRODUCT | CONTACT US | PRIVACY POLICY | FAQ | SITE MAP
Copyright 2011 stescodes.com