I successfully connected and gotten data from the system.connect and node.get. Currently I'm not using any authentication while I figure out the basics of this module. Using the json server.

But no matter what I do, whenever I try to use views.get, I always get "Missing Required Arguments".

Now this is a simple view that just displays a list of node titles. No arguments required. It works fine in the Services browser when I try it. Anonymous user have access to it, etc.

My ajax call, which is working for other methods:

		$.ajax({
			url: service_url,
			dataType: "jsonp",
			data: {"method" : "views.get", "view_name" : "rest_a" },
			success: function(data){
				if (data["#error"] == false) {
				   console.log(data);
				   $("#progress").toggle();
				} else {
				   console.log(data);
				   alert( "Error: " + data["#data"] );
				   $("#progress").toggle();
				}
			}
		});

Any insight and help is appreciated!

Thanks!

Comments

jazzdrive3’s picture

So is this issue queue the right place to post this? Or is it the json server that is the issue?

If the views service won't work, I might as well not use this module at all and come up with something else to power my iphone app.

Thanks.

jazzdrive3’s picture

Ok, finally figured it out. Did a print_r before the services module called the error and found that it still thought the "view_name" argument was missing.

Tried the following and it suddenly started working!

$.ajax({
url: service_url,
dataType: "jsonp",
data: {"method" : "views.get", "view_name" : "\"rest_a\"" },
success: function(data){
if (data["#error"] == false) {
   console.log(data);
   $("#progress").toggle();
} else {
   console.log(data);
   alert( "Error: " + data["#data"] );
   $("#progress").toggle();
}
}
});

The views.get method, at least going through the json server, needs escaped quotes around the view_name argument.

marcingy’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.