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
3 views

Drupal 8 - import node type and its fields with REST

Using the Drupal's Views, i can export nodes to a REST view and make a POST request to create new nodes, its easy and well documented in the net. I am trying though,to enable in client-side a ...
0
votes
0answers
15 views

Web service Drupal 8 using Guzzle

I'am working in web services in Drupal 8 using Guzzle. I found the information how to GET and POST the node but the PATCH( update the node) and the DELETE , i did not find it. The configuration in ...
0
votes
0answers
6 views

Populate target_id in REST result

I'm using Drupal 8 like an API, headless Drupal, and when creating a content type that has a reference to another "Content type", the resulting JSON has a "target_id" filed but with no data populated ...
0
votes
0answers
8 views

WSClient - Insert XML into a text parameter without it being html escaped

I'm using WSClient module to consume external APIs. One API I need to read requires a complex XML structure sent through REST. The complexity of the XML resides in the fact that each node needs ...
0
votes
1answer
27 views

Can someone explain the @RestResource annotation for building a Rest resource?

I am trying to create a RESTful web service. Above the class there is a comment/annotation /** * Represents entities as resources. * * @RestResource( * id = "entity", * label = ...
0
votes
1answer
40 views

Drupal 8 REST - POST json data denormalization error

I created rest resource plugin in a custom module and need to send some JSON data with the request, and access it in the post function. At the moment my post function does not do anything but return ...
0
votes
1answer
11 views

Web Services - GET Request Article (HAL+JSON)

I'm trying to make a GET request to a specific article on my drupal 8 website (local). These are the steps I've done: Enabled all 4 Web Services modules at the modules page Created an article (url: ...
0
votes
1answer
43 views

Drupal 8 Rest: what is the best place to look for up to date working examples? [closed]

REST in D8 seems to be a moving target over the last months, so an example from some months or even weeks may be not working exactly the same way. What is the best place to check how to make at least ...
0
votes
1answer
18 views

How can I flag (follow) user by REST API using service resources?

I am using flag module to have the following user function. So that the followers will be able to read the blog of the users that they followed. Now I want to provide api for mobile application, when ...
0
votes
1answer
28 views

Cant create View with Many to Many Relationship

I have a situation with three content types. (Simplified) A Person is referenced in many Transactions, and a Transaction also has a reference to a Company. I.e. Person -< Transactions >- ...
0
votes
0answers
18 views

Can I make a custom resource on services with 2 args (int) to retrieve with?

My custom resource consists of retrieving with two arguments that are : entity_id and uid from a custom table i've created. It doesn't work for now Can I do that : ...
0
votes
1answer
54 views

Drupal 8 REST Post creating entities with relations

I am having trouble creating comments on nodes ( articles etc. ) with the Rest module. I have enabled the endpoint in rest.settings.yml : resources: 'entity:node': GET: ...
0
votes
2answers
25 views

Drupal 7 posting to Services module in Ruby leads to 403 error

I am writing a Ruby script to ingest content into Drupal 7. This is on my local machine. I'm using the Services module and its rest service to GET and POST. I could log in and grab the csrf token and ...
0
votes
1answer
21 views

Menu access callback function called multiple times

I have following menu defined with access callback function. As You can see this is a hack so I can use REST via GET ( normally Services do not offer this ). All my endpoints are defined ...
2
votes
1answer
78 views

Getting a 403 error in REST

So I'm giving REST a try. Installed drupal-8.0.0-beta12 in a VM. cURL works fine using curl http://testing.dev/drupal8/node/1?_format=json but I'm not sure why I'm getting a 403 error message using ...
0
votes
0answers
32 views

Posted nodes with translations lose title

I'm currently prototyping a project in Drupal 8. I'm posting HAL json to /entity/node with the relevant headers to create nodes. I'm including translations as per this example: { "_links":{ ...
1
vote
0answers
100 views

Post/Upload file using Drupal Services Module without base64 (Using REST multipart/form-data )

I am sure its possible in Drupal also. Here is the reference for Java code http://stackoverflow.com/questions/5723429/use-rest-client-to-call-multipart-form-data-rest-web-service and ...
0
votes
1answer
22 views

Drupal REST showing more detailed error messages to user

im making an app with titanium that connects to a drupal backend. im using the awesome library (https://github.com/jbeuckm/drupal-client). how can i show more detailed error messages (e.g. ...
0
votes
0answers
44 views

REST export doesn't give image URLs

We have a headless Drupal 7 project that uses express and handlebars for it's front end. I'm experimenting with updating the backend to use Drupal 8. I've created a REST export type view, but when ...
0
votes
0answers
23 views

API to publish articles on Drupal

Does Drupal provide any kind of APIs to publish articles? I have Ruby on Rails application for content authoring and need to publish articles to different site which runs on Drupal
1
vote
1answer
33 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: ...
0
votes
0answers
14 views

REST based authoring facility

I intend to use Drupal for a news portal. We have a strong system which is exposed as REST based services in J2EE. Does Drupal have a capability to consume already developed REST services as a ...
0
votes
3answers
45 views

How to make my Drupal custome Service return data on GET?

I have defined few Drupal custom Services and they are working fine via POST requests. But one of them needs to be available via GET. This one: function rooms_services_services_resources() { ...
0
votes
3answers
49 views

Ho to create simple confirmation page

I want to create simple confirmation page. It means that after user change his email then he gets confirmation email with link to page. This link contains token. This link should open page for user ...
0
votes
0answers
96 views

How to build a user authentication workflow with AngularJS using RESTful module?

I'm building a single page app with AngularJS and Drupal as the backend. I'm using the RESTful module. However, I do not have much to go on to build a user authentication workflow. There are several ...
0
votes
1answer
142 views

How do I enable CORS on Drupal 7 Service endpoint?

I tried to call a Drupal service endpoint, exposed by the Services module, using ionic which is built on Cordova. I ran 'ionic serve', so it wasn't serving from the file system but had an actual ...
0
votes
1answer
24 views

No response from Services Entity API when added '.json' to the end of alias

While configuring Services module, when I add '.json' to the end of the resource alias I get an emtpy page. Other resources that are not provided via Services Entity API output json the same way. The ...
1
vote
1answer
33 views

Views Get Data from REST API without creating nodes

I am consuming data via a 3rd party REST API (not a Drupal site). I'd like to minimize double-duty (importing nodes from the API and then displaying that data) and just display the API data directly ...
0
votes
2answers
70 views

Drupal 7 + Services 3 : anonymous user can't access user/register endpoint (401 access denied)

I'm using Services for providing an external webapp to register new user to the Drupal server. I'm able to login from the webapp, create node and post comment. But I can't have access to user ...
0
votes
1answer
15 views

Hiding fields from RESTful services?

So, this may be a stupid question because it seems pretty basic to me, but I can't find any information about this on here or elsewhere. Is it possible to specify fields to be visible/invisible to ...
1
vote
1answer
91 views

JSON format for creating users with custom fields using services

I am using Services module to register new users. My registration form has some custom fields like text field, radio buttons and select list. The following is the data I am sending: { "name" : ...
0
votes
0answers
138 views

Services: 404 Could not find the controller

I have a strange problem. This is my code: function bd7_services_services_resources() { return array( 'get' => array( 'index' => array( 'help' => 'Ritorna le ...
1
vote
1answer
55 views

Integrating external web application in Drupal

I have an existing web application written in Flask. I want to create a Drupal site that integrates this existing web application, so that the existing webapp will just be a back end, and the Drupal ...
0
votes
1answer
43 views

Howto get ID on newly created content through Drupal 8 REST POST

I have a working decoupled/headless setup working using Drupal 8 beta 10 as a backend, and a html5/js webapp as frontend, on seperate servers. For this scenario, I'm succesfully able to post new ...
0
votes
0answers
65 views

How can I update a node with RESTful Web Services API

I am able to create nodes no problem using this code but I can't seem to be able to update nodes (PUT) using the RESTful Web Services Module. I'm pretty much am using the same code as I found on this ...
1
vote
2answers
92 views

REST Server with my module service returns 404

I have set up my drupal REST using REST Server and services. Also I have created my own module which implements hook_services_resources(). I have configured REST with to use my resource and node. ...
1
vote
2answers
177 views

How do you upload files using the RestWS module?

I have a remote front-end application under development and I would like to interface with Drupal as a backend service, using the RestWS module to create a RESTful service to my Drupal instance (using ...
0
votes
1answer
167 views

drupal_http_request with basic authorization receives 401 response

I am trying to use drupal_http_request to connect to a remote rest-based webservice that users http basic authorization. The following curl command works every time from a command line, and I'm trying ...
2
votes
1answer
236 views

Setting Up Drupal 8 REST Post Request

I am having issues sending a POST request to create a node with Drupal 8 Core REST. Here are the steps I have went through several times. Note that these steps are in effort to produce a working ...
4
votes
1answer
298 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 ...
0
votes
1answer
51 views

Drupal 7 Time out when trying to delete user using Services REST API

I am using Drupal 7 and the Services module to manage user. Logging in and creating users works just fine. However, when I try a delete request I either get this response: <b>Fatal ...
1
vote
1answer
50 views

What's wrong with my GET request? (Commerce Services, REST)

I'm developing a mobile app to connect with my Drupal Commerce (Kickstart) store, using a REST server. When I do GET: endpoint/rest/product it retrieves the products list <result ...
1
vote
1answer
132 views

Problem attaching files to nodes with Services

I'm trying to attach files (images) to nodes via Services 3 from an external app using JavaScript. From what I understand (and doing) is: 1) Create a node posting JSON to my endpoint ...
0
votes
0answers
87 views

Restws module exposing custom module content

I'm using RESTws module and access content via /node/id.json. I've written a custom module and use the "hook_entity_property_info" which exposes these fields: { "entity_id": 6655, "cloudinary": { ...
1
vote
0answers
64 views

How to use API versioning with the Services module?

I'm using the Services module to produce a REST API. According to the official documentation, there is a way to version services resources. I believe version here means supplying a single API (e.g. ...
0
votes
1answer
16 views

Services 3: How can I get a list of the roles in a system, via the REST API?

Similar to How to Retrieve all Forums, how can I retrieve the list of roles in a system via the Services REST API? This is Drupal 7, Services 3.x. Are roles terms in a taxonomy vocabulary ?
0
votes
1answer
21 views

Services 3: how to create and delete a forum? via POST to taxonomy_term?

I'd like to be able to programmatically create and delete Forums on a Drupal 7 install, via the Services module. I want to send in HTTP requests and have those things happen. I know how to create a ...
0
votes
0answers
46 views

Rest services - login cookie

I'm using Drupal 7. When I POST request to remote site (services_endpoint/user/login) I am able to receive a session name and session id and all other information about user. After that when I open a ...
0
votes
1answer
107 views

Problem with session ID and Drupal cookies when trying to establish a connection with Service Module and http-post

I tried to established a connection between my app and Drupal services. When I try to login to remote Drupal site using Mozilla add-on Poster everything is working... POST request return OK 200 and ...
0
votes
1answer
35 views

Services 3: retrieve the list of posts for a particular forum

From this question, I know how to retrieve a list of forum posts (forum topics?) from drupal. curl -i -X GET \ -H Cookie:SESSe6a353351df0bcafe98787beef=B0YAHD3-reWwwW-kzhqw6A-SgeShSYUAAQQjh \ ...