Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
16 views

Order relationship in RESTful

I'm using https://www.drupal.org/project/restful module. I can sort base entity using annotation: /** * Class Things__1_0 * @package Drupal\restful_thing\Plugin\resource\node\thing * * @Resource( ...
0
votes
0answers
27 views

How to do poll by POST request?

I have installed poll module. i want to do polling via POST request for that i hit the url http://localhost/poll/entity/poll_choice with the following body in postman { "_links": { ...
-2
votes
1answer
29 views

How to filter Data on the basis of id or uuid by Rest API?

I am using Drupal 8 I have installed the poll module. I created a view with REST export enabled. Now when I get the data by this url http://localhost/poll/rest/polling I am getting all the data of ...
0
votes
0answers
27 views

How to fetch field value via REST

I am using Drupal 8. I have installed the Rest module. I need to do polling so I also installed the Poll module. I created two questions with choices in poll and after that I created a view to show ...
0
votes
0answers
77 views

How to upload a base64 encoded image using API

I am trying to submit enquiry form using api. I am able to post data through api by using the endpoint Endpoint: url/contact_message?_format=json Body: { "contact_form":[{"target_id":"...
0
votes
0answers
42 views

How to set the host entity for a field collection item

I'm trying to create the field collection item using Services field collection module and attach new field collection item to the current user. function _services_fc_create($field_collection) { $...
3
votes
1answer
36 views

Pass parameters for node access on RESTful call

I'm trying to figure out how to pass a filter parameter on a Services rest call. I've got a node of a specific type that I'd like to access through the Services module and rest. I'm testing with ...
0
votes
0answers
14 views

Content moderation module that integrates well with Services (rest)

I am looking for a content moderation/workflow solution that will integrate with the Services module. I would like to update and transition the workflow state of a node using an api. Currently, I am ...
1
vote
1answer
15 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
17 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
37 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
95 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 ...
-1
votes
1answer
19 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
vote
1answer
47 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
57 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
17 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
56 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
14 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
33 views

delete or disable service endpoints programmatically?

I am trying to programmatically disable a service endpoint, but I am not able to achieve it using the following code. $endpoint = services_endpoint_load('my_service'); $endpoint->disabled = TRUE; ...
0
votes
0answers
210 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
48 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
29 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
15 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
27 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
212 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
331 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
415 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
165 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
47 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
281 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
69 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
36 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
160 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
104 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
37 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
73 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
316 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
49 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
2answers
91 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
120 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
78 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
95 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 ...