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
17 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 ...
1
vote
1answer
45 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
17 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
70 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
79 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
0answers
48 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
31 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 ...
0
votes
2answers
73 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":[ { ...
4
votes
2answers
114 views

User login REST format

Do anyone have a working REST Login on Drupal 8? This is what I tried. POST /user/login HTTP/1.1 Host: 8.d8.local Content-Type: application/x-www-form-urlencoded Accept-Encoding: ...
0
votes
0answers
25 views

How do I integrate Open Live Writer?

The Windows Live Writer is now open source as Open Live Writer. There used to be a Blogapi module in Drupal 6 to support WLW. As far as I know that module used XML-RPC to communicate with WLW, and ...
0
votes
0answers
36 views

Custom API paths

How can I add custom path to API requests? Say mysite.com/{api}/user/login.json Is there an option to do this?
2
votes
2answers
62 views

POST method returns 415

Trying to create a node page through web-service.But returns 415 Unsupported media type This is how I have done
0
votes
1answer
49 views

Intercept data of a field of a node Drupal 8

How can I intercept the data of a field when the user add's a node? Below is the use case: The user can input a address in a field, when the user submits the node. Drupal should make a rest request ...
0
votes
0answers
41 views

how to send post request to drupal7 restful api endpoint

In my app, user have to login to RESTful API endpoint created by using drupal webservice module from android device. That endpoint enables "Session authentication", After user logins successfully ...
0
votes
1answer
36 views

fastest between hook_js vs hook_menu to get JSON via REST

I'm trying to figure out if in my case it makes sense to use the High-performance JavaScript callback handler module. Between js/MODULE/example.json (hook_js()) and example.json (hook_menu()), the ...
1
vote
1answer
73 views

Drupal 8 REST GET without caching

Using this tutorial, I've created a custom REST resource in Drupal 8. I'm able to use this resource to retrieve a simple JSON object that says hello to the current user by doing a GET on: ...
0
votes
2answers
56 views

JSON fromat for user login with Email address - Services

