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
1answer
25 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 ...
1
vote
0answers
10 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
14 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
34 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
16 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"}, ...
1
vote
1answer
49 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
11 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
5 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
20 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
24 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
33 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
37 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
58 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
64 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
24 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
16 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 ...
0
votes
0answers
17 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
32 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
56 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
53 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
281 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
52 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
19 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
31 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
123 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
0answers
40 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 ...
0
votes
1answer
317 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
66 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 ...
2
votes
0answers
74 views

drupal_http_request returning Invalid JSON primitive:

I am developing a module for Drupal 7 that has t make a call to a remote API. I am using drupal_http_build_query and drupal_http_request and finally drupal_json_decode to decode the output. My code ...
0
votes
0answers
68 views

Render JSON View with array of objects in a field

I am trying to use the views datasource module to render an array of JSON objects. That works fine for a while, until I get to an object with a field that should contain an array of 3 more objects. ...
1
vote
0answers
85 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
1answer
80 views

Create node from JSON

I'm looking to write the following module, any help, guidance, and advice would be greatly appreciated. User is logged into site. Site has two content types: page & note. Logged in user can ...
0
votes
0answers
61 views

Recommended solution for JSON decoding and caching in Drupal 7

I'm trying to find a way to use some of Drupal's modules to query URLs that respond in JSON and cache them after decoding. I'll describe in detail. What I have: This is an example of the script: ...
0
votes
0answers
51 views

How to import JSON data from a XML element

I'm completely stuck with this problem for days now and I hope someone can help me out. I'm no expert in XPath so please forgive me if my question is a bit noobish: I want to import XML data from a ...
0
votes
1answer
81 views

Strip HTML tags from Field Collections in Services Views

I'm trying to strip the HTML tags from a JSON response I generated using Services Views, but I'm not having any luck so far. I have a content type with a Field Collections field in it that is ...
0
votes
1answer
41 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
268 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" : ...
1
vote
0answers
27 views

How to run auto feed with a auto link for every created node?

I'm stuck on changing the url of a feeds what i want to do is after a person creates a content that feeds runs his feeds to the target url depending on the value he filled in. example: person fills ...
0
votes
1answer
66 views

How to create a custom field that gets URL counts from LinkedIn on external articles?

My site has a content type named News, which receives news from external RSS feed. Therefore, content type News has the following fields: Title = article title (i.e. Hapag-Lloyd orders five ...
0
votes
0answers
44 views

How to import the content of a Uri contained in JSON feed

I am trying to import a JSON data feed into Drupal. Below is an extract from the feed (it comes from NHS Choices). [{ "Class": "main", "Text": "Calories in alcohol", "Uri": ...
1
vote
0answers
54 views

Arrays of integers in Views Datasource JSON output [closed]

I'd like to output my pages content as JSON file. I've creates a module using Field API, for a custom variable containing RGB values in three fields. When processing the content of the page I'd like ...
1
vote
1answer
96 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 ...
2
votes
2answers
111 views

Avoiding PHP timeout when geocoding many addresses - preferred method?

I have a script that's taking in a ton of address data from a CSV, converting it to JSON, and along the way it hits the Google Maps API to get the latitude and longitude of each address. It then ...
1
vote
1answer
71 views

Is json_decode parse-ability proof of a safe string?

Do I need to use check_plain (or something else) when displaying a user supplied JSON string, when I have previously checked it successfully parses with json_decode?
4
votes
2answers
768 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 ...
1
vote
1answer
78 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
0answers
46 views

drupal 7 AJAX loaded node returns two different formats [closed]

hi I'm loading some node info via AJAX and in one instance it works fine, the other instance I get raw information back, I'm not sure if this raw info if JSON (as I'm not sure what JSON is), but what ...
1
vote
0answers
283 views

Ajax load node via jQuery

I'm having a bit of an issue with Ajax appearing inconsistent when loading my nodes. I initially followed the advice in this blog http://mrkadin.com/blog/node/70 which appears to work perfectly ...