Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [services]

The Services module provides a standardized solution for integrating external applications with Drupal.

1
vote
1answer
12 views

Webservice args types automatic validation

It's a Drupal 7 with Webservices module, and there is a service with something like this (example): 'create-product' => array( 'operations' => array( 'create' => array( 'help' =&...
2
votes
0answers
15 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/...
0
votes
0answers
30 views

Upload a JSON from a third party application

I have a client hosted on Acquia, and they are requesting that we implement functionality to allow another companies 3rd party application to upload a JSON file to an upload directory within their ...
1
vote
1answer
44 views

Dependency Injection if service exists

Is there any way to use dependency injection in a conditional way, i.e. only if a service exists similar to \Drupal::hasService(). I have a created a service in module A and in module B I have an ...
0
votes
0answers
17 views

Problem updating user password through services

I'm having problems only with this specific action. Everything else (register, login, logout, update...) works fine and as expected using session_cookie and session_token. What's going on: 1. '...
-1
votes
1answer
18 views

Can I connect via REST services with a mobile app I will develop?

I'm thinking of developing an e-commerce with Drupal 8 and Drupal Commerce, but I need to know if I can connect via REST services with a mobile app that I would develop too. The app would need to be ...
0
votes
1answer
33 views

How can I get a user by email address using a service?

I have a custom service that I created to do some stuff with users. I want to be able to GET and DELETE users by email address because I may not know the uid. I have the service set up now. It works ...
-1
votes
2answers
55 views

Missing namespace in Config object name check_email_to [closed]

