1

I'm linking an android app with a drupal 6 server. Basically the app should be able to request information from the server to sync data and other simple functions. JSON is our preferred way of achieving this.

I've installed Service, JSON Server in drupal 6 and activated both node and view services. With views.get i'm able to get a JSON output of the default display from the view listed.

Question(s)

  1. First thing I'd like to achieve is to have the JSON output in a separate file. Completely. Currently the JSON is being shown below the views.get page. I've googled solutions for this but only found for drupal 7.

  2. I'd like the JSON to receive arguments from the android app using POST.

How can I achieve the two above.

Thank you very much.

1 Answer 1

0

Use Services Views

After enabling that resource you would be able to do call to

http://example.com/<endpoint path>/<resource name>

After enabling "views" resource in your services endpoint you can do GET request to:

http://example.com/<endpoint path>/views/<view name>

This will execute a view and pass results.

Possible arguments:
- display_id: views display
- args: array of view arguments
- filters: array of view filter values
- offset: views offset
- limit: limit views number of results
- format_output: boolean whether we would like to get themed view or data

Example of calls:

http://example.com/rest/views/articles?limit=5&offset=2&filters[tags]=5
http://example.com/rest/views/articles?filters[tags]=5&display_id=block_1&format_output=1
1
  • Thanks Nikhil, Unfortunately there isn't a drupal 6 module for Services Views. Got a link?
    – RogerInc
    Commented Mar 21, 2013 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.