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
9 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 ...
0
votes
0answers
17 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
17 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 { ...
0
votes
1answer
22 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
35 views

How to login into Drupal 8 using the REST API?

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
14 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
27 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
9 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 ...
0
votes
0answers
20 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 ...
2
votes
0answers
29 views

How to edit output of a field in Views

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
18 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 ...
0
votes
0answers
14 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 ...
0
votes
0answers
8 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
12 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
16 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
23 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 ...
0
votes
0answers
10 views

Access statistic from rest calls

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.
0
votes
0answers
10 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
13 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
41 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": ...
2
votes
1answer
37 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 * ...
0
votes
0answers
18 views

POST regular JSON to custom RestResource

So I created my own RestResource, like so: /** * Provides a resource to get/create content data. * * @RestResource( * id = "mycontent_content", * label = @Translation("My content"), * ...
1
vote
1answer
22 views

How to get in Views RESTful API non latin's letters on fields?

With this guide, I do my RESTful API view (through core modules: RESTful Web Services and Serialization). Ater go to API page, I get this JSON: [{"title":"\u0411\u044b\u0441\u0442\u0440\u044b\u0439 ...
0
votes
1answer
21 views

Content REST view does not work because of moderation states

I've created a simple view using the REST export to export all published content in JSON format, but I get this error: Symfony\Component\Routing\Exception\RouteNotFoundException: Route ...
0
votes
0answers
12 views

How to use og_is_member() to create REST API?

I have created a View for Services. Everything is working but I am not sure How to check if user is a member or not? Do I need to use og_is_member() or there is any other way to check ?
0
votes
1answer
11 views

JSON through Services View- Authenticating through Parameters when accessing JSON through external app

My Drupal site is generating JSON through Views. I am using Services for that. It is something like this:- http://www.asite.com/api/views/all-date.json Now the problem is that I want to restrict ...
0
votes
1answer
33 views

Making all REST Server calls to Drupal site as an authenticated user through Services

I am making REST Service calls to my Drupal 7 site to either retrieve or create content. Is there a way I can make all these calls through one specific authenticated user? Thanks.
0
votes
1answer
31 views

Headless Drupal for managing multilanguage resources for Web/Android/IOS apps? [closed]

A company has content in 10 languages and 3 channels (web, ios, android). It creates a lot of overhead related to translation (external translation company has to be managed, translations sent etc.). ...
0
votes
1answer
13 views

Add a new role using the Drupal Services Rest api

I'm trying to create a new role using the drupal services module. I am able to update a user with an already created role but can't find a way to add a new role. I'd rather not build a custom service ...
0
votes
0answers
14 views

How to edit/delete a node through Rest endpoint using Oauth authentication?

Here is what I have tried so far, using Oauth I am able to - Retrieve an existing node; endpoint - rest/example/node/40.json, GET Create a new node; endpoint - rest/example/node, $node_data, POST ...
0
votes
0answers
16 views

Rest Export: Get rid of no result fields

I have a rest export that exports various content types. However I am running into the problem of the export giving me empty no result attributes. Here is an example. { "title": "Acme Porter ...
0
votes
1answer
80 views

Drupal 8 RESTful POST 400 Bad Request

I'm trying to use the RESTful service for creating a node with Javascript using the script below, but I only receive a 400 (Bad Request) error. I have enabled all the formats and set permissions for ...
0
votes
0answers
55 views

Wrap 'full html' output with CDATA in Service view in drupal 7?

I'm using Services and Services Views modules. I have created service display view which includes body field(full html type). In the output url view source body is rendering with &lt;p&gt; ...
1
vote
0answers
12 views

Determining permissions issues for REST APIs

Is there a way to determine what permission/s has caused an REST end point in Drupal 8 to throw a 403? This would really help when trying to debug my API.
1
vote
0answers
17 views

Common data in different API end-points

I have integrated mapbox (www.mapbox.com) into a Drupal site. The points being rendered comes from nodes with spatial data (lat and long). The nodes with spatial data are 'classified' using a couple ...
1
vote
1answer
29 views

Set body format for a node when it is updated via REST API

I noticed that when I PATCH a node and update the body value, the body format and summary are set to null. If I try to add the summary and format to the json sent to the API, I receive an error ...
5
votes
1answer
59 views

Views REST Export and Multi-Value Fields

I'm having trouble getting the Views REST export to work nicely with multi-value fields. I have an image field that can have multiple images. I have added the field to my REST export View, however all ...
1
vote
1answer
47 views

How can I get multiple values in a RESTful endpoint from a field who points to other resource? [closed]

I have a Drupal 7.x site with RESTful installed (version 2.5) and I want have one endpoint which shows a node view, and add a field which show a index of nodes ,extracted from another endpoint, which ...
6
votes
6answers
242 views

How can I protect development sites with Basic Auth module enabled?

During development phase a dev site should be protected from being browsable by unauthorized visitors. Usually I use Basic Auth configured in the web server. This way the only information an ...
0
votes
2answers
30 views

How can I let images uploaded via ckeditor show their full url in a json request via REST?

I have textarea fields in my headless drupal 8 site. When I get the node via REST in json it does not give the domain name in the image urls that are uploaded via ckeditor. So the images are not shown ...
1
vote
1answer
85 views

Drupal 8 node serialization to JSON

I am trying to use \Drupal\node\Entity\Node::load($nid) to store a node object in a variable and pass the variable into drupal 8's serialization component or even symphony's serialization methods. All ...
3
votes
1answer
31 views

Using Services, why is the resource name appended to the endpoint? [closed]

If I want an operation of GET api/v1.0/users and api/v1.0/pages: Using the Services module to create a REST API, if I define a service with an endpoint of api/v1.0/users and enable the user resource ...
0
votes
1answer
43 views

Getting a menu delivered via REST

I am trying to get a menu via REST and I've created a new module and rest resource plugin that allows for GET on /entity/restmenu/{menu_name}. I can successfully return this example json using this ...
2
votes
2answers
204 views

Drupal 8 REST - How to export Drupal 8 Main navigation menu with REST service (JSON)

I have tried to GET main menu with rest path "/entity/menu/{menu}" but all I get in response JSON is a menu properties as uuid,language,id... without menu structure (links...). { "uuid": ...
0
votes
0answers
22 views

Drupal, Services and authentication

I can't authenticate with Drupal 7 and Services module. From REST client I send POST {"username":"username, "password":"password"} to user login endpoint. I get sessid, session_name, token and user ...
2
votes
2answers
147 views

Uploading image to a node via Angular to Drupal 8 using REST

I have figured out how to upload files from Angular to Drupal 8 ...... submitCommunity: function(params) { var package = { "_links":{"type":{"href":"http://dang.dev:8888/rest/type/file/file"}}, ...
1
vote
2answers
144 views

Creating REST service to get complex node type

I'd like some advice as I don't know if I'm doing this the correct way... I'd like to create a web service to get a specific node type. I don't need create/update/delete functionality, just being ...
0
votes
1answer
83 views

How can I provide anonymous user to access my REST GET API without providing any auth information?

The Drupal 8 REST UI configuration page asks me to select Authentication providers for GET method; otherwise, it doesn't allow me to export the REST request. How can I provide anonymous user to ...
1
vote
1answer
57 views

Importing external resources via REST as nodes or other entities

I'm just getting my feet wet with Drupal 8, having written a decent amount of modules for various projects for Drupal 6 and 7. We are trying to leverage Drupal as a CMS add-on to our club management ...
2
votes
2answers
296 views

403 Forbidden when creating a page with RESTful API

Referencing this tutorial, I am trying to create a page with RESTful API: { "_links":{ "type":{ "href":"http://www.example.com/drupal/rest/type/node/page" } }, "title":[ { ...