Drupal login form allows users to enter their username or email to login into the site. I need to achieve the same thing with services. But services allows users to login with username (not working ...
0
votes
0answers
17 views

Unable to implement RESTful class for field collection

I am attempting to use the RESTful module to create a rest server, and I need to get the path for an image that is stored in an image field within a field collection. There is a ...
0
votes
1answer
19 views

Enable “parent”:[] in REST export view

I have multi level taxonomy with 2 levels, but when I run REST export on it, "parent":[], always stays blank - no matter how many levels there is. How can I expose relations within taxonomy via ...
0
votes
0answers
54 views

Retrieving menu item using REST

I am looking for a way of getting menu items for a menu i.e(Main menu) via rest, enabling the Menu resource and trying /entity/menu/{menu} gives me only dataset of the menu i.e { "uuid": ...
0
votes
0answers
14 views

hook_node_load doesn't work when node is loaded by REST api

On the web, everything works fine (and I even checked the node values with krumo), when I tried fetching the json equivalent of the node using REST api, it's as if the hook_node_load() didn't run. If ...
0
votes
1answer
45 views

Create file through services

I've been trying to create and update users and their pictures through REST calls using the services module. So far, I've got creating and updating users to work, but creating files to set their ...
0
votes
1answer
39 views

REST Web Services - Return all fields from Content entity association

I am currently using the latest release of Drupal 8.0 (downloaded and installed today). I have two content types. I have a entity reference on one of the content types that references content from ...
0
votes
1answer
22 views

Field Info API as REST

We would like to get label for the field. As per previous question: How do I get a field label by the field name? But I need to get this through the REST API of Drupal. Could anyone please suggest ...
0
votes
0answers
26 views

REST on node_type does not return field list

Why a GET call on /entity/node_type/CUSTOMTYPE returns only the node type base properties, not the field list and definitions. How to get them?
0
votes
1answer
18 views

AJAX HTTP error on wsclient REST service

I'm trying out the wsclient in Drupal 7 and whenever I attempt to test the the transaction to another API using REST I get the following error: An AJAX HTTP error occurred. HTTP Result Code: 200 ...
1
vote
1answer
55 views

How to remove the containing “response” tag from GET output

It seems whenever Drupal 8 generates an XML output it gets wrapped in <response> tags. I'm defining a custom rest resource (e.g. like this) and can see no way of modifying this containing tag. ...
0
votes
1answer
27 views

create product programmatically in drupal commerce

I have a module of rest service api, that is used to receive users upload products. Here is my code... function commerce_services_product_create($data, $flatten_fields) { $status =1; ...
2
votes
1answer
54 views

Get nodes of specified content type with REST

I want to retrieve all nodes of specified content type (as example'news') with GET method with REST, How can I achieve it? (first I want try it with firefox RESTClient and if it work implement it in ...
0
votes
1answer
36 views

Is it possible to POST more than one article at once?

How do I POST two or more articles at once? Something like follows: { "_links":{ "type":{ "href":"http://drupal8/rest/type/node/article" } }, "title":[{"value":"Title 1"} ], "title":[{"value":"Title ...
0
votes
1answer
25 views

Using services to post date field

I am using services3 module, I want to post a node of type location. Everything goes well except created_date. I am using date field for created date and my code looks like ...
0
votes
0answers
8 views

Services Entity timestamp range in REST

I am using Services and Services Entity modules. Here is a problem: I want to pull list of entities and their fields which are created in some time range. Here is what I have that works: ...
0
votes
0answers
25 views

Missing Required Argument Node

I have almost 0 knowledge on Drupal. But I need to create a node by calling a RESTful Drupal service from an android app. I know the following procedure: 1. Get the token and session data at the time ...
1
vote
1answer
32 views

How to show data from external api to theme template? [closed]

I am totally new to Drupal. I have given one assignment to build Drupal site which shows courses from our company site. I am totally stuck in one point. I need to show data from our api into theme ...
2
votes
0answers
91 views

500 Internal Server Error : An error occurred(0): Unknown data property field_group_privacy

I am trying to Create Services to Create Node Type Discussion in a Group using Services Module, but getting the error : 500 Internal Server Error : An error occurred(0): Unknown data property ...
3
votes
2answers
198 views

401 Unauthorized : Missing required argument node

I am trying to Create Services to Create Node Type Discussion in a Group using Services Module, but getting the error : 401 Unauthorized : Missing required argument node In the Header I have given: ...
1
vote
0answers
87 views

How to Import data from an external API? [closed]

I'm going to build a Drupal 8 site and will need to be able to get data from an external API and generate nodes with it. Does anyone know how I can accomplish this on Drupal 8? Do I need to generate ...
0
votes
0answers
41 views

401 Unauthorized : Missing required argument values

I am using Services Entity Module I am trying to POST to http://example.com/rest/entity_message and Getting this error 401 Unauthorized : Missing required argument values Can anyone tell what I ...
1
vote
0answers
21 views

How to use this Message Module with Services Module?

Can anyone tell me how to use Message and Services module to create REST API? Is there any other module I need to install to make it work? I am not sure but may be Services Entity API module will ...
0
votes
0answers
37 views

Drupal how to create poll using the services voting api

In Drupal site, I've installed Advance Polling and Services Voting API modules. I have added some questions with some options using (Content --> Add Content --> Advance Poll). The polls are ...
1
vote
1answer
86 views

What is the proper URL to get flag service?

I'm running Drupal 7 with the Services module and the Flag Service modules installed but I'm having trouble trying to figure out how to Get countall for a particular post ? Can anyone please tell me ...
1
vote
0answers
38 views

How to Post JSON data to Drupal Commerce Cart and Checkout in Drupal Commerce Services?

I'm using Drupal commerce services for module for REST api calls. But I don't know how to Post JSON to REST service Cart and Checkout. I have product attributes field_taxo_color and field_taxo_size. ...
1
vote
0answers
195 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 ...
1
vote
0answers
21 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
21 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 ...
1
vote
1answer
151 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 = ...
1
vote
1answer
117 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 ...
-1
votes
1answer
60 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
105 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
61 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 ...