JSON is a text-based open standard. It is human-readable and used for data interchange between applications. Use this tag for questions related to topics such as 'JSON used in Drupal web services (REST)' or 'JavaScript callback functions which returns data in JSON format'.

learn more… | top users | synonyms

0
votes
0answers
9 views

expose a date filter in a views datasource JSON View

I need to expose a date filter in a JSON View, made with the Views Datasource module, but I can't find any documentation on the matter, I don't even know if it's possible. I know how to do it using ...
0
votes
0answers
10 views

Create content of certain content type based on outside information/validation

I'm running a game server. This server is updated ever so often and I want my players to be informed about the update. I want this to happen automatically. What I have is some JSON output I can query ...
0
votes
0answers
15 views

inserting a date into database with JSONParser module

i have a json file { "student":[{"firstname":"bharath","marks":"80","dateone":"13/09/2014 06:07:08","datetwo":"18/12/2016 09:08:05"}, {"firstname":"purna","marks":"70","dateone":"17/03/2012 ...
1
vote
0answers
34 views

Importing data into Drupal 8

I have various spreadsheets of data to import into Drupal 8. I can create a content type for each spreadsheet. I can convert the data the spreadsheets into various formats (csv, JSON, XML, whatever). ...
2
votes
2answers
107 views

How to use external JSON API to create/update node's fields?

I have a content type: siteinfo. This content type has multiple fields: text, entity reference etc. I want to use an external API to automatically fill some fields of the created node. The API I ...
-1
votes
0answers
11 views

How to use Icon8/webicons library with Drupal 7?

I am trying to use this package with Drupal 7: https://github.com/icons8/webicon I've read the instructions...but can't figure out how to do this, is there a module to assist with this? I'm using ...
0
votes
1answer
33 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 ...
1
vote
1answer
30 views

How to calculate margins based on JSON and ONIX (XML) input and calculate points based on them?

In a Drupal Commerce distribution based on Drupal 7 we sell books. First I want to calculate a margin price based on several given data. The JSON is imported or can be manually added. The ONIX (in ...
0
votes
2answers
104 views

How to import nodes with custom fields using Feeds module and Feeds JSONPath Parser

I've got a content type called 2Wd-Tractor with this structure : Model (node title) Engine Transmission Operational Hydraulic System Engine field is a custom field implemented using Field Api and ...
1
vote
1answer
59 views

Ajax callback return 500 Internal Server Error

file mymodule.inc : $items['ajax/channel/%/get-program'] = array( 'title' => t('get channel program by ID'), 'type' => MENU_CALLBACK, 'page callback' => ...
0
votes
1answer
23 views

Export sorted View to JSON

I need some expert help. I need to export data into JSON. Here are the steps I followed: 1> Created a draggable view to allow admin to provide appropriate sort order. ref ...
0
votes
0answers
25 views

Can not get JSON data

I am using Drupal 8, and I am currently developing a Custom Module, and this is my first time using Drupal and Drupal 8. I am having an issue, which is trying to get JSON values from a JSON file and ...
0
votes
0answers
22 views

How to convert multiple node in Json format to use in Apps?

I have created a custom module which takes post argument and sent the result in json format. function cfood_api_get_stadium_list($cn, $city){ $query = new EntityFieldQuery(); $entities = ...
0
votes
1answer
15 views

Views AJAX functionality works, but nothing changes at all

All AJAX functionality doesn't work properly. Response body: [{"command":"settings","settings":{"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"my_theme" ...
1
vote
0answers
25 views

Field Collection values in json data document view

I am wondering if I am hitting the limits of what can be done with the json data document view for displaying output and whether I need to just write my own module or use php's json_encode to do this. ...
0
votes
0answers
39 views

feed drupal 8 custom block with json decode content

i have created a block and try to feed it with WS request function amu_news_preprocess_block(&$variables) { if ($variables['elements']['#configuration']['id'] == 'amu_news_block') { ...
0
votes
2answers
33 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
22 views

Output the “Body” field with markup using Views PHP to be used in Views Datasource (JSON)

We are creating an API using Views/Views Datasource and we want to output the Body field with markup already in the field not plain text. How can we do this? This Views_PHP approach just outputs the ...
1
vote
1answer
120 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 ...
2
votes
2answers
45 views

Drupal as a RestAPI

I have been using Drupal for a while to build medium to large CMS systems; love it. From time to time I have to build a RestAPI. Usually I use either Laravel, Lumen or Slim. The only reason why I ...
0
votes
1answer
28 views

Calling json from <a>

in mt .tp file I have a loop that outputs Publish or something similar for each entry. I don't want it to refresh the page when clicking on the so I want to call some json instead to call a module ...
0
votes
0answers
19 views

When I request a _format=json of a node, the default values of image fields are not returned. How do I get those?

In the content type I have created an image field with a default value. When I create a new node and decide "default value" is fine and I save the node then when I request a _format=json of this ...
0
votes
0answers
27 views

How to make an Openlayers map based on geojson layers with exposed filters?

Openlayers builds maps combining multiple layers, some of which are based off of view into a single map. From what I have experimented with, putting an exposed filter on a geojson based views, doesn't ...
2
votes
2answers
90 views

How to export 'Content-Type' data into JSON?

I'm using Drupal 7 and I've created a content type as 'CONTENT_TABLE', which includes multiple fields (COLUMNS) as such: CONTENT_ID, CONTENT_NAME, LARGE_THUMBNAIL, ZIP_FILE... I want to export the ...
0
votes
0answers
17 views

How to build a json hierarchy? [duplicate]

I wonder how I can build json with a hierarchy in a Drupal site. Eg : events: { "2014-04-30": {"number": 5, "badgeClass": "badge-warning", "url": "http://w3widgets.com/responsive-slider"}, ...
3
votes
2answers
277 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
1answer
31 views

Drupal Views Datasource and Flag Links

I want to use Views Datasource module to output JSON, i then want to construct the JSON output using REACT JS or alike. I am currently stuck on how to output the Flag Link, it just comes back with an ...
0
votes
1answer
11 views

How to show more than two fields in a Openlayers popup on a views_geojson layer?

I have finally gotten my OpenLayers working, and I'm trying to show 7 fields about my points in a popup. By default, Views_geojsononly allows you to define a title and description fields for tooltips. ...
0
votes
1answer
22 views

Turn Drupal into a USER API

I'm developing the main website (A) for an organisation in D7 but for other reasons there are microsites (B) related to this website using CMSs. I need to give this other users an endpoint in which ...
0
votes
0answers
9 views

What nodes have been created when an “attached” feed importer has been run?

I have a feed importer defined on my site via the JSONPath parser. The feed importer pulls in bibliographic data for a third party source, via the API provided by that third party. It creates a node ...
0
votes
1answer
48 views

How to get services post data(json format) callback function?

I am using services module and rest API its working fine. But i need to create a menu callback where i get the json post data and save in database. How to get the json data in menu callback?
0
votes
1answer
55 views

Search a content type and return JSON [duplicate]

I'm trying to create a JSON API that will return an array of JSON results matching specific search criteria. It will always be searching one specific content type, but will need to match custom ...
0
votes
1answer
60 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 ...
0
votes
2answers
111 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
1answer
91 views

How to print Json data from Facebook in a block?

I would like to print the amount of Facebook likes for a url into a block. The Facebook API returns JSON like so: ...
0
votes
0answers
26 views

No reply from rest service after creating two nodes

I had to fill a website with 12000 nodes , so I wrote a c# application which sends nodes (encoded in JSON format) from my local computer to website. using services module proper resources are ...
1
vote
1answer
18 views

How to fetch all the details of a marketplace organization's page on Drupal.org

I am new to Drupal. I am trying to fetch all the details of a marketplace organisation's page, which are visible on drupal.org. I am using the node id to access ...
1
vote
0answers
19 views

Getting my data into drupal 7 [duplicate]

I manage a list of contact names, phone, fax, location/address, job title and department in a simple text file. That text file is then turned into a JSON file. I want to have drupal pages with ...
1
vote
2answers
33 views

Is it safe to send the unencoded JSON output?

The mobile app developers wants an api to get a list of articles from our Drupal site. It should have these fields in the output: nid title field_teaser_body The api resonse has to be in JSON ...
2
votes
1answer
78 views

How can I return literal JSON from a node as a JSON object in views json?

I have a content type with a field called output. This field will contain JSON. I want to output this field as JSON using Views JSON (in Views Datasource). The problem I'm encountering is views ...
0
votes
1answer
70 views

how to prevent user from clicking button twice on server side in jqx [duplicate]

$('#save').on('click',function(){ $('#form').jqxValidator('validate'); }); How can I prevent user from click button twice on server side?
0
votes
2answers
462 views

How to call external api to pull data into json format?

There is an api that is used to expose data from an external website. How can I use the drupal API to call the external api and pull the data into json format? the external api would be, for example, ...
0
votes
1answer
97 views

insert json into db

I'm trying to store some JSON data as string into database, but db_query change my JSON {} to table prefix. So I have wrong JSON in DB as result. How can I prevent such behavior?
0
votes
0answers
28 views

It is possible to use a view formatted autocompletion json as the results of a FAPI textfield autocomplete?

I'm trying to do a fapi element autocomplete textfield using a view formated autocompletion json I mean, created a view which returns a json using a exposed filter criteria. The view as is works ...
1
vote
1answer
36 views

JSON Menu Link Without Invoking Init Hooks?

Our Drupal site utilizes a number of menu hooks to return JSON from an API we manage in a separate Web API. We also have a number of intensive tasks that happen on each page load via the hooks_init in ...
1
vote
1answer
228 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
80 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
0answers
61 views

How can i remove the whitespace generated before file field in views output

i have a drupal content type with one file field. Now i created a view of list of contents of that type with the file field on display. In the output the file field shows the file along with mime ...
1
vote
1answer
511 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: ...
1
vote
1answer
108 views

How to create authentication token in the HTTP header request for Json view

I have a view listing some fields from a content type then i made it in a Json format using View DataSource module, all is ok with me tell now i want to add authentication token in the header request ...