Questions tagged [services]
The Services module provides a standardized solution for integrating external applications with Drupal.
681
questions
28
votes
2
answers
24k
views
How to create test_endpoint?
I am new to drupal and I am using services module for using REST and RESTWS module. I used RESTWS and could get the content of the node by http://base_url/node/1.xml and now I need to add a node ...
21
votes
1
answer
1k
views
Mass image upload with Storage API and Services API
I am trying to set up a site that will be storing a large amount of images (roughly 50,000 to start with). The strategy for this was to use Storage API and S3 storage to deal with the costs of hosting,...
16
votes
3
answers
16k
views
How do I POST a new node?
I have referred many links including the following:
Services module. How to construct the JSON data with session info for creating node?
GitHub
- Creating a node using Services 6.3 REST
I tried ...
16
votes
1
answer
7k
views
How do I use dependency injection on \Drupal::moduleHandler() to a Controller?
I am using the following line in a controller class.
\Drupal::moduleHandler()->alter('mymodule_myfunction', $plugin_items);
Pareview.sh is giving me this error message.
\Drupal calls ...
13
votes
6
answers
6k
views
How do I pass contextual filters to a view via services
I have a view that accepts a contextual filter in order to return the correct results. I'm using Services 3 and Drupal 7. I'm able to create an endpoint, and retrieve the view via services. But it ...
13
votes
1
answer
13k
views
Correct way to call a service in a controller
I'm new to services (and drupal 8!) and trying to figure out services. I think perhaps I'm just doing the create in an outdated way. What I want do is make my 'hello generator' a service and call it ...
11
votes
1
answer
2k
views
What is the difference between \Drupal::request()->getSession() and \Drupal::service('user.private_tempstore')?
As the title suggests, I'm a bit confused about those two methods of creating and accessing a session on Drupal 8. I'm not quite sure when to use the one over the other, could someone point me to the ...
11
votes
1
answer
5k
views
How to write a service module for Drupal 7 and Services 3.x?
Can somebody please give instructions on how to write a simple service module for Services 3.x and Drupal 7.x? I simply cannot find any that works with D7. Anything! Just a reworked version of ...
11
votes
3
answers
20k
views
How do I construct the JSON data with session info for creating node?
I am using Drupal 7 and the Services module 7.x-3.2. I am using Postman for Chrome (a http client) to test the API.
What I want to do is log in a user and create a node with the user using the ...
11
votes
4
answers
3k
views
How to access services_views the correct way?
I am trying to fetch some views with the services_views module. Sadly enough I keep getting the response: "404: Not found: Display on view my_view_name could not be found".
I am using Views 3 and I ...
10
votes
6
answers
10k
views
How to use Services Basic Authentication?
How to use Services Basic Authentication module?
I want to add http basic auth for my service. I have installed it and enabled it on my end point configuration. I got this "HTTP basic authentication ...
10
votes
2
answers
5k
views
How to create user with role(s) through REST service?
I could able to create a new user by the following JSON format.(Using POSTER add-on to post this data to REST service.)
{
"name":"user34",
"pass":"3323",
"mail":"sample@example.com",
"...
10
votes
5
answers
6k
views
Creating comments and nodes with Services 3.x and JSON
I'm having trouble getting services to recognize a POST to /comment.json.
I have a similar issue with creating nodes as well.
The following is the error I get:
HTTP/1.1 406 Not Acceptable: Missing ...
9
votes
2
answers
4k
views
How do I consume JSON data via a hook_menu callback?
I'm trying to set up Tropo's WebAPI with a Drupal site, and I thought I'd just create a hook_menu() callback for example.com/tropo, then use the hook_menu callback I just created to consume the API ...
9
votes
2
answers
5k
views
How do I configure the Services OAuth sub-module?
The Services module is about to release its new 3.0 version for both D6 & D7.
There's an OAuth sub-module to Services that adds a new OAuth UI within the Services configuration UI.
Does anyone ...
9
votes
2
answers
1k
views
register.json does not login the user or return the user's session/token/password
I have tried far too many variations to list here, but the basic point is I cannot get the user logged in immediately after registration via Services. I have tried a fresh Drupal 7.33 install with ...
8
votes
3
answers
2k
views
What is the most reliable and fault tolerant way to integrate 3rd-party data structures via a web service in Drupal 7?
I've seen a number of strategies for integrating remote data structures in Drupal. The strategies have seemed to evolve as certain modules have stabilized and use cases have been tried.
Imagine we ...
8
votes
4
answers
10k
views
How to save images using Services 3
I have found some very detailed tutorials about Services 3. I appreciate them very much here is a small list.
http://drupal.org/node/1354202
How to add multiple images to a node using node.save ...
8
votes
2
answers
4k
views
load balancing multiple horizontal drupal instances
I've developed a REST WebAPI using the Services module. It works fine. I have a client of that API with projected usage requiring I horizontally scale my Drupal instance. Note that due to the nature ...
8
votes
2
answers
8k
views
Using Drupal as client of a web service
I need to use Drupal as client for a web service, for extracting data and showing it in a view or as content. (The format use is JSON or REST.)
I use a Web Service Client module in Drupal 7, and the ...
8
votes
2
answers
7k
views
Authenticated REST requests becoming anonymous user
I'm new to the services and rest_server modules (and RESTful APIs altogether.) As I understand it though, the steps are basically this:
Send a post request to /api/user/login with the username and ...
8
votes
1
answer
1k
views
Drupal Services OAuth
I have been working on this issue for a couple weeks now, and I can't find a solution for the life of me. The fact that I have found no decent documentation (on Drupal's website, or anywhere else) is ...
8
votes
6
answers
4k
views
Why is this Drupal services RESTful API not working?
I'm using the Services module on Drupal 7. I want to implement a service that allows me to submit a search term via AJAX and receive an array containing the top 5 nodes (node id and title) that ...
7
votes
2
answers
3k
views
drupal HTTP POST data
How do i send HTTP POST/GET data to drupal?
for example:
I've got a html form:
<form action="mydrupalcite.com" method="get">
<input type="text" name="title" />
</form>
how do ...
7
votes
2
answers
3k
views
Getting terms for only one taxonomy from services module
I have the services module installed, and I have both taxonomy_term and taxonomy_vocabulary checked. However I'm having problems getting just the terms for one vocabulary. when I do curl -g "http://...
7
votes
2
answers
1k
views
Services 3 and Node Reference
I am working with the module services 3 (D7) and I am calling the Drupal method from a Java client. I can login (and keep the session in the cookie) and I can create a simple node.
But I can't set a ...
6
votes
4
answers
2k
views
How can I expose Drupal data to external applications?
How can I expose data from my Drupal site via web services to external applications such as iPhone or Android?
6
votes
2
answers
2k
views
How do I use the global class \Drupal static methods to access services?
Is there a difference between calling \Drupal::service('config.factory') and \Drupal::configFactory()?
Is it better to use the second one?
Can \Drupal be used to do something else than calling ...
6
votes
1
answer
1k
views
What is the proper format for the flag service calls?
I'm running Drupal 7 with the Services 3 and the Flag Service modules installed. I'm having trouble trying to figure out how to format the the call in REST format. Can someone provide a short example?...
6
votes
4
answers
12k
views
REST Services module - Access denied for user anonymous
I'm Using Drupal 7, I installed Services module with all the requirements, according to this question and this video.
I'm trying to get all users with Postman where I give my credential, but I'm ...
6
votes
1
answer
3k
views
New User Registration Sequence for Services 3.4?
This comment outlines a working way to login with the new CSRF token:
POST to /rest/user/login (nothing in headers). Construct the $cookie from session name + id
GET to /services/session/token (...
6
votes
4
answers
6k
views
How to use multiple values for an exposed filter via url
On my current setup I'm exposing a view that outputs json through a service.
The view can be called like this: http://domain.com/api/books.json.
I also exposed a filter to a referenced content type "...
5
votes
2
answers
4k
views
Drupal Services node filtering
Is there a way to filter the nodes that come from a SERVICES node Endpoint, by a field or status?
5
votes
2
answers
3k
views
Services module: What is 'Index' operation?
D7 / Services 3.2
retrieve / create / update / delete are very straightforward, make senses to me that matching 'CRUD', I don't understand what 'index' here does?
Thanks.
5
votes
3
answers
3k
views
How to retrieve all nodes for a taxonomy term using Services?
I want to retrieve all the nodes associated with a given taxonomy term (field_term) using HTTP GET.
I have tried:
curl -v http://myserver/endpoint_path/node?parameters[field_term]=1
but I get an ...
5
votes
1
answer
2k
views
Services module update date field
Hi i am using drupal services 3 module. Every thing is perfect except updating date field. I tried many ways to update that field but didn't get any solution. Is any core issue related to date field?
5
votes
1
answer
2k
views
How can I create a simple non-CRUD resource action with Drupal 7 / Services 3?
The resource "username" appears but my action does not appear in the list in services admin. Response to a POST is HTTP/1.1 404 Not found: Could not find resource username.
I replaced my module name ...
5
votes
3
answers
12k
views
Login with a REST service (services module)
I work with Drupal 7 (services 3.x) to implement a REST service. When I test a login request with this script:
$service_url = 'https://dev.mysite.org/api/blog/user/login.xml'; // .xml asks for xml ...
5
votes
1
answer
2k
views
How can I PUT a new file to a node using services 3 without overwriting the existing file?
Using Services 3 I have it working fine to add a file using
endpoint/file
{"uid":"1","filesize":"99999","filename":"whatever.bin","file":"BASE64_ENCODED_DATA"}
and also to add a node with that file ...
5
votes
1
answer
1k
views
what does the 'debug mode' on Services actually do?
Each Services endpoint has an option for 'debug mode'.
What does this actually do?
5
votes
3
answers
2k
views
What modules do I need to implement web services?
We have planned to create a bank loan application in Drupal. The Application does not have any own users records, but it completely depends on external service provider.
For example, when we log in ...
5
votes
3
answers
2k
views
Get all fields for a content type using REST
Is there any way to get all fields attached to an entity in D8 (including widget types), using REST services? I've tried the following endpoints, but none of them had the list of fields:
/entity/...
5
votes
1
answer
1k
views
How do I send and receive privatemsg?
I'm using Services with Drupal 7 and I built a rest service with it, I also included the Privatemsg module and the Entity API module.
I can see under the my service a resource called ...
5
votes
4
answers
2k
views
Services 3: Setting taxonomy terms on node creation/update
For a custom node type, I have defined a field that is to hold an unlimited number of values from a taxonomy vocabulary that I defined.
This is what it looks like:
[field_taxonomy] => Array
( [...
5
votes
1
answer
104
views
Module Uninstall Validators and Lazy Services
I have recently been working on creating functionality for a module that requires certain content related to the module be deleted before the module itself can be uninstalled.
https://www.drupal.org/...
5
votes
1
answer
613
views
Using multisite for a ReSTful API and Auth Strategy
My Situation
I have a small app with a public interface. I'm interested in making an API for this to be used in a mobile environment and even eventually as a public API. I want to keep it simple with ...
4
votes
3
answers
7k
views
Services 3 and session authentication
I am creating a titanium mobile app that consumes and uses Drupal Services. I'm able to create a node but the user is always anonymous. I've tried setting the request headers so that the ...
4
votes
2
answers
10k
views
How to create a custom resource with Services-3.x
Drupal 7.9
I have installed Services 3.x module and can successfully access nodes etc using the rest server e.g. http://api.domain.com/api/rest/node/6.xml. I now wish to create a custom resource and ...
4
votes
3
answers
8k
views
Register User with Services (JSON) with Custom Fields
I am trying to register a new user on Drupal7 via services with JSON. Actually I am posting info from JAVA (android) with JSON format to the server with services module enabled. A sample successful ...
4
votes
2
answers
1k
views
How to access the raw content of a views field, for use with Services Views
I have a user that I want to expose to services. Using Services Views. I'm using fields as the format, and adding the "photo" field to my display. My issue is that when I view the service (as JSON). I ...