Stack Exchange Network

Stack Exchange network consists of 174 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 [json]

The tag has no usage guidance.

0
votes
1answer
17 views

Using JSON:API to replicate content on external location

I would like to create content on another Drupal instance using JSON:API. Using the jsonapi_extras service, serializer.normalizer.entity.jsonapi_extras, entities can serialized but contain more node ...
-1
votes
1answer
23 views

Alter serialized json output

Everytime a node is created, I have a Rules Action that serialized the data into json and send it to OneSignal. I have the below code that does it... $entity_id = $entity->id(); // Getting ...
-1
votes
0answers
29 views

Yadcf Datatables custom function date range [closed]

I need to create a custom function for a select filter using the YADCF Datatables plugin. I have a Datatable with thousands of items coming from a Json source. One column is a date field displaying ...
0
votes
0answers
14 views

Import taxonomy with hierarchy through JSON:API

I'm using JSON:API to migrate data from one Drupal 8 site to another and can successfully migrate taxonomy terms. However, the hierarchy is not preserved. My taxonomy migration looks like this: ...
0
votes
0answers
16 views

How to alter the Views REST Export JSON

Working on D8, I am able to get the JSON export. Now I need to format the data. I tried some external PHP script it's working great. But how can I do it in a a view itself and how can I overwrite the ...
0
votes
0answers
23 views

How can I fetch the complete main navigation menu via JSON:API?

How can I fetch the complete main navigation menu via jsonapi? I've tried: curl --header 'Accept: application/vnd.api+json' https://cms.example.com/jsonapi/menu/menu/ and curl --header 'Accept: ...
0
votes
0answers
11 views

Define permissions per resource

I'm using jsonapi for a headless approach, and need to return a 403 for certain resources if they don't have the permission to view them. Currently this isn't possible using the module - instead the ...
2
votes
1answer
19 views

Multilingual REST export

I have Drupal 8 site which interacts with a React component. I want to expose one of my content type's content using REST export in views. How do I set views path to create REST export for ...
0
votes
1answer
16 views

REST export with no data over it's localhost IP

I have a REST export which provides data with a call (curl or browser) to the Drupal URL(s). But we need to get these data over a curl to vhosts IP-Address and from this address, which is 192.168.34....
0
votes
0answers
23 views

Rest export contextual filter by taxonomy name

good night developers!. I have a view of a chapter content type and a relationship with the taxonomy term book. I can add any field from the taxonomy, but can not include the relationship in the ...
0
votes
1answer
39 views

REST export View shows “This display has no path” in View UI and 404 Error on page

I've got a fresh install of Drupal 8.6.x with REST/API/JSON Web Services enabled and I've created a Rest export View with path: /api/test which returns the correct JSON View results when I append the ...
3
votes
1answer
32 views

REST export for nested lists of content

Ok here is my problem; I have a list of boats. Each boat have a list of engines that can be fitted to it. Engine is not in anyway coupled with boat as a particular engine can be mounted to any kind ...
0
votes
0answers
10 views

Why drupal_http_request returns a 2000 in the data array

I'm using drupal 7 and calling drupal_http_request which returns some JSON data with GET. However I'm getting data => 2000 followed by the JSON. I'm not sure why I'm getting a 2000 first. the data ...
0
votes
0answers
23 views

React/GraphQL - Issues fetching user relationship data