I am trying to understand why I am getting an error about the namespace using this code as the places I got the code from do not show defining a namespace file. $config = \Drupal::service('config....
1
vote
1answer
39 views

Redirect user on specified route

I know we can easily redirect a path to another path with Redirect module, but what I want to do is more complicated, my condition is when the user has a specified IP and the route is matched with to ...
0
votes
1answer
50 views

Services module, custom endpoint & authentication

I have a have setup a custom endpoint via services and a REST server the custom end point looks like this, https://website.local/api/v1/druaplsquare The custom endpoint is built using the following ...
0
votes
1answer
16 views

POST from external source

I have external site that needs to POST my drupal site (it basically shares data). I need to take the POST data parse it and create a node from it. Is this possible? I have created a PHP file ...
0
votes
1answer
52 views

Add a condition to show menu link in YML

how should I do if I need to show to a link menu based on a condition ? This is my YML for my menu link : double_vue_klesia.backuserswitch: title: 'Retour user précédent' menu_name: navigation-...
0
votes
0answers
30 views

Is there any possible way to know how hook_services_resources() is implemented?

I have received the source code and the database backup of a live application. When I tried to discover its services, I found out that many custom services are implemented through custom modules, ...
0
votes
0answers
13 views

Services View Only Returning A

I've tried to build a View with Services View on Drupal 7.56 PHP 7.2. Services 7.x-3.20 and Services_Views 7.x-1.3 But it outputs only: array ( 0 => stdClass::__set_state(array( '...
2
votes
0answers
27 views

how can I retrieve correct routes for rest resources?

I installed drupal 8 on my local server. I enabled all web services modules and installed rest ui module. I enabled some rest resources, such as entity/menu. Now, I need to know how to get correct ...
3
votes
2answers
330 views

Cannot update checkbox with services

I have been trying several configurations for trying to update a user account checkbox to uncheck it, with no success. I have been able to check it without issue. updateCharType = function (token) { ...
0
votes
1answer
22 views

delete or disable service endpoints programmatically?

I am trying to disable service endpoint programmatically but it is not working. $endpoint = services_endpoint_load('my_service'); $endpoint->disabled = TRUE; services_endpoint_save($endpoint); ...
0
votes
0answers
165 views

How to create a table in second database with hook_schema

I want to use two databases, that works following: How can I setup multiple database connections in Drupal 8? . I can set the connection in the settings.php file, access it by injecting a different ...
0
votes
0answers
19 views

How to login in two different drupal sites at the same time

I'm trying to log in to two different Drupal installations in the same domain. For example, I have site1 (Drupal 8) and site2 (Drupal 7). If I login to site1, user will be automatically logged in to ...
0
votes
0answers
35 views

GET list of all roles on Drupal 8 via REST

I work on a server SCIM and I need to list the roles existing in my Drupal site (for Drupal 8). In fact, I need to know the existing roles to create a user with a specific role on drupal but using a ...
0
votes
0answers
28 views

Is it possible to use taxonomy term's field as exposed filter in Services Views?

I would like create a REST endpoint which would allow a user to pass a query parameter that is incidentally a field of a taxonomy term. I am trying to achieve this by using Services Views in Drupal 7. ...
0
votes
0answers
13 views

Remove User Account Picture on Account Cancel

Am cancelling out user account(Delete the account and make its content belong to the Anonymous user) using services module. Hence followed this query and updated in the user_resource.inc function ...
1
vote
1answer
26 views

User registration through service

I have a local Drupal instance with services. I created an endpoint that has user resource included. I verified that all is well by logging in using the endpoint. I am now stuck at registering new ...
0
votes
1answer
211 views

Retain content while deleting user using services

I need to delete a user account using services module & does it fine. I can see that content(forum) created/updated by the user gets deleted. Is it possible to achieve below screenshot option ...
0
votes
1answer
19 views

How to programmatically submit a form that has a file-field using drupal_form_submit()?

I'm working to allow the submission of an existing form via REST using the Services module and drupal_form_submit(). Though this is reasonably routine, the form in question takes a file-upload which ...
1
vote
0answers
245 views

Difference between service and plugin?

After have read some link i'm still confused about the difference between service and plugin. I am not speaking about plugin like block or Field formater etc... i would like to take an example : I ...
0
votes
1answer
306 views

How to Logout user with Basic auth?

I can log in, perfectly fine, but can't get logout to give me a JSON response. Currently, I can only do POST to d8.com/user/logout?csrf_token=123&?_format=json and that would log out, even ...
0
votes
1answer
107 views

Drupal7 REST Basic Authentication not working (Postman)

I configured my rest with services and installed the Basic authentication module. I used Postman and selected basic authentication gave username and password, I got "Missing required argument ...
0
votes
1answer
38 views

Field value not updating when posting data via JSON

Here I am getting 200 response but the date field over here is not getting updated. The node is getting created and other fields are getting updated, only this date field is not getting created. the ...
0
votes
1answer
200 views

Creating a simple Drupal 8 custom service - argument should be an instance of a class, recognised as an array

I'm kind of new to Drupal 8 development and object-oriented PHP in general. I've been trying to make a simple custom block module, which includes a service with simple dependency injection. However, I ...
0
votes
0answers
55 views

How to use Web Service Client(WSClient)

I have a Rest service I must consume. I am using the Web Services Client for the Feeds module (wsclient_feeds). I have a problem to understand how the Web Service Client (WSClient) module works. I do ...
0
votes
0answers
35 views

Issue creating two REST services in Drupal 7

I'm looking to develop an iteration on my RESTful API (with OAuth) through the services module in Drupal 7. I currently have the endpoint rest/v1 working, but I need to create the next version rest/...
1
vote
2answers
135 views

Access denied for user anonymous for node retrieve service

I have installed services module and added a service. And then, enabled the retrieve and index resources for node. I also enabled the permission to view the published content for anonymous users. ...
0
votes
0answers
96 views

Oauth_server authenticates but subsequent requests return “True” with 403 Unauthorized status

I have successfully setup Oauth2 in Drupal 7 and I am able to get token from the Oauth2/token endpoint. I need to implement, Implicit Flow (Client-Side Flow) as this endpoint will be used by client-...
-1
votes
1answer
28 views

Services PATCH multiple target_id values for entity (node)

I'm trying to pass multiple nids to my node to match this structure: [field_sac_testts] => Array ( [x-default] => Array ( ...
0
votes
0answers
23 views

Errors when posting to a custom line item field

Adding to cart using Commerce Services produces errors when posting values to a custom line item integer field field_length { "order_id": "67", "type": "product", "commerce_product": "...
0
votes
1answer
65 views

How do I parse application/vnd.surveymonkey.response.v1+json?

I recently asked a question about setting up SurveyMonkey webhooks here: https://drupal.stackexchange.com/questions/252571/surveymonkey-v3-webhook-callback After laborious troubleshooting, I've ...
1
vote
1answer
263 views

How do I use a “contains” operation as restful contextual filter for text fields

I'm trying to create a restful view which takes a string as input, search specific content-type titles for similar nodes and return them as result. The problem is I can't figure out how to configure ...
0
votes
3answers
48 views

How do I create a view that uses data from an external site

I have a site that needs to get articles data from a view in site A in order to display these articles as a view in site B. I found the module Services Views, which i don't completely understand. I ...
0
votes
0answers
25 views

field_image path url in services

I am using services module in D8 to retrieve node data via JSON. The returned JSON does not have field_image url or path. I want to use this URL to display images in my app. Is there any settings / ...
0
votes
2answers
76 views

Register user with empty password

I create a cordova app, and trying to register new user from my app using drupa 7, drupal 7 service 3 and angularjs 1. I send post request with below data and user created successfully. $http({ ...
0
votes
1answer
2k views

Request header field X-CSRF-Token is not allowed by Access-Control-Allow-Headers in preflight response for Drupal 7 REST API

I have few APIs created in Drupal 7 which uses session authentication. Now when I get the CSRF token and try to use it in my API call, I get following error: Request header field X-CSRF-Token is not ...
0
votes
1answer
101 views

Using Drupal to authenticate user on a remote web site [closed]

I have a custom php web site on which I need to authenticate users based on their credentials in a Drupal site. I am not very experienced with Drupal but am (mostly) finding my way. It is a Drupal 7 ...
1
vote
1answer
68 views

Trying to save an image field on a user using services, but for some reason it isn't saving in base64

So my server (running Drupal 7) is getting this information: [field_picture] => Array ( [und] => Array ( [0] => Array ( ...
0
votes
1answer
68 views

Entity reference autocomplete field node

I am using Services module to create nodes via an api and am having problems using entity reference autocomplete to populate the field. The ER field is linked to a taxonomy and uses a multi field ...
1
vote
1answer
24 views

Getting other fields during a Drupal Services GET

I made the following request via GET: api/node?fields=nid,title,field_media But I'm getting the errror: Invalid query provided, double check that the fields and parameters you defined are correct and ...
0
votes
0answers
110 views

Creating a node that contains paragraphs / field collection / entity reference fields

The Services module is good for creating nodes via a REST API, but how can you create nodes that contains reference fields like paragraphs, field collections, or entity reference fields? I couldn't ...
0
votes
1answer
250 views

Doing a post to create a node using Drupal services endpoint with Postman app

I got my endpoint setup and I'm able to to do a get request to return a bunch of nodes. But I'm having issues doing a POST to create a new node. I see that I would first need to do a user login post ...
2
votes
3answers
239 views

How to securely authenticate content embeded in another site?

I need to embed password protected content to a second domain with an iframe. The content itself is a view which will be displayed on a third party site via an iframe and the content is prepared with ...
0
votes
0answers
33 views

How to ADD a role to a user by Services

I am trying to update a user by Services module. Currently a user has UID=2 and a role ROLE1. I am trying to add ROLE2 to this user also, so that this user will have two roles: ROLE1 and ROLE2. When ...