Skip to main content

Questions tagged [httpresponse]

Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

How to set the values for Permissions-Policy for custom Force.com site

How to set the values or enable Permissions-Policy for custom Force.com site ? We have one custom page build on force.com platform, upon doing the penetration testing we are getting below result ...
neel saha's user avatar
0 votes
1 answer
295 views

External WS is returning response with characters �+du� in Salesforce

When i consume an external ws, this response with especial characters like this: '�+du�רfz�B' But Response in Postman its a valid Json without especial characters Headers in postman Request and ...
Daniel Castillo's user avatar
1 vote
1 answer
700 views

How to handle http callout response to create records in Flow Builder?

I created a flow with an http callout action which is working fine to get data from my external system as I am receiving data as a reponse. It looks like this: Flow But now, I want to create ...
iggy1977's user avatar
1 vote
1 answer
626 views

HTTP Callout action in flow returns internal server error 502

I am first time trying out the HTTP callout action inside of the flow. I have added a query string parameter called content and ran the flow using the debug button. I see the expected response but ...
sumchans's user avatar
  • 887
-1 votes
1 answer
381 views

I am downloading the attachments via REST API in postman. I am getting response as below but I would like know which format it is?

We are providing service to a external system, they need to convert the response to a .xlsx file. They are asking about the format.can any one help me in this?[
KCompany's user avatar
1 vote
2 answers
673 views

Bulk API Query Job in Apex with big response

I have a task to query a million records from one org and then upsert them in another org. I use a Bulk API query job to get all records. HttpRequest request = new HttpRequest(); request.setEndpoint('...
Marina's user avatar
  • 19
0 votes
1 answer
136 views

Reply to Trustpilot Review Service Reviews API returning 400 Bad Request

This is my code in Salesforce HttpRequest req = new HttpRequest(); req.setEndpoint('callout:TrustPilot/private/reviews/'+reviewId+'/reply?token='+token); req....
Bestina Rajasingh's user avatar
1 vote
1 answer
2k views

How to check if a http response is null when it is an empty object and status code is 200?

Im making a POST to an endpoint and this is what I get back in my response, its a successful POST and the status is 200 but the payload is empty. { "payload":[], "datetimestamp"...
potato46's user avatar
1 vote
0 answers
577 views

How to set the statusCode and message of a rest api call from an autolaunched flow?

I have an autolaunched flow that I'm invoking with a rest api call. Here's the sample code that shows how I call my flow from an express.js server. var _request = { url: '/services/data/v54.0/...
Bahman.A's user avatar
  • 928
0 votes
1 answer
306 views

How to prevent user from re-clicking a button to submit input fields until API sends a response to a Callout?

There is a Salesforce UI built using Visualforce and Lightning Aura Framework. There are 3 input fields. On clicking of a button we want the values of the input field to be sent to an external API and ...
Amax1's user avatar
  • 121
0 votes
2 answers
76 views

Retrieve data from 2nd SF Org

I'm making a SF org where i need to retrieve data from a 2nd SF org. I have created Connected App in my Source Org, and i have created Auth. Provider and Named Credential in the Portal Org (that the ...
JonasH's user avatar
  • 1
0 votes
1 answer
1k views

How to replace multiple reserved attributes in JSON response in apex?

My JSON response in my apex class has a reserved keyword and couple of other supported names, I have been using the following getData = (infos)System.JSON.deserialize(res.getBody().replaceAll('"...
Cathy's user avatar
  • 73
0 votes
1 answer
4k views

HTTP response content showing null value when using Script.Util.HttpRequest

I'm trying to create an SSJS script that can store the values in the marketing cloud's database using the Script.Util.HttpRequest method. When I try to print the HTTP response content, I get a null ...
Harshit Singh's user avatar
1 vote
1 answer
609 views

REST Request is rejected since Winter 23 hit the preview enabled sandbox

REST Requests seem to be rejected by SF since Winter 23 hit our preview enabled sandbox. Below sample code runs (run on Exec. anonymous) smoothly in v54 sandbox, but fails with below error in v55 (...
Pasan Eeriyagama's user avatar
1 vote
1 answer
1k views

Parsing HTTP JSON Response [duplicate]

I'm pretty new to Salesforce/Apex and I'm trying to extract the information I need from the HTTP API call I make to an external system (like Piwik.pro) and store in list or a map. I want to get all ...
Stojchesky's user avatar
1 vote
1 answer
732 views

how to fetch and store http response coming as object(not sobject) [duplicate]

I am fetching these(Actors, awards, genre, lanuage) details from htpresponse "results" of an api. But these values are coming as object. I want to show these values on Salesforce UI. since ...
vchitlangia's user avatar
0 votes
1 answer
720 views

LWC - Checkbox json data response help

So, these are the checkbox that I'm testing. What I have - A function that are associated with uncheck/readonly, and some of my json catch response try. What I need to do - I need to catch the json ...
Ian Lee's user avatar
  • 137
0 votes
1 answer
885 views

Parse multipart/form-data response in salesforce

I want to parse multipart/form-data response in salesforce using apex, my response sample is below. do I need to parse it with some algorithm or there is any built-in library or method available. -----...
shajji's user avatar
  • 111
0 votes
1 answer
837 views

Salesforce Apex Api is Returning response with Escape Character

Salesforce Apex Api is Returning response with Escape Character in Postman public class ResponseWrapper{ public string id; } ResponseWrapper responseWrapper = new ResponseWrapper(); ...
user3444999's user avatar
0 votes
1 answer
438 views

Getting this error "System.JSONException: Malformed JSON: Expected '{' at the beginning of object" due to response body , pl help me if anyone knows [duplicate]

We are getting below Json format as response and storing into Respbody variable . But when we are deserializing that we are getting below error: error : System.JSONException: Malformed JSON: Expected '...
Nagarjuna's user avatar
0 votes
2 answers
124 views

System.CalloutException when doing HTTP response [duplicate]

I keep getting System callout error when updating a contact field for multiple contacts. System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out ...
Ken Maranion's user avatar
0 votes
0 answers
495 views

String concatenation of endpoint modify the comportment of a Get request

string id = '12345'; // will be set dynamically string endpoint = 'https:/sameEnpoint/leads/' + '12345'; //opt1 string endpoint = 'https:/sameEnpoint/leads/' + id; //opt2 string endpoint = 'https:/...
Jojosfdc's user avatar
  • 467
0 votes
2 answers
4k views

Missing return statement required return type: System.HttpResponse

I'm going through this trailhead module and, as a good newbie, I'm experiencing some issues in completing the hands on challenge. This is my AnimalLocator class: public with sharing class ...
robruf's user avatar
  • 392
1 vote
0 answers
77 views

Parsing of Json response from Tooling API code [duplicate]

Please have a look through the attached debug log Below is my code:- Apex Class:- Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint(Url....
SFDCTashan's user avatar
0 votes
3 answers
931 views

How to manage both single and an array of json reponse from the same external system?

I have a situation where when I make a callout I get a single json response like this: { "Person": { "Infomration": { "IndividualInformation": { ...
nSv23's user avatar
  • 554
1 vote
1 answer
1k views

Make HttpRequest Callout to send binary data without corruption

I faced issues when tried to send binary data from Salesforce to external web services. To start with, I tried to send binary data from Salesforce to itself. I am trying to read binary data from valid ...
Patlatus's user avatar
  • 17.8k
0 votes
2 answers
1k views

How to handle null keys in JSON response?

I have a json response class like this: public with sharing class Response { public Person person; public class Person { public PersonData personData = new PersonData (); ...
nSv23's user avatar
  • 554
1 vote
1 answer
3k views

SSJS: read response headers from Script.Util.HttpRequest object in SFMC

We need to retrieve the response headers from an HTTP GET call issued in SSJS with the Script.Util.HttpRequest function. Unfortunately, even though it seems straightforward and the task itself is ...
jackal992's user avatar
2 votes
1 answer
2k views

Details for function Script.Util.HttpResponse

Can someone provide example code for the function Script.Util.HttpResponse or point to a better resource than these help docs?
Will's user avatar
  • 194
0 votes
0 answers
40 views

Malformed Json Error on http request [duplicate]

Hey all I am getting an error and cannot for the life of me figure out why. Thanks in advance for help! Error is: Failed to invoke future method 'public static void pushToLead2(String)' on class '...
Johnie Waddell's user avatar
0 votes
1 answer
630 views

System.JSONException: Malformed JSON: Expected Error when try to deserialize json

When I try to deserialize the JSON response I am getting 'System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set' Json Response body is "[{\"ExternalId\":\"...
Anu's user avatar
  • 3,889
0 votes
1 answer
130 views

Problem with testing void HttpRequest

I can only get 23% code coverage with what I have. The http request in the method is not getting covered for some reason.. Here's what I've tried: Class: public class PostClientes { @...
Josue Rivas's user avatar
2 votes
1 answer
416 views

HttpPost method test will not run: Method does not exist or incorrect signature: void doPost() from the type MyOriginalClass

I have a test like below. and the error: Method does not exist or incorrect signature: void doPost() from the type MyOriginalClass In MyOriginalClass, the method has parameter like doPost(String url) ...
rosa's user avatar
  • 21
0 votes
1 answer
814 views

500 error Marketing Cloud API - Deleting Contacts

Given a successful authorization, the following API call fails with 500 POST /contacts/v1/contacts/actions/delete?type=keys Body: { "DeleteOperationType" : "ContactAndAttributes&...
cropredy's user avatar
  • 73.2k
0 votes
1 answer
80 views

Error Invalid Conversion from runtime JSON to APEX

I am getting an error while converting the response from JSON to Apex class. Invalid conversion from runtime type MapAPIDemo.resourceSets to List<MapAPIDemo.resourceSets> Here is the code below ...
Shantanu Mahajan's user avatar
3 votes
0 answers
2k views

Executing multiple callouts from a future method

I have a problem when I try to execute multiple callout from a method of an Apex Class. The method code is the following: @future(callout=true) public static HttpResponse makeCallout(){ List<...
Valentina's user avatar
0 votes
2 answers
4k views

JSON deserialize test

In normal runtime everything seems to deserialize correctly but when I try to run a test class it throws the following error: System.JSONException: Unexpected character ('r' (code 114)): was ...
Daryn's user avatar
  • 251
1 vote
3 answers
51 views

How do you map a HTTPResponse with repeating data

I am trying to map the response from an API call. The call is as follows: public Void Jetnet(){ String SecurityToken = JetnetAPI_SecurityToken(); HttpRequest req = new ...
Bradley Smith's user avatar
1 vote
1 answer
58 views

Capturing HttpResponse StatusCodes

I'm trying to capture a HttpResponse StatusCode in a @future method so I can then send it to an email to alert a dev of a possible issue and also alert the Salesfroce user of the error. I have found ...
Richard's user avatar
  • 165
0 votes
1 answer
2k views

Response to Http request - response

I'm making integration to an external system and send them a request, and I get a JSON as a response via REST API. The response has a lot of data to upsert to SF. While upserting the Data inside the ...
Salvation's user avatar
  • 1,209
0 votes
1 answer
2k views

how to query job batches info bulk api 2.0

Before, using bulk api 1.0 endpoint. I could make request to get all job's batches like so: ` req.setEndpoint('callout:BulkApi' + '/' + jobId + '/batch'); req.setMethod('GET'); req.setHeader('...
Master Przemo's user avatar
0 votes
1 answer
151 views

deserialize a JSON and modify a single attribute in the list of Object

I have a JSON string as below from a http response. { "agreements": [ { "agreementId": "ag0", "publishedDate": "04-03-2016 00:00:00", "AgreementNumber":...
Sisir's user avatar
  • 111
-2 votes
1 answer
3k views

Parsing JSON response giving null pointer exception

I'm trying to retrieve a couple fields from a json and put them into an existing account. Im starting out with just one account right now but would like to eventually pull a list of accounts and ...
Tyler's user avatar
  • 91
1 vote
0 answers
222 views

Failed to get success response in “application/json” using Name Credential

HttpResponse in “text/html” instead in “application/json” if using Name Credential Step1 : Name Credential Step 2: Authentication & Authorization Code RESPONSE header>>>>>: ...
Asif Khan's user avatar
0 votes
1 answer
952 views

Get data from multi level json string

I am getting some data in response to my code which is a JSON string as: HTTPResponse res = {"id":2048,"extension_attributes":{"stock_item":{"stock_id":1}}} Now to retrieve data, I've done Map<...
Anant's user avatar
  • 133
0 votes
1 answer
76 views

caseId property is not shown in response received from a external service to Salesforce [closed]

I am making a POST callout from salesforce to another service and case is one of the objects of JSON which i am sending (see below) "case": { "caseId": "00000212", "status":"", "statusReason"...
SunnyG's user avatar
  • 421
1 vote
0 answers
103 views

Getting an PDF from external webservice and store it as attachment creates empty pdf

I have to get a pdf from an external web service and store it as an attachment of an object. Im getting the pdf with the following code public override Blob getPDFReport(String token, String jobId) {...
DCaballero's user avatar
0 votes
1 answer
1k views

Bulk API 2.0 Close Request Failing - Cannot specify query parameters in the resource

I am doing a POC on the BULK API and have run through this trailhead: https://trailhead.salesforce.com/en/content/learn/modules/api_basics/api_basics_bulk where you call the BULK API through WorkBench....
MR.M.'s user avatar
  • 93
0 votes
1 answer
405 views

JSON response structure change

JSON response from the callout is changed. 1) Current JSON response : { XYZ { } DEF { } MNO { } } Now its changed to : { ABC_Stage{ XYZ{ ...
Manish Anand's user avatar
0 votes
1 answer
1k views

HTTP request to return a list of Contacts

I would like to change the following method within this class: public class ApexCalloutsDemo { public static HttpResponse makeCallout() { Http http = new Http(); HttpRequest ...
Andrea Voggenreiter's user avatar