Stack Exchange Network

Stack Exchange network consists of 175 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
20 views

jsonapi Cross-Origin Read Blocking (CORB) blocked cross-origin response in vue

I got the data with postman in json:api at drupal. But I has error of CORB in Vue-resource.get() with code blew: data(){ return{ cyclePic:[], rootUrl:this.$http.options.root, ...
0
votes
0answers
27 views

JSON:API How to retrieve multiple values in a CONTAINS condition?

I'm using JSON:API module (in core since v8.7), and works well for a simple query like: Retrieve all articles with title that contains "MyKeyValue" or subtitle that contains "MyKeyValue" That, ...
0
votes
1answer
17 views

Pagination in external api consume custom module

I created a custom module in order to consume an external api call in my drupal project following this question. The module is working fine, but I need to have a pagination in the received results ...
-2
votes
1answer
31 views

Custom search function with result from external url

I need to create a page in Drupal 8 where there is a text field and a search button. When the user has entered a word to search and hit the search button a list with a search result should be ...
0
votes
0answers
25 views

Subrequests: Assigning Paragraphs entity to node

Migrating a content type from D7 into a greenfield D8 app, so I'm using Subrequests and jsonapi modules. My first subrequest to create a simple Paragraph returns the new ID and it properly replaces my ...
0
votes
1answer
21 views

REST Export Views and images alternative text

I have a simple REST export View. The View format is set to "Show: Entity". The content type I am exporting contains a standard image field. My image field settings is set to "Enable Alt field" and "...
1
vote
0answers
23 views

Migrate Update already imported content from the Json source

I have two JSON source files of product categories which contain duplicate products. Here's the link of the two source JSON files https://gist.github.com/naveenvalecha/...
0
votes
0answers
15 views

Comment API Endpoint for restful module drupal 7 not working

I am trying to put comment to a node using POST method to the endpoint api/v1.1/comments Here is the API file: <?php /** * @file * Contains \Drupal\restful_example\Plugin\resource\comment\...
0
votes
0answers
61 views

How to serialize a form's render array to JSON

I want to build a REST resource to return Forms as JSON with all labels, help text, default values, etc... When I use REST's built-in resource /entity/entity_form_display/node.article.default it does ...
0
votes
0answers
65 views

Post http request with raw json?

I need to build a http_request raw json in drupal 7 and the format of the json is: {"customerAddress": { "address":"foo st", "town":"Roma", "postalCode":"00131", "...
0
votes
1answer
16 views

push jsonlog data to elasticsearch

I have installed the module jsonlog on drupal 7, but there are no information on how can I push the logs to elasticsearch or kibana or logstash. How do I do that?
1
vote
1answer
72 views

Paragraphs from sub_process

I need to migrate a json feed with following example structure; { "data":[ { "id":"11028", "first_name":"Foo", "last_name":"Bar", "functions":{ ...
0
votes
0answers
34 views

Tempstore UUID goes to 404 page

I am using JSON API. For the Preview, for the newly created Article storing UUID in tempstore. http://127.0.0.1/project/jsonapi/node/article/f0c7fa28-5289-49b7-9c90-94c81d198d87 But when I run it ...
0
votes
1answer
105 views

Paragraphs module decoupled structure

I'm looking to use the Paragraphs Drupal 8 module with a decoupled installation of Drupal 8 but would like the structure made in the admin area to be output in the JSON API responses. How can I ...
2
votes
1answer
114 views

How to change view REST export format

This is my settings in view. Data what I have is now in this format: [{"created":"1551709414","field_iot_integer":"43"}, {"created":"1551709404","field_iot_integer":"98"}, {"created":"1551709392","...
1
vote
1answer
39 views

json migration to nodes

I have a json file with 572 items. I have created the migration script and it runs ok, except that the end results says processed 572 items (1 created, 571 updated) It looks like instead of ...
0
votes
1answer
36 views

Serializing dates

In Drupal, we have the time printed as "2012-03-19 07:22". What I need is just "\/Date(1198908717056)\/" or just "1198908717056". I am trying to get that format using the following code. use Drupal\...
0
votes
0answers
228 views

“Not acceptable format” error on JSON login

I am testing the REST API, with the REST UI module installed on Drupal version 8.6.9. In Postman, using the POST method (http://www.domain.com/user/login?_format=json), I get the following error. ...
0
votes
1answer
236 views

User login through JSON request returning HTML instead of JSON

I am using Drupal 8.6.4 http://example.org/user/login?_format=json When I try to submit a post request, it returns HTML page instead of JSON response. I am sending headers: Content-Type: ...
0
votes
0answers
9 views

How to consume Views GeoJSON in a custom JS map application?

I'm trying to implement a custom Google Maps implementation that uses data from Views GeoJSON feeds. I need a custom approach as I need to be able to add multiple data layers. So, I need to grab the ...
1
vote
1answer
68 views

How to make use of the render placeholder system for cacheablejsonresponse?

I have custom controllers which provide CacheableJsonResponse responses. Those responses are quite heavy to build (couple of seconds), so I want to build them better. I build those responses by ...
0
votes
0answers
81 views

My custom normalizer doesn't get executed

I'm building a REST api with Drupal 8 and I want to override the normalizer for the Formated Text field type. I started with this example module: https://github.com/jazzdrive3/example_normalizer ...
0
votes
0answers
80 views

Formatting Paragraphs in json in my drupal powered REST API

I'm using Paragraphs to organise my content. A Project has many paragraphs. Each paragraph can be of type Text or Image (thanks to the paragraph type feature). I want to expose my content to a REST ...
0
votes
0answers
29 views

How to store non-entity data using REST?

I'm developing a decoupled system where the end user can add additional textual information to images displayed by Drupal 8 in a lightbox. When the user opens an image, my custom module launches a ...
0
votes
1answer
29 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
65 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 ...
2
votes
2answers
341 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
13 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
38 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
18 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
1answer
165 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
146 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 ...
-1
votes
1answer
54 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
32 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
51 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
2answers
198 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
70 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
24 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?
1
vote
1answer
546 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 ...
0
votes
1answer
1k 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
1answer
128 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
365 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 -> ...
3
votes
0answers
431 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
1answer
127 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 ...
3
votes
1answer
301 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
47 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
148 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
223 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 ...
1
vote
0answers
204 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 ...