Page 1 of 1

Using Restful WS to Login

Posted: Thu Jun 28, 2012 10:05 am
by Geeth

I set up a restful web service to authenticate user once email and password is entered.
Following details I receive as the result.

{
"screenName": "..........",
"STATUS": "OK",
"securityKey": "............................",
"casid": "......................"
}

I need to navigate a another page if STATUS is OK and if not alert him about user name/password might be incorrect..

How do I do it in tiggzi?
what steps I should follow.
Please let me know

Thanks


Using Restful WS to Login

Posted: Thu Jun 28, 2012 10:07 am
by Geeth

Above is a json object I am talking about. And also I need to map securityKey and casid to localStorage.

Thanks


Using Restful WS to Login

Posted: Thu Jun 28, 2012 3:19 pm
by maxkatz

Using Restful WS to Login

Posted: Fri Jun 29, 2012 4:32 am
by Geeth

Can you please give me a full example with following parameters.

let' say service name is restServiceLogin

Then I restServiceLogin.execute({});

Then How do I get the return data as a object.

I tried the following and many other ways.

var jqxhr = restservice1.execute({});
jqxhr.complete(function() { alert("second complete"); });

Please let me know how do you access data in jqxhr object too?

Thanks


Using Restful WS to Login

Posted: Fri Jun 29, 2012 3:08 pm
by maxkatz

You add a service instance to a page like any other service.
Select the service instance, and go to Events view.
Add Event, add the event you want to use.
Add Action, use Run Custom JavaScript. You can write any JavaScript here.

jqXHR is a hash so you would access its data like any other JavaScript hash. You can use jqXHR.something. A simple way to see everything in the hash is to do this:

code
console.log(jqXHR)
/code

Just keep in mind that you get different objects into your function based on which event you use: http://help.gotiggr.com/documentation....

Check the Facebook tutorial: http://help.gotiggr.com/documentation.... It shows how to access jqXHR object.