JSON, or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.

learn more… | top users | synonyms

4
votes
1answer
57 views

JSON.deserializeUntyped returns “unrecognized token: 'NULL'”, when JSON token has a null value

We're creating our JSON responses to my salesforce callouts in house, so I'm guessing the issue has to do with how we're representing NULL in the JSON response. Here's a snippet of the response SF ...
1
vote
1answer
28 views

How do I refresh an ExactTarget token using the REST API?

How do I refresh an ExactTarget token using the REST API? Is there any good documentation on this?
1
vote
2answers
25 views

Using a variable for a field name in Json stringify

var payload = JSON.stringify( {"Name__c" : data[i].name, "Email__c" : data[i].email } ); How can I do the above one like below. var nameVar = "Name__c"; var payload = JSON.stringify( ...
3
votes
1answer
75 views

Most efficient way to transform AggregateResults to String, Object Maps

Question: What is the most efficient way to transform aggregate results to string object maps? Constraints: The keys of the aggregated results are unknown. The transformation has to be performed as ...
6
votes
2answers
148 views

Parse JSON into Lead

I'm trying to parse a JSON response and create Lead records from it. The JSON is basically formatted as follows. Note, that this is not the complete data being parsed but is the general format of ...
3
votes
0answers
32 views

JSON.serialize alternative which support more objects like HttpRequest or Schema Describes

Often I need a easy and robust way to convert huge nested data structures into an string. Mostly for dumps, logs and debug. JSON.serializePretty() comes close but does not support all Object types ...
0
votes
0answers
18 views

Tracking Triggered Event on Exacttarget

How can we track Fired Event of Journey Builder? We are firing an event via JSON (insert data, evaluate and send email) and getting "{\r\n \"eventInstanceId\": ...
4
votes
2answers
61 views

JSON.DeserializeUntyped: Can I infer anything from the Object returned?

Given a JSON response from a remote API call, I can use JSON.DeserializeUntyped to get an Object, which can then be cast to another type as needed. For example: String jsonResponse = makeAPICall(); ...
3
votes
2answers
155 views

Simple way to generate object from JSON that return from Google Geocode API?

I receive JSON file from Google API Geocoding.Refer to JSON file here.Is there any other easy way to extract the data from this JSON in Apex?I want to retrieve a state value and result status code ...
5
votes
2answers
140 views

replaceAll() \r\n in a JSON serialized string

I can't get replaceAll to work on the '\r\n' sequence in a JSON serialized string. I am serializing a Map object that contains long textarea fields with newlines. I need to change '\r\n' to '\\r\\n' ...
5
votes
2answers
102 views

How can I serialize an object to JSON without properties that are null?

To communicate with a REST interface on a private system, I need to send a JSON message from a trigger. I have a message object that has some fields, lists and a child object: public class ...
2
votes
0answers
33 views

How to set sort order for report called by analytics api using json/ajax

i try to change the sort order of a report called via analytics rest api. For grouped reports there are sortOrder attributes in the grouping section, but i have to call a tabular report. If i call ...
2
votes
1answer
40 views

can exact target connect to a 3rd party web service?

Can exacttarget be configured to connect to a 3rd party webservice returning a JSON object? I guess there are two questions: - can I cause exacttarget to connect to a 3rd party webservice to populate ...
1
vote
2answers
68 views

How to construct the nested JSON

I am using following code and could you please let me know how to construct the nested json. public String getJsonString() { String str = null; JSONGenerator gen = ...
1
vote
1answer
156 views

How to make the context menu for the below code.

I would like to construct the tree view using the JSON with Two object(Account & Contact). root node is the account id and sub node would be the contact(nested level). Treeview: ...
2
votes
1answer
81 views

Parsing JSON with nesting and Arrays

I'm kinda of new to APEX code and working with JSON and I'm trying to figure out how to parse out nested JSON with Array's. This is a basic pattern of the JSON we have coming into our custom field ...
0
votes
1answer
135 views

How to create new record from jstree using json

I would like to create the record from the jstree using context menu. Please help to resolve my issue: My Code: contextmenu : { "items" : function (node) { ...
1
vote
1answer
86 views

JSON Deserialize Byte Array

I'm porting over a rest client from .NET to Apex and in the class that gets initiated by deserializing the JSON response, there is a byte[]. C# Example: public class MyResponse { public ...
0
votes
0answers
32 views

StreamingAPI response has error

I have StreamingAPI it working properly.It some time response has error at the time response JSON Object as error.The log file response contains error below Wed May 15 08:33:07 MST 2014 : Waiting for ...
4
votes
1answer
114 views

Can AMPScript parse JSON?

Using ampscript to parse an XML feed. Client is switching to JSON. Is there something similar to buildrowsetfromXML for JSON in AMPScript? I am confined to using the members login area and not an ...
4
votes
2answers
211 views

JSON.deserializeUntyped() not parsing the whole JSON

I am trying to parse a complex JSON String using JSON.deserializeUntyped(). It parses the first level elements correctly but the second level elements come back as type ANY, even though I am expecting ...
2
votes
1answer
70 views

Giving new field names in wrapper classes for JSON deserializing

Here is the JSON structure: { "public_index": [ { "index": "wiki_eng", "type": "content" }, { "index": "wiki_fra", "type": ...
3
votes
1answer
72 views

How to remove attributes before JSON is sent from Custom REST Apex?

I get back JSON like the following: { Id = a0Ef0000002TPKVEA4; Name = a0Ef0000002TPKV; attributes = { type = "Market__c"; url = ...
4
votes
2answers
592 views

JSON Exception unexpected character

I am doing a callout to a google script which takes in address and returns back geographic information (lat, lng etc) in the form of JSON string. The problem is that in the returned JSON string " is ...
10
votes
1answer
102 views

Comparison fails when converting Opportunity from/to JSON

I am facing an issue when converting an Opportunity to and then from JSON. If I put that in a test, the assertion fails when comparing both Opportunities. Here is my code: Test case: static ...
0
votes
1answer
291 views

How to Using JSON with visualforce

I'm new on visualforce and JSON, and I have a page that have many inputFields want to insert them by clicking on save, and get them back on click on edit button for example, I searched on google for ...
0
votes
1answer
154 views

possible ways to insert multiple values of the same field

I have an Object with RecordNum, RecordVal, And User__id as a reference .. and a VF page as the following <apex:pageBlock> <apex:inputField value="{!Object.RecordVal}" label="val 1:" ...
3
votes
2answers
178 views

How to retrieve just the text without formatting from a rich text field using JSON?

I am querying a rich text field that contains text information using a public rest service using this method ...
2
votes
2answers
70 views

How get all objects and their fields as Json

By means of Schema.getGlobalDescribe.Values () getDescribe ().getName () can receive names of objects.With Using method getDescribe().fields.getMap() we can get fields of object. It is necessary to ...
3
votes
2answers
168 views

My custom REST endpoint is returning double encoded JSON. How can I make it stop?

Here is my current controller: @RestResource(urlMapping='/monitor') global with sharing class TheController { @HttpGet global static String doGet() { Map<String, Object> ...
0
votes
1answer
348 views

How to get Json response without rest api and parse the response in objects

I need to get json response and parse the response into the object(Without using http callout).I need to have application(class) which can get response from other callback url and parse that response ...
5
votes
2answers
211 views

JSON.serialize is mucking with my datetime objects. How do I fix this?

I feel that the following assertion should be true, but it is not: DateTime testDate = DateTime.now(); System.assertEquals('"' + testDate.format('yyyy-MM-dd\'T\'hh:mm:ss.SSS\'Z\'' + '"'), ...
2
votes
2answers
355 views

Apex Rest JSON serialization Error: Invalid type for Http* method: …Map.Object

Background I'm developing some generics apex web service (Rest). The response should be an standardised json schema like this: { "res": true, "message": "Records Upserted Ok", "data" : ...
2
votes
1answer
83 views

How do I test cover simple JSON creation in a trigger?

I have an contact after trigger which collects data from Contact, add some personal, authentication pairs, and updates a 3rd party system. While the insertion of account/contact in the test class is ...
5
votes
2answers
4k views

How to properly use JQuery Datatable sAjaxSource with Apex providing JSON source

I'm trying to use sAjaxSource with server side processing from Apex class which will provide JSON as source. First I was trying simple example, which won't work and won't output any error (not in ...
2
votes
1answer
170 views

Transform JSON with lists inside into form data in Apex

Is it possible to serialize this JSON to Form-data in Apex? The JSON we received: [{"vendorcode":"4444","startDate":"2014-03-02","client":[{"name":"John"}]}] We need to serialize it to Form-Data, ...
5
votes
1answer
213 views

How to JSON.serialize an opportunities line items?

How can I JSON.serialize an opportunities line items? I need to create a single json file, that holds an oppty as well as it's line items. If I just JSON.serialize(opportunity), I get all the ...
0
votes
2answers
155 views

How to update an Account field value from an External Service after a future call

I am integrating Salesforce with an external ERP system. The create/update of accounts in SF, requires that I update/create them in the external system, and also keep the External's ID, within my ...
5
votes
1answer
322 views

With JSON - How to serialize the Account's Shipping and Billing Address?

I want to serialize just the Address object (lets call it an object) of Account (and Contact as well) Is there a way to access the ShippingAddress/BillingAddress of the account using the ...
1
vote
1answer
125 views

Getting signed request inside an Apex class

How do i get a signed request field inside of an Apex class ? I mean in .Net I can get it like this: string signedRequest = Request.Params["signed_request"]; Is there a similar "Request" object ...
4
votes
3answers
3k views

JSON and escaped double quote

I'm currently making a callout to a 3rd party vendor and I'm getting a huge response. What is currently messing me up is this section: "MessageSeq":13,"Description":"config file: ...
0
votes
1answer
250 views

Using JSON to parse Rally rest api service results

How do i use JSON to parse out the following result i get back from Rally's web service api. {"QueryResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": ["It is no longer ...
1
vote
2answers
369 views

Editing a Static Resource via Apex with Metadata API

I have recently found a way to create a Static Resource via the Metadata API - see this article. So, I was curious if it was possible to not only create a static resource, but to either: Edit the ...
3
votes
1answer
566 views

parse JSON into Object

I am trying to parse the following JSON format into a Object. { "info1": "blah blah", "info2": "blah blah2", "info3": 1391673663, "info4": "blah4", "info5": { "AAA": 0.1, "BBB": ...
2
votes
0answers
73 views

Streaming API notification payload

My SF account (PE with API) doesn't return the "sobject" fields in streaming API notification that it should. I'v tested with a free developer account, and it works fine there. I create a push topic ...
5
votes
3answers
843 views

Deserialising a JSON response [duplicate]

I am trying to deserialize a JSON response. public class CLiveExMarketPriceHistory{ public String lwin11; //11227502005 public String lcurrency; //GBP public String priceFrom; //2013-07-12 ...
13
votes
2answers
441 views

What are the different capabilities between the @RemoteAction serializer and JSON.serialize?

I've been working quite a bit with @RemoteAction methods and have noticed there seem to be a few inconsistencies between what's allowed in the apex JSON.(de)serialize methods and what the automatic ...
2
votes
1answer
100 views

JSON.serialise give output with escape charater

I am doing this: JSON.serialize(payload); where payload is an object instance. and getting this: ...
3
votes
1answer
289 views

Unable to deserialize json data accessed from salesforce object in asp.net

I need to access data records from salesforce object. I got the json response.The json document is given below, { "totalSize":2, "done":true, "records": [{"attributes": { ...
5
votes
2answers
181 views

Apex - Displaying a nested list after deserialising json

I would like to make a http callout to import json and display the information in a visualforce page. The problem I'm having is that the json is nested and so I need to loop through the child nodes. ...