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

1
vote
0answers
13 views

OAUTH 2.0 JWT How can I access request from client side to send JWT token to client application.

I am very new to the Oauth spec. I have done a lot of research but could not find the answer to what I should do. My task is currently my client application is using Salesforce as OAuth provider. So I ...
0
votes
2answers
34 views

How can I create this JSON structure using inner classes?

I am trying to create a JSON payload in a VF controller to send to middleware. I tried to use JSONGenerator.writeStringField(String, String) but kept getting error: "Can not write a field name, ...
0
votes
0answers
17 views

Creating JSON objects in SSJS

I am trying to create a JSON object from a DE as follows and the payload is always empty. Is this the right way to do this? Can I get some help? <script runat = "server" > ...
1
vote
2answers
32 views

How to save bulk data with some conditiond

i want to save following JSON data to "myObject__c". suppose i have already "test1@gmail.com" and "test3@gmail.com" in my salesforce object. So how can i save following data in "myObject__c" except ...
3
votes
1answer
120 views

Unable to parse large JSON in APEX

I have 52 keys and pairs in my JSON data, and I want to parse it, but the APEX method only supports 35 arguments to the method. Then how can I parse large JSON data with the APEX class? My JSON is: ...
0
votes
1answer
34 views

JSON Parser show: Expected WooProductModel.Image but found [line:1, column:2491]

I am trying to parse a JSON response from my own site. All the fields are populating with the exception of images. Not sure what I need to do to get the images data. Any help is much appreciated. My ...
1
vote
0answers
45 views

How to Convert data From CSV to JSON?

