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

1
vote
1answer
15 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
7 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 ...
0
votes
1answer
18 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 ...
0
votes
1answer
39 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 ...
0
votes
1answer
11 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
14 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
48 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: ...
0
votes
1answer
21 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 ...
1
vote
0answers
26 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
21 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. ...
0
votes
0answers
44 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
45 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
29 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
38 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
34 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
23 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
91 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" : ...
0
votes
0answers
21 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
35 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
28 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": ...
0
votes
0answers
38 views

Arrays of integers in Views Datasource JSON output

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
55 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
56 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
40 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?
2
votes
1answer
231 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
50 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
41 views

drupal 7 AJAX loaded node returns two different formats

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
166 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 ...
1
vote
2answers
117 views

Using PHP arrays in Javascript Drupal 7 [duplicate]

I've been stuck on this all day and I haven't been able to find an answer that solved my issue: I need to make a PHP variable available in my Javascript file. Currently I'm using a fetchMarkers.php ...
1
vote
1answer
99 views

Responsive Views-Slideshow Json Cycle working good in Chrome not in IE or mozilla

In drupal I AT themes, views with slideshow of json2 and cycle plugin. I set the options for the plugin like this : Make views slideshow responsive - remove inline styles height auto , width auto ...
0
votes
1answer
17 views

Setting Tax Included on Commerce via JSON Service

I want to set the value of the tax included field (in database commerce_price_data) via Services (REST) talking JSON. I found modules helping doing this when adding the products manualy to set the ...
0
votes
0answers
34 views

Feed importer different node from each element

i am having some issues with feed importer. I am trying to create two different nodes from a JSON with feed importer. For example i have the following JSON and i need to create a "HOME" titled node ...
1
vote
1answer
218 views

How to return JSONP from a menu callback

I can create JSON output using a menu hook using the drupal_json_output callback. Example: $items['page/%/json'] = array( 'access callback' => TRUE, 'page callback' => ...
0
votes
1answer
121 views

Drupal fullcalendar integration -> JSON Formatting?

I am working on a custom fullcalendar (http://fullcalendar.io/) implemenation for a custom module of mine. I have created an hook_menu that will provide the json output that contains the events that ...
0
votes
0answers
53 views

why is my simple node Service returning views.exposed_data

my simple Services endpoint uses the Views 3 & JSON data document settings in this screenshot: at least a few days ago the structure was simply... {}{ "nodes": [{node:{},..], "view": { ...
0
votes
0answers
23 views

How do I know how many items are on a page for a json object

Im trying to make a view that contains JSON data for a list of articles in another view. I have all the data about every article but I also want to add the number of articles per page and the total ...
1
vote
3answers
177 views

Reducing Number of Fields in Content Type

Context: I have a product content type on Drupal 7 with >100 fields, and there are >7000 products, all with several revisions. Our client keeps requesting that we add and remove fields, which is ...
0
votes
0answers
51 views

Custom register form and default register form

I have a custom module that alters the default form. It's a multistep form, lot more other details, web service xml posting and getting details etc. The thing is here, now I'm using the Services+REST ...
0
votes
0answers
21 views

token does not work in upload directory of webform

i'm using service modules for generate json data , ve it's done in json data image data is inserted but i want to insert image url in json , how can i do this ? thanks for your helping
0
votes
0answers
47 views

I want to display feeds in JSON?

I am using aggregator feeds.I have to created feeds.xml file. But i have to create JSON file for Drupal 7? How to create it .Anyone guide to me.
0
votes
0answers
20 views

Json Populated Select Boxes 'An illegal choice has been detected' [duplicate]

I'm dynamically building the select options using json. When the user submits the form they get 'An illegal choice has been detected'. I know this is because I populated the options outside of ...
0
votes
1answer
105 views

RESTws POST List (text) field type Error

I'm using RESTws and POSTing a JSON object to "/node". Everything works fine until I include a List text field (checkbox type). The field in question is: ... "field_days_closed_v": ["Monday", ...
0
votes
2answers
77 views

How to insert HTML that includes an ampersand>

I've created a custom block, and I'm trying to get this custom block to output a specific piece of HTML. The HTML needs to be different on every page, because it needs to include the page's URL in it. ...
0
votes
1answer
77 views

Dealing with compressed JSON string from external API

I'm trying to call the Stack Exchange API but it sends compressed JSON strings and I can't uncompress it. $request = ...
0
votes
1answer
69 views

Drupal Json Output strange characters when pulling from other language

Hi Fellow drupal experts, I have a problem, I developed a custom page intended to do a drupal json output : and here is the code : function blogpull_menu() { $items = array(); ...
2
votes
2answers
78 views

Using migrate with a multi-page / paginated source

I have a working module pulling a JSON feed into Drupal using the Migrate module. However, the feed is paginated, and I am only getting the first page of results (ordered DESC on creation, so giving ...
0
votes
3answers
234 views

custom block menu path returns json Ok, but a 404 status header

I created a custom path via hook_menu with a page callback to a function that prints json. It all works in the sense that requesting: http://cms.tripchi.com/tripchi/getme returns my JSON, but the ...
0
votes
1answer
336 views

Drupal Services 3 Post new node with Image Field and Entity Reference (returns status 200, nid:null)

I'm trying to create a new node using Drupal 7 + Services 3. The node type is 'activity_photo' has an image field, and a reference to a node. This is what I'm posting to the service { ...
0
votes
2answers
653 views

How to receive JSON data in controller with Drupal 8?

I'm using AngularJS one of my module's settings page, so I have a javascript object in client side as a model. Could anyone help me please, how to catch this data in a controller if I send it as JSON ...
0
votes
0answers
107 views

RESTful web services 500 or 406 Error when “£” is in a value

I'm using RESTful web services and Node.js to export a Mongo database into Drupal. This is working fine, however I get the occasional 500 or 406 error. I've narrowed it down to a "£" sign. In node I'm ...