Geeth
Posts: 0
Joined: Thu Jun 28, 2012 9:59 am

Using Restful WS to Login

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

Geeth
Posts: 0
Joined: Thu Jun 28, 2012 9:59 am

Using Restful WS to Login

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

Thanks

Geeth
Posts: 0
Joined: Thu Jun 28, 2012 9:59 am

Using Restful WS to Login

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Using Restful WS to Login

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.

Return to “Issues”