I am trying to create a Records from CSV File to Custom Object. This is my Method public Pagereference ReadFile() { NameFile1 = EncodingUtil.base64Encode(contentFile); ...
0
votes
1answer
30 views

Scheduled Apex Class Testing Issue

I am trying to test a scheduled class in apex, but upon running the test method it gives me the following error: System.JSONException: Unexpected character ('0' (code 48)): was expecting ...
0
votes
0answers
41 views

Json Deserialization failed on token … and has left off in the middle of parsing a row

I am getting this exception when parsing JSON that was generated via json.serialize(trigger.new): System.JSONException: Json Deserialization failed on token 'a0Po000000B12345678' and has left off in ...
1
vote
1answer
30 views

How to deploy JSON codes in Email?

I need a help for the project I am working on. I have task that we have to display ads from third party server in email; when email is being render on client machine. Third party company who sources ...
1
vote
0answers
52 views

How does Guide Template Language parse a straight JSON array?

I'm learning Guide, and I've been able to parse an array of objects... AmpScript: set @json = '[{"voucher":"123456789"}, {"voucher":"234567890"}]' Guide: {{.dataobject JsonVar type=variable ...
3
votes
2answers
42 views

Unable to Set Created date even after enabling Set Audit Fields

This is a Follow up question to this. What I am trying to do is set the createdDate field in Account record using the below code as suggested by cropredy. I have enabled Enable "Set Audit Fields upon ...
1
vote
0answers
25 views

JSON Post via Apex - PKIX path Building Failed - What am I doing wrong?

This is my first time attempting a JSON POST and I trust your collective judgement. I would appreciate if someone could tell me if I am approaching this correctly or not. I didn't receive any compile ...
0
votes
0answers
53 views

How to implement pagination here?

This is controller where I have queried for listview with out using setFilterId method and I am getting the records according to listview values but pagination is not working public with sharing ...
2
votes
1answer
37 views

Assignment rule always auto fire with no reason

I got a project which needed to setup an public community as an endpoint to receive JSON messages (URL post method). My community home page got a restful apex class to receive message and process it ...
0
votes
1answer
48 views

Parse Json string to Salesforce object? [closed]

How to map json string with salesforce object(consider Lead)??
0
votes
0answers
19 views

How to get oauth2 access and refresh tokens in JSON format

Problem I am trying to connect to an external api using oAuth2, and at the moment have the following code I am running from the Execute Anonymous Window. I keep getting a 401 error and I think the ...
2
votes
2answers
111 views

Processing a json api response using JSONParser class

I am new in using JSONParser class, I am struggling a bit to understand how to use it. The string that I want to use this, is a reponse from an API call, it is a really long string (about 5.4 million ...
1
vote
1answer
149 views

System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set while deseriliasing json Payload

> I have resolved the issue updating answer for my own question thanks for response Stack-exchange great help everytime : > > > 1.Malformed JSON: Expected '[' > > ...
1
vote
0answers
25 views

I am getting the Error during creating the JSON to APEX?

public class etTemplateNew{ public String contactId; //003m000000PM2HrAAL public Integer requestId = 0; //1 public cls_templateAttributes templateAttributes; public String ...
0
votes
1answer
49 views

Json parse in emails with ampscript

Im trying to parse some weather json data in my email. But I cant quite fiqure out the syntax. With this code I'm trying to get the main.temp value printed. Below is my code so far, but it dosnt work ...
9
votes
1answer
240 views

JSON: Cannot deserialize instance of date from VALUE_STRING

I'm officially breaking up with Salesforce Date parsing. This has got to be the most frustrating thing. I have the following date in a JSON string (full JSON below): 2017-06-03T10:34:24.000Z ...
0
votes
0answers
16 views

MobileConnect: REST API Linebreak

I am attempting to trigger a MobileConnect message via REST API (and PHP) that includes a linebreak (uses \n). However, I haven't been able to successfully get the linebreak to generate. An example of ...
1
vote
0answers
16 views

save data from apex class generated from J.S.O.N response [duplicate]

I have got a JSON response from external system which consists of some data which need to be saved in sales force. Now I have de-serialized the JSON data to apex class using some tool. and how do ...
1
vote
1answer
41 views

Complex Json deserialize using JSON.deserializeUntyped

How to de-serialize following array of response from the url??I have to pass time stamp in the URL as follows:Tried Json to apex too but as it is post method can't use that. String startdate= ...
0
votes
0answers
43 views

How to serialize JSON with apex wrapper class?

public class etTemplatePR { public String toAddress, templateId, contactId; public Integer requestId = 0; //public tAS[] templateAttributes; Map<String, String> jsonStr = new ...
0
votes
0answers
17 views

How to create a JSON serialize key and value with MAP functionality [duplicate]

public class etTemplatePR { public String toAddress, templateId, contactId; public Integer requestId = 0; public tAS[] templateAttributes; public etTemplatePR(String toAddress, String ...
0
votes
1answer
54 views

Wave Analytics Data Flow Change Column names

I'm using a dataflow to bring in Salesforce record data but I would like to rename the columns in my dataset from their Salesforce API name ("SAP_Territory_Name__c") to another name ("Territory"), not ...
1
vote
2answers
56 views

How To Generate JSON Request Body from Wrapper Request Class

I am writing a REST Service and have created Request and Response Wrappers, Finding it difficult to generate the JSON Request Body out of the wrapper classes. Below are the Sample Classes. public ...
0
votes
1answer
37 views

calling PriceBookEntry from Javascript

After reading tons of links, posts and many documents, I decided to ask for help here, hopping some guru can help me with this issue: <!-- Visualforce Remote object component for Products --> ...
1
vote
1answer
44 views

Rest API with JSON using Integration

I have created 3 classes. APex Class Callout Class JSON Parser Class In that "apex class" I'm calling the JSON class. It shows the error"Invalid type: templateAttributes1" Line number 29. Please ...
1
vote
1answer
16 views

Error: report filters

problem, i try to dynamically filter a report but i get an error. The apex code to set the filter dynamically based on some conditions: filtre ='column:\'account.name\',operator:\'equals\', ...
0
votes
0answers
21 views

update object from web application integrated via canvas app

I integrated a canvas app in a visual force page, and this page in an account page layout. I want to update the account record with data sent from the web application, how to get the context in the ...
2
votes
1answer
55 views

JSON.deserialize with arrays with one to many elements

I am consuming a REST service with APEX. Here is a response sample: { "createQuoteOutput": { "response": { "quoteNumber": 945, "temporaryQuoteNumber": "T8652" }, ...
1
vote
1answer
24 views

JSON String test class

I am using a json string like this in a test class. [{ "id":"01t4B000000XrvhQAC", "name":"abc123", "DateRange":{"startDate":"2020-02-17","endDate":"2020-02-26"} }] Now instead of hard ...
2
votes
1answer
45 views

How Can I Ignore Unknown Json Properties in Apex

I'm doing a web service call, and parsing the json response into a wrapper object for display on a Visualforce page. My wrapper object looks like: public class CustomerAddresses { public String ...
2
votes
1answer
63 views

Guide Template Language to provide dynamic links via href attribute from JSON

I'm using GTL to parse a JSON attribute coming from a Data Extension. Everything works fine except links in href attribute. For some reason/limitation they don't render in the href attribute. I was ...
0
votes
1answer
46 views

JSON: how to declare an attribute whose name contains $ symbol? [duplicate]

I have written apex class.variable declaration is: public string QPA$MV2 {get;set;} It shows error: Error: Compile Error: Invalid identifier: QPA$MV2 at line 254 column 23 How to resolve it ? ...
0
votes
1answer
47 views

Getting error while sending/serializing JSON object to update

From Salesforce I am trying to make restful api call to a CPQ system. I am able to make a login (POST request) I am able to query the Account object & retrieve the id & fields on the ...
1
vote
3answers
39 views

JSON Opportunities and OpportunityLineItems garbled

I am trying to POST Opportunity with OpportunityLineItem data to an endpoint. I can get the opportunity data just fine but I am having a lot of trouble with the OpportunityLineItems and I feel myself ...
0
votes
1answer
56 views

unable to deserialize salesforce attachment, exception thrown

Attachment a = [ SELECT Id, Body FROM Attachment WHERE Id='00Pi000000ZdBqv' ]; String jsonStr=JSON.serialize(a); Attachment b = (Attachment) JSON.deserialize(jsonStr,Attachment.class); ...
3
votes
1answer
188 views

Standard REST de-serialisation fails: Unexpected parameter encountered during deserialization

Consider the following class: public class Caps { public Sett SETTINGS {get;set;} } public class Sett { public string foo {get;set;} } When I POST the following JSON: ...
0
votes
1answer
40 views

Retrieve all objects and field attributes in json

I'm totally new to Salesforce, and was asked to provide a json result set with all objects, their associated fields (standard and custom), as well as all field attributes (name, id, type, etc.). My ...
2
votes
1answer
40 views

Serialize JSON attribute that is a reserved keyword in Apex

To use the Javascript tree library DynaTree on my Visualforce page I create JSON data in its controller List<DynaTreeNode> rootNodes = nodesByParentId.get(null).values(); dynaTreeJson = ...
6
votes
1answer
369 views

Why is String.valueOf(Blob) different that Blob.toString()?

I am working on a REST Service that will desiralize the request body and interpret it. My understanding was that calling String.valueOf(objectInstance) would just call objectInstance.toString(). ...
2
votes
2answers
53 views

Creating an Apex Rest Resource for a Request with reserved keywords

I am working on an Apex Rest Resource to provide an integration from our scm provider's web hooks. The request sent by the scm provider is in JSON format so I have created an Apex class to mirror that ...
0
votes
1answer
65 views

How to convert json-formatted records to object records?

Hi I am trying to insert lead records these records in json format. i tried like this: List<string> first = new List<string>(); list<string> last = new List<string>(); ...
1
vote
2answers
84 views

System.JSONException: Unexpected character ('0' (code 48)): was expecting comma to separate OBJECT entries at

This is my apex code public PageReference find() { HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); String url = ...
1
vote
1answer
122 views

Illegal Value for primitive when trying to parse the json data

I am facing the issue like "Illegal Value for primitive" when trying to parse the json data.Below is the Json Response which i get from a service. [{"revenue": {}, "emails": [{"grade": "A+", "type": ...
0
votes
2answers
118 views

Parse JSON string in AMPscript

We are currently passing a string attribute via the REST API that contains JSON. { "User_List": "[{\"name\":\"john doe\", \"email\":\"john.doe@mail.com\"}, {\"name\":\"jane doe\", ...