Getting Signature Key
|
|
The first step in using our Social Event Manager API is getting the signature key, signature
key(transaction id) is found once you make purchase and redirected to our website
and also found on the email which you receive from StesCodes after you make purchase.
The transaction id of StesCodes is refered to as signature key.
Inorder to use the trial, you need to generate the key here
http://stescodes.com/trial.aspx. You shall get the key based on the selection
of plan.
|
|
back to top
|
Social Event Manager
|
|
The next step after getting the signature key is to creating reference.
|
Reference
|
- Import the namespace "jquery_api.js"
<script type="text/javascript" language="javascript" src="./js/jquery_api.js"> </script>
|
|
back to top
|
Social Event Manager
|
|
Add the below appsettings on your web.config file
<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
|
Grab/Create Events
|
|
To start grabbing events, you have to make request to three functions
- getAuthenticationUrl
- getAccessToken
- getUserInformation
To configure API keys, click here
How to configure API keys.
|
|
Request for getAuthenticationUrl
|
|
Make a request to https://stescodes.com/eventsapi.aspx using "GET" method
(Please url encode the parameter values).
https://stescodes.com/eventsapi.aspx?
ServiceName=<servicename>&
ConsumerKey=<your consumer key>&
ConsumerSecret=<your consumer secret key>&
CallbackUrl=<return url>&
PolicyUrl=<policy page url>&
format=<return format>
|
|
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. 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. PolicyUrl
|
URL of your policy page.
|
Yes
|
|
6. Format
|
|
Yes
|
|
|
Response
|
|
The return type is a of format JSON and XML, below are the example response of JSON
and XML formats.
JSON response:
{ "token": "your token",
"tokensecret" : "your token secret",
"authurl" : "your authentication url",
"uid" : "User id",
"error" : "error if present"
}
XML response:
<?xml version="1.0"?>
<ArrayOfUserToken xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserToken>
<token>your token</token>
<tokensecret>your token secret</tokensecret>
<authurl>your authentication url</authurl>
<uid>user id</uid>
<error>user id</error>
</UserToken>
</ArrayOfUserToken>
|
|
back to top
|
|
Request for GetAccessToken
|
|
Make a request to https://stescodes.com/eventsapi.aspx using "GET" method
(Please url encode the parameter values).
https://stescodes.com/eventsapi.aspx?
ServiceName=<servicename>&
ConsumerKey=<your consumer key>&
ConsumerSecret=<your consumer secret key>&
CallbackUrl=<return url>&
Token=<your token>&
TokenSecret=<your token secret>&
TokenVerifier=<your token verifier>&
format=<return format>&
Signature=<formatted stescodes signature key>
|
|
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. 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 received after authentication.
|
Yes
|
|
6. TokenSecret
|
Your token secret
|
Yes
|
|
7. TokenVerifier
|
Token verifier received after authentication.
|
Yes
|
|
8. Format
|
|
Yes
|
|
9. Signature
|
Formated Signature:
|
Yes
|
|
|
Response
|
|
The return type is a of format JSON and XML, below are the example response of JSON
and XML formats.
JSON response:
{ "token": "your token",
"tokensecret" : "your token secret",
"authurl" : "your authentication url",
"uid" : "User id",
"error" : "error if present"
}
XML response:
<?xml version="1.0"?>
<ArrayOfUserToken xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UserToken>
<token>your token</token>
<tokensecret>your token secret</tokensecret>
<authurl>your authentication url</authurl>
<uid>user id</uid>
<error>user id</error>
</UserToken>
</ArrayOfUserToken>
|
|
back to top
|
|
Request for GrabEvents
|
Make a request to https://stescodes.com/eventsapi.aspx using "POST" method,
to grab events from various social networks(Please url encode the parameter values).
https://stescodes.com/eventsapi.aspx?
ServiceName=<servicename>&
ConsumerKey=<your consumer key>&
ConsumerSecret=<your consumer secret key>&
Token=<your token>&
TokenSecret=<your token secret>&
TokenVerifier=<your token verifier>&
Uid=<user id>&
format=<return format>&
Signature=<formatted stescodes signature key>
|
|
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
|
Your access token.
|
Yes
|
|
3. TokenSecret
|
Your token secret
|
Yes
|
|
4. TokenVerifier
|
Your Token verifier.
|
Yes
|
|
5. Uid
|
Your user id
|
Yes
|
|
6. Signature
|
Formated Signature:
|
Yes
|
|
7. ConsumerKey
|
Consumer key(API Key) which you received after registering you application on facebook, google, live, upcoming and lastfm.
|
Yes
|
|
8.ConsumerSecret
|
Consumer Secret(APi Secret) which you received after registering you application on facebook, google, live, upcoming and lastfm.
|
Yes
|
|
9. Format
|
|
Yes
|
|
|
Response
|
|
The return type is a of format JSON and XML, below are the example response of JSON
and XML formats.
JSON response:
[{
"eventurl":"",
"calendarname":"",
"id":"",
"location":"",
"name":"",
"rsvp":"",
"picture":"",
"starttime":"",
"endtime":"",
"description":"",
"error":""
}]
XML response:
<?xml version="1.0"?>
<ArrayOfeventdetails xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<eventdetails>
<eventurl></eventurl>
<calendarname></calendarname>
<id></id>
<location></location>
<name></name>
<rsvp></rsvp>
<picture></picture>
<starttime></starttime>
<endtime></endtime>
<description></description>
<error></error>
</eventdetails>
</ArrayOfeventdetails>
|
|
back to top
|
|
Request for Create Events
|
Make a request to https://stescodes.com/eventsapi.aspx using "POST" method,
to create event(Please url encode the parameter values).
https://stescodes.com/eventsapi.aspx?
ServiceName=<servicename>&
ConsumerKey=<your consumer key>&
ConsumerSecret=<consumer secret key>&
Token=<your token>&
eName=<event name>&
eDescription=<event description>&
eStartDate=<event start date(mm/dd/yyyy)>&
eStartTime=<event start time(hh:mm:ss)>&
eEndDate=<event end date(mm/dd/yyyy)>&
eEndTime=<event end time(hh:mm:ss)>&
eLocation=<event location>&
eRSVP=<rsvp>&
Signature=<formatted stescodes signature key>
|
|
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 and live.
|
Yes
|
|
2. Token
|
Your access token.
|
Yes
|
|
3. eName
|
Name of your event.
|
Yes
|
|
4. eDescription
|
Description of your event.
|
Yes
|
|
5. Signature
|
Formated Signature:
|
Yes
|
|
6. ConsumerKey
|
Consumer key(API Key) which you received after registering you application on facebook, google and live.
|
Yes
|
|
7.ConsumerSecret
|
Consumer Secret(APi Secret) which you received after registering you application on facebook, google and live.
|
Yes
|
|
8.eStartDate
|
Event start date in format mm/dd/yyyy.
|
Yes
|
|
9.eStartTime
|
Event start time in format(hh:mm:ss)
|
Yes
|
|
10.eEndDate
|
Event end date in format mm/dd/yyyy.
|
Yes
|
|
11.eEndTime
|
Event end time in format(hh:mm:ss)
|
Yes
|
|
12.eLocation
|
Location where you host your event.
|
Yes
|
|
13.eRSVP
|
RSVP
|
Yes
|
|
14. Format
|
|
Yes
|
|
|
Response
|
|
The return type 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
- Upload the auth.aspx page to your server.
- Do the below five steps when the user is redirected after authentication.
- 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)
- 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
- Redirect to the localhost url(for ex: Response.Redirect(http://localhost:2345/yourproject/auth.aspx?token=xxx&tokensecret=yyyy);)
- Now you will get the token in localhost for debugging.
- Remove the redirection part after you done with your debugging.
|
|
back to top
|
Binding
|
|
Once the informations are grabbed and received in collection object, you can bind the data to front end for registration process
or check with the database for existance of the user and if exist login.
|
|
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. Missing input
|
Missing the input parameter
|
|
4. This service not available on your plan
|
The service you are requesting to grab contacts are not available on your purchased
plan.
|
|
|
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
|