REST is an architectural style to exchange information on a site using Create, Read, Update or Delete operations. Use this tag for questions about exposing a website's resources (e.g. entities such as nodes, users, etc.) as web services in Drupal, compliant to the REST principles.

learn more… | top users | synonyms

0
votes
0answers
23 views

DELETE method from Drupal8 with Angular 2

I am making Drupal8 site with Angular 2, so I want to do is to delete Content-type Node thru angular. My function in the angular service is deleteCustomer(customer){ console.log(customer); ...
0
votes
0answers
19 views

Updating non-required fields via Services/JSON

I am using Services 7.3 and REST server to add new authenticated users via POST. All is working well except for the "customer" user field (boolean) that isn't required (and is actually hidden on the ...
0
votes
0answers
27 views

How to enable HTTP / HTTPS REST communication?

Is there a way to enable HTTPS communication in Drupal 8, for example, for GETing nodes? In Drupal 7 there was some way to enable SSL but I cannot make it work in Drupal 8.
0
votes
1answer
34 views

Retrieve all fields of an entity with all details (label, type, constraints, allowed values) using services api

Problem : I've an entity-type say a Content-type with n number of fields. I want to have a mobile application using which I want to create a node of that content-type using the services module. I can ...
1
vote
1answer
28 views

Chunked Ajax Responses

Does Drupal support chunked AJAX responses in either direction? I have not been able to find materials on this so far and am curious: Is Drupal AJAX capable of working with chunked AJAX responses (...
1
vote
1answer
21 views

Make PDF,XLSX,DOCX,PPTX output for drupal REST server

When I tried to configure drupal service admin/structure/services/list/MyServiceName/server, I only see the following response content types. Is it possible to provide pdf, docx, pptx, xlsx etc. as ...
1
vote
1answer
32 views

How to obtain paging results from REST view

I am using Drupal 8 rest views extensively. I would like to be able to know how many page results there are available, as well as what is the current paged result. Does anyone have and knowledge or ...
0
votes
1answer
72 views

Drupal::request()->request->all() returns an empty array

I have a custom controller that expects POST data. I had it working fine in 8.1.0 retrieving the data using \Drupal::request()->request->all() and \Drupal::request()->request->get($myvar). ...
0
votes
1answer
53 views

Pass video file to REST Drupal 7

I create a REST server with Drupal 7, set everything and it work correctly, node created well, but I want to fill File field with REST my client side code is (function($){ function getCsrfToken(...
1
vote
0answers
44 views

How can we pass images to the REST service?

We have a content type with 3 field, title, body and image field, client side in cross platform mobile application (e.g. Angular or jQuery). We want the mobile users to be able to create a node with ...
0
votes
1answer
25 views

Using Guzzle with SELinux setenforce 1 [closed]

is there anyway to run drupal 8 with guzzle to access remote server rest server without turning off selinux. for example in httpd, i can do: setsebool -P httpd_can_sendmail on to be able to ...
2
votes
1answer
47 views

how do I call a rest server?

I have a Drupal 8 site with a form that I have to submit to another server using the REST protocol. I have the following information. server address server port form data I want to submit that ...
3
votes
2answers
44 views

Parse REST Json replay

I create a views with REST export display, result are serialized with Json, In my formBuild method I want to parse JSON and Convert it to array and use it in select option $host = \Drupal::...
1
vote
0answers
24 views

Service Oriented (headless) approach

We've been managing a Drupal 6 based content rich site for almost 8 years now. Now, client is planning to move from Drupal 6 and seek out different possibilities. What they want is a service oriented ...
0
votes
0answers
11 views

Rest OPTIONS route

I have a custom route defined which needs to respond differently to different types of request methods. It works with GET, POST, PUT and DELETE, however for some reason an OPTIONS call never reaches ...
0
votes
0answers
13 views

How to post summary and body using REST

I am using Drupal rest api in D8, to post articles. However, I would like to be able to post both the summary and body. Specifically, I am interested in learning how I can post body content, for the ...
0
votes
0answers
26 views

How to create entities on another site using the Web Services Client module

I have installed the Web Services Client module, together with the Drupal Services module and Rules, in order to create, edit and delete entities on a remote Drupal site. The remote Drupal site has a ...
2
votes
2answers
131 views

How do I create and synchronize product fields with entity fields on another site

Case description: I have one centralized 'Asset management' Drupal website "A" (something like a simple ERP site) which manages the administration of purchased Assets, being ECK entities. The assets ...
3
votes
1answer
41 views

Rest full web service API url is changed in d8

I have rest service url for a node in d6 as https://192.168.1.236/rest_endpoint/node/1140.json but the same url in drupal 8 is not working at all , for d8 i have to give https://192.168.1.236/...
1
vote
1answer
86 views

PUT method using drupal_http_request

I need to update data in HP Quality Center with Drupal. After login with success, I get some data from QC with the following code (simplified): $headers = array('Cookie' => $cookie); $request = ...
0
votes
1answer
17 views

Quiz evaluation via rest service

I have created a web service which expose the quiz node and their properties. If user take the quiz I want to evaluate that quiz via rest service api. How can I do this? Is there any existing module ...
0
votes
1answer
51 views

Consume nodes from REST export views

I am trying to import nodes from a different domain's REST export view. I am able to get all serialized nodes from the view through Guzzle but once I try to create a node from the hal+json response I ...
0
votes
1answer
45 views

How to expose paging data in REST export views

How to allow views to export paging data along with entities? I can set pager, and it works of course, for example my_view?page=1 displays something like [ {...}, {...} ] but I only get list ...
0
votes
0answers
55 views

How do I deliver a nested JSON array for content reference with export view display?

I created a product content type with content reference to article(one product to many articles). Then I added field "Content: ID" "Content: Title" and "(field_article: Content) Content: Title" to a ...
1
vote
0answers
16 views

How do I store data in entities text-list and field-collections?

I have retrieved data from an external database using REST. Now that it is cached in my Drupal 7 site in tables, I need to create new nodes of a specific content type. Works fine for most fields (e.g.,...
1
vote
1answer
41 views

Services for Privatemsg module

I am using privatemsg services module to create REST API of privatemsg using Services Module in Drupal 7. If I send GET request to this url : http://example.com/rest/privatemsg/ I get all messages ...
0
votes
0answers
17 views

jDrupal - login problem

Does jDrupal fully work with Cordova? I can get nodes, but login doesn't work. jDrupal.connect().then(function() { jDrupal.userLogin('TestUser', '123456').then(function() { var user = ...
1
vote
1answer
30 views

REST interface to custom entity type getting constant 403's

I created my module and the entity definition using the drupal console. It has not been modified at all. My entity is for a user but for various reasons I won't be using the pre existing user entity. ...
0
votes
1answer
22 views

Post method not working on non-CRUD methods

I'm just trying to create custom rest service action but I can't get it. I have created end_point called "testing". Whenever I try to post the data it shows access denied for authenticated user. Where ...
0
votes
0answers
26 views

403 error on creating node using REST

I am trying to create an article node using REST API, but i keep getting 403 error. I have given necessary permission. I am trying it with admin login, curl --include --request POST --user admin:...
0
votes
0answers
55 views

Upload an Image File using REST API in drupal 8 (Using multipart/form-data)

I want to send an image file using REST API in Drupal 8 along with a registration form. I have built a custom API to save the registration form. For the files i have created another API to save data ...
1
vote
1answer
20 views

Comments are Posted anonymously

I am using Services Module in Drupal 7. When I try to POST comments, these comments are Posted anonymously. I am sending POST request to ?q=endpoint/comment.json with this Body { "nid":"401","...
1
vote
1answer
39 views

Can't save location when posting node through services module

I am using services module to post nodes using rest/json. The nodes also contain images and location. So far I can upload the image and save the node, but the location is not saved. I receive no ...
2
votes
1answer
113 views

How to login into Drupal 8 using the REST API? [duplicate]

Ok i've spent my whole afternoon trying to get this running: Setup a freshly installed Drupal 8 Activate the WebServices (HAL, HTTP Basic Auth, Restful Webservices, Serialization) Install REST UI ...
0
votes
0answers
16 views

Statistics of REST calls

I have client app and i call content by REST GET. I want to have statistics of this calls. For now every time i make get a also make a post with incremented value 'counter'. But thats not good way. It ...
0
votes
1answer
42 views

DateTime iso format in api

I have created an api that filter out unixtime format. Currently, we can filter using /api/blogs?filter[created][value]=1426766400&filter[created][operator]=">="&api_key=DEMO_KEY That ...
0
votes
0answers
18 views

make http request with drupal entityforms

Im complete new with making http request. I have for my users on my Drupal site the possibilty to calculate their own cost. This is done in a entityform. The outcome from the calculation is coming ...
1
vote
0answers
32 views

Custom services returns null

I have extended services module and created a custom web service to get and post data. The problem is on the first rest call I get proper response but on the next response I receive "null" where as in ...
3
votes
0answers
49 views

How do I edit the output of a field?

I am creating REST API using Services Module in Drupal 7. I have created a View to Get lists of Groups. In this view I have added a Field privacy which will tell if the group is Private or Public. ...
0
votes
0answers
19 views

How to call webservices from php on drupal 7 [duplicate]

I want to call a php webservices(REST) on my Drupal site. How to do that. And how to display the result in a page/block. Never have worked before with REST and have idea how i can fulfil the process ...
1
vote
0answers
15 views

Restful API: Change date format from unixtime to ISO-8601 [duplicate]

Applying the date_iso8601 Drupal function in a simple process_callbacks on the public_fields in the class file for each date field works to convert the output/display of the date format, but does not ...
1
vote
0answers
11 views

View contextual filter - rest

How to use contextual filter in view by rest calls? I cant get it to work whole day. I made View with "Provide a REST export". I added contextual filter. But it doesnt work. Thanks
0
votes
0answers
16 views

REST view not accepting path URL

The REST view sometimes does not recognize the path I've assigned to it. It works most of the time, but when it does not work, I have no idea what's wrong as I follow exactly the same steps. I ...
0
votes
0answers
18 views

How can I collect webform data from 500 Drupal sites as entities in a centrally managed Drupal site?

The scenario is as follows: I have 500 products, each has its own webpage and domain on an Aegir (BOA) server. I want to collect data that customers submit. To start with a simple example: the ...
-1
votes
1answer
28 views

Using a rest plugin or a service how can one tell the token module the response is not cachable

I have a rest plugin which returns an array and sends a mail. When commenting the Token::replace all works fine, the token replace function creates a BubbleableMetadata object (from what I understand ...
1
vote
0answers
13 views

Access statistic from rest calls [closed]

I am able to get content of articles with rest calls. I want to make module, with statistics, what article was read the most. (read = by rest calls...not by views on page). Thanks.
1
vote
0answers
18 views

Displaying Sub-content Types for RESTful Views in Drupal 8

I have two entities (Content types in Drupal 8), foo and bar, for which I've added basic RESTful views, /foo and /bar. These work fine. I've also added bar as field in the foo Content type (a foo may ...
0
votes
0answers
14 views

Services node retrieve -> Access restriction

I am currently working on a project where i am exposing some nodes from a specific content type via services. For the scope of the project I only allow retrieving of nodes from that specific content ...
1
vote
1answer
88 views

Creating node via REST POST gives “leaked cache metadata” error

I'm trying to create new nodes by POSTing to /entity/node?_format=json. This is the body I'm sending: { "_links": { "type": { "href": "http:\/\/my.drupal.be\/rest\/type\/node\/...
2
votes
1answer
63 views

Can't log in user with Rest service [duplicate]

i'm trying to build a Headless Drupal app with symfony, i'm stuck with login, i build a custom module for drupal 8 with four functions, (login,logout,register,login_status): <?php /** * @file * ...