I want to use vocalocity API. for using the services,i need to authenticate the session and then need to use Active session.I am the logged in but not sure how to capture required session id.
Code to log in:
String url = "https://my.vocalocity.com/appserver/rest/user/null";
WebRequest myReq = WebRequest.Create(url);
String username = "xxx";
String password = "yyy";
myReq.Headers.Add("login", username);
myReq.Headers.Add("password", password);
WebResponse wr = myReq.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8);
string content = reader.ReadToEnd();
Output json
content: {
"accountId" : xxxxx,
"userStatusID" : 1,
"loginName" : "xxx",
"firstName" : "xxx",
"lastName" : "xxx",
"email" : "xx@xx.com",
"phoneNumber" : "123456789",
"role" : 0,
"roleId" : [ 3 ],
"secretQuestionId" : 3,
"secretAnswer" : "shyam",
"dateLastUpdated" : "2014-10-06T18:19:35.656Z",
"lastUpdatedByUserId" : xxxxxx,
"existingsuperuser" : 0,
"contactnumbers" : [ {
"userId" : 191716,
"contactCode" : "D",
"contactName" : "Default Extension",
"contactNumber" : "329"
} ],
"updateMeWithAnnouncements" : 0,
"blockAccess" : 0,
"allowEndUserOutboundCallerId" : false,
"userId" : xxxxxx
Once the user is authenticated, a session is established and the session information will be returned in HDAP-ID and/or JSESSIONID cookies. The caller should return the cookies on subsequent requests to reuse the existing session.
Need Help in identifying HDAP-ID and/or JSESSIONID cookies and capturing the same for further use and in Deserialize of json content.