I'm using GatsbyJS, gatsby-source-plugin and Drupal 8. Using http://localhost:8000/___graphql playground, I'm able to successfully query my drupal data. Query : { allUserUser { edges { ...
0
votes
0answers
24 views

REST logout returns 403

I'm building a site with GatsbyJS and Drupal 8 as a backend. I can successfully login users. However, I receive this error when logging out. POST http://localhost:8888/user/logout?token=...
-1
votes
1answer
27 views

Map JSON data to relevant fields

I have to display some data from a CRM system. I need it like following. Let suppose I have a content type "Cars" which have following fields Car ID, Car Name, Car Model, Car Price I am creating a ...
1
vote
0answers
28 views

Drupal.org API for fetching a specific user’s all contributions [closed]

I’m looking for an API from drupal.org which will give a JSON of the contributions(credit, commit) for a specific username. I got this https://www.drupal.org/api-d7/user.json?name=[username] but this ...
1
vote
0answers
23 views

Drupal.org API for fetching a list of issues for a specific module [duplicate]

I'm looking for an API which will return a list of issues for a specific module in JSON format. I had a look on the https://www.drupal.org/drupalorg/docs/api didn’t find any as such.
1
vote
1answer
46 views

Migration configuration

I'm setting up a migration from an URL with JSON on it. Got the first level values without any issues. Currently I'm stuck at nested arrays which resemble something like this: { "content": [ { ...
0
votes
1answer
38 views

MetaTag with JSON API won't serialize

I'm attempting to get MetaTag info for a decoupled site but the JSON API is not converting the object to JSON correctly. I'm seeing other fields show up fine - the issue is isolated to the MetaTags. ...
0
votes
0answers
30 views

How to add new data to field that support multiple field via JSONAPI?

I am using jsonapi to PATCH(update) a content in a content type called "engagement". All the APIs including patch are working fine. However, when I am trying to update a new value to a field with ...
0
votes
1answer
21 views

How to return [error] in a rest api build with view?

I have a view which gives has an input: email key The json returns a uid. I would like to return [error] when the combination email + key is not found. Currently, it is only []. How to do this?
0
votes
0answers
18 views

PATCH request replaces value in entity reference field instead of creating new

I have an entity reference field named order_entryin my crm core individual, the problem is that when I try to PATCHthe user and send new order there, it replaces the order instead of adding new ...
1
vote
1answer
163 views

REST GET ResourceResponse returns encoded json

I have a decoupled drupal project with an angular 5 front end that is utilizing a restful api to store data. Because this API needed a key that we didn't want to expose we have created a restful ...
-1
votes
1answer
340 views

Views & JSON API

I can see Drupal 8 Views support REST Export. But not JSON API. So how to integrate Views with JSON API? https://www.drupal.org/project/jsonapi
0
votes
2answers
50 views

Permission issues with Custom Content Entity exposed to REST API

I hope it's not a duplicate entry. I've recently created my Custom Content Entity within a Custom module and I'm currently having trouble with permissions. (Please see permissions below) The ...
2
votes
1answer
135 views

REST for nested paragraphs

I need to create a rest service that delivers the current data: getNode(nid) -> all node fields -> if field is entity reference (like file, human readable urls) -> include subfields -> ...
0
votes
0answers
45 views

How to post JSON data into dblog in drupal 8?

I have created a custom module naming "razorpay". My routing file look like this:- razorpay.webhook: path: /razorpay/webhook defaults: _controller: '\Drupal\razorpay\Controller\...
2
votes
0answers
166 views

Filter by taxonomy parent using Json api

In drupal 8.5 I have a taxonomy term list like this: Term A (12 items) Term 1 (3 items) Term 2 (8 items) Term 3 (1 items) Term B (3 items) Term 4 (1 items) Term 5 (2 items) I want to use ...
0
votes
0answers
45 views

Login using REST request gives 404

This is so simple login request but cannot figure out why I am getting such error message when trying to login using Postman. I use url http://localhost:8080/user/login?_format=json and input in the ...
0
votes
0answers
116 views

How to install the JSONPath library?

I use the "Feeds JSONPath Parser" module. But I get a message like: The JSONPath library is not installed. How install JSONPath library?
2
votes
1answer
169 views

Simple OAuth + JSONapi response when token is expired - Decoupled

We're using the 'Simple OAuth' and 'jsonapi' modules for the front end authentication in Angular of our decoupled Drupal project. We've noticed that when the user credentials are correct but the ...
1
vote
1answer
25 views

How to prevent my ZURB theme from stripping out part of the JSON LD element?

I use ZURB theme and following I post the code of my template.php file. My problem is, that type="application/ld+json" in <script type="application/ld+json"> gets stripped out so it is rendered ...
0
votes
1answer
100 views

Execute some steps before REST POST request

I have created a custom content type and configured it to be created via REST POST method using REST client like POSTMAN or any frontend(like angularJS or react). I want to execute few steps before ...
0
votes
1answer
140 views

Use JSON instead HTML for access denied on some custom paths

I create a small API for one project using Bathic Authentication. The API consists of some custom paths defined in routes in a custom module. Using JsonResponse() in the controller we send back a JSON ...
0
votes
0answers
83 views

How do I create a custom JSON API endpoint?

I would like to create a custom JSON API endpoint to preview nodes in draft status. The URL will be something like "jsonapi/node/page/preview". If a page node has a draft in progress, it should be ...
0
votes
0answers
53 views

add multiple values By restful api

i have problem in multiple values using RESFUL API in Drupal 8 i have field it has multi values in it, but when i did patch Method to add another value, all the values that in the field before will ...
2
votes
1answer
253 views

How do you upload an image via jsonapi?

The documentation is vague: https://www.drupal.org/docs/8/modules/json-api/working-with-files-post I am trying to upload an image following the sample code given for uploading a "document" on above ...
1
vote
0answers
23 views

Accessing element in REST export view json response

I have an API created from a REST export view, now im trying to do some behat test, but im getting some strange/different result when accessing an element in the json formatted response. Using this ...
0
votes
0answers
24 views

What content-type should I use in my header when POSTing data to Drupal 8 with fetch?

I am trying to POST a json string to Drupal 8 from my javascript application, using fetch. It doesn't work at all unless I use 'applicaton/x-www-form-urlencoded' as my content-type. When I use '...
1
vote
1answer
204 views

How to convert the drupal-entity tag into an img tag?

I have a content type with a text field that uses CKEditor, in the editor is possible to add a media entity image, once the image is inserted inside the text the html tag for it is: <p>Document&...
0
votes
1answer
43 views

how to adjust installer path in JSON file to customize vendor dir

Before using 'composer install' I edit extra installers paths. Example: edit /web to /a-custom-docroot folder where is placed core, modules and all other folders. When possible I would like to ...
0
votes
1answer
39 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
0answers
44 views

Working example of blueprint (subrequest) to create a paragraph and associated entity?

I'm using the subrequests and paragraphs modules. Without a code example, it's daunting to try to build a working blueprint for the subrequest, when I haven't used either module before. I have ...
0
votes
1answer
227 views

REST API 401 Unauthorized

I am trying to create a new node with POST through REST in D8. I have enabled the relevant modules (hal, serialization, http basic authentication, Rest web services, rest ui) and added the required ...
1
vote
1answer
94 views

what json structure does simple oauth expect?

Drupal 8. I'm new with simple Oauth. I had manage to do this: But I want to do it with the Raw format, cuz my frontend is in Angular, so I will send a Json to Drupal. This is my first try: { ...
0
votes
0answers
227 views

How to get the JWT token via webservice

After enabling the JWT module. and following Using JSON Web Tokens (JWT) to Authenticate Requests to REST Resources in Drupal 8 on how to use it, it is working. I know I can access the user JWT ...
0
votes
0answers
49 views

Add number of records to display as a contextual filter in views rest export

I have a Rest Export view and want to add the count of results to display as a contextual filter like this when for example hit this URL:- mywebsite.com/api/get-articles/2 this will return only two ...
0
votes
1answer
52 views

Create a Json view of the user, with the format of the user/login response

I'm in Drupal 8. After activating the module rest, and try and receive a response from the route /user/login?_format=json I get this: { "current_user": { "uid": "4", "name": "...
0
votes
1answer
43 views

Send user email through rest services

I made a view, with a contextual filter in the user id. The fields are: Name uid Email. [ { "username": "pruthiswebar", "id": "8" } ] If I am logged, I can see the email, ...