Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [httpresponse]

The tag has no usage guidance.

0
votes
0answers
33 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 ...
1
vote
0answers
30 views

HTTP GET Response with 204 Status Code and blank Body [on hold]

I send Callout request to ActiveMq messages queue service to get messages form there and handle it in Salesforce. In the Queue there are 3000 messages. When I send the request from salesforce sometime ...
0
votes
1answer
20 views

Is a Request possible without a Response Status?

Utilizing a custom salesforce connect adapter, callouts are being made using the HTTPRequest and HTTPResponse classes. 40,000 requests to these webservices are being made and all but a few (2-5) are ...
0
votes
1answer
28 views

How to redirect to external url from apex from callout response

I have a class from which I do a callout in apex. After the response of the callout I want to redirect the user to an external url how can I achieve this?. I have only been able to redirect ...
1
vote
1answer
31 views

How to read the error from the response given by Salesforce

I have an api that has a catch method: catch (Exception e) { // Error System.debug('API - ERROR: ' + e.getMessage()); res.responseBody = Blob.valueOf('ERROR: ' + e.getMessage()); res....
0
votes
0answers
36 views

Can APEX Capture Cookies in Callout HttpResponse?

I'm trying to post data from my org to a third party using a REST API they've provided for us. The process for this is: POST client_credentials (client_id and client_secret) to obtain access_token ...
1
vote
1answer
693 views

System.StringException: Unrecognized base64 character: \

I am trying to parse the response body which is in "base64 content of a file" and trying to create the attachment with the body but getting error of " Unrecognized base64 character: \" I have included ...
2
votes
1answer
80 views

How to make HttpGet service pagination with a limit of a million or more?

Offset can take only 2000 records, but I need more. How can I send to the callout side 1 mln or more records with pagination and step of 100-200 records per 1 page? I mean when callout request for 100 ...
1
vote
1answer
232 views

How to use HttpGet service to get a list of objects and create them?

I have a callout method which helps to get an list of objects from another salesforce-organisation. But how can I convert this list into objects on callout's organisation side? And how can I do this ...
0
votes
2answers
48 views

How can I send an error from HttpPost to Callout if ExternalID is the same?

I still can't send to my Callout right status code. I have an Item object in Org2 that I can post from Org1 (in Org1 is Tool object that passes its fields to THIS (Item) object). Item has ExternalID ...
0
votes
1answer
33 views

System.NullPointerException: Attempt to de-reference a null object Error while parsing XML response

I am trying to parse the XML response and want to create the records only when url is present but when i am trying to create the record then i am getting the below error "Line: 83, Column: 1 System....
0
votes
1answer
35 views

How to send error from HttpPost to Callout if ExternalID is the same?

I have an Item object in Org2 that I can post from Org1 (in Org1 is Tool object that passes its fields to THIS (Item) object). Item has ExternalID field that takes the ID from Tool. How can I send an ...
1
vote
2answers
507 views

a way to return value from @future method

I have a situation where I have to insert data into a wrapper class and a bunch of objects to save in Salesforce first and then make an API call. As we know, salesforce will not allow us to make any ...
0
votes
1answer
89 views

Malformed JSON: Expected '[' at the beginning of List/Set\n\nClass.System.JSON.deserialize

Through the Http response I will get the output like below. [{"CourseType":"OnlineCourse","Id":"05f932c9-1059-4495-87d9-2e7a09bd3930","Name":"Fundamentals of Contact Lenses","Description":"This ...
0
votes
2answers
372 views

Retrieving csv document using HTTPRequest

I'm working on a project to retrieve/GET a csv file using an HTTPRequest update the associated Salesforce records, and POST a csv back I found this 'send a report as a CSV/TEXT' thread, which looks ...
0
votes
0answers
12 views

Response got error and inputfile has probelm

when i am uploading a file in google drive from vfpage response body got error message that 404 and for inputfile i have used actionregion but its showing error message on page that inputfile cannot ...
4
votes
0answers
72 views

API request/response codes when site is in read-only maintenance mode?

I checked out Read-Only Mode Overview but I'm still unsure of how our API will respond, particularly the response code. Will POST/PUT requests automatically return a 503 service unavailable or will ...
1
vote
2answers
592 views

HTTP POST callout not showing response body

I am making a HTTP POST callout from Salesforce. I am getting a HTTP 200 response code from the remote server but I am not getting the response body in the response. However, when I am using the same ...
1
vote
1answer
536 views

Having trouble deserializing a JSON string of Objects

I'm trying to handle a JSON response..the format it comes in is not the best but I can't change it..Ive used JSON2APEX and can access the object values individually but I need to loop through them ...
0
votes
1answer
189 views

How to serialize response in string? [closed]

I need to set a success response in a String. How can I serialize a response in string?
0
votes
1answer
51 views

Apex removes \n from HTTP Response

I am using google api. The expected response is { "responses": [ { "textAnnotations": [ { "locale": "en", "description": "ABBEY\nROAD NW8\nCITY OF WESTMINSTER\...
0
votes
0answers
114 views

apexREST post method - Call an external API and wait/check for success before returning apexREST POST success?

Background: Our company uses a billing system called Zuora, which integrates and syncs with Salesforce, to handle our customers subscriptions. This application (Zuora) also includes a custom Quoting ...
0
votes
0answers
799 views

AttributeError: 'HttpResponse' object has no attribute 'query'

We have a Django website that interacts with Salesforce custom object named Temp Contact (API: Temp_Contact__c). When I try to login to website, I receive this error in the terminal- AttributeError:...
1
vote
1answer
250 views

Http request not returning token through Apex

I am trying to communicate with an API through Apex, the parts of the API I wish to access require an access token acquired using OAuth 2.0. I have created a method that will access the endpoint and ...
0
votes
2answers
183 views

Latest API version in APex class

I have tried to get latest api version through /service/data . I have refered this link also Find current API version in Apex But when i used latest version in this : final PageReference theUrl = ...
2
votes
1answer
250 views

How to get raw response from .NET force.com toolkit when using QueryAsync

I am struggling to find out why my query throws an exception when I do a specific query. Is there a way to see the raw response from Salesforce or .NET? Query string in itemQueryString is running ...
0
votes
1answer
84 views

facing System.CalloutException for HTTP response in test class

I'm facing "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out" Here is my codes: (Adding only the relevant code) Callout Class which ...
0
votes
1answer
534 views

Writing a Test Class for AuraEnabled HTTPResponse Callouts

I am trying to write a test class for a @AuraEnabled Apex Class. But I can not get it to pass. The first thing is you can not return an HTTPRequest or Response to a @AuraEnabled Class so I can not ...
0
votes
1answer
270 views

Use the generated Session ID of website to fetch an ID of that external system through Apex class

I have below HttpRequest POST code where I can get in debug log the response from external system. I can see my required Session ID that needs to be used as Authorization to fetch further data from ...
0
votes
1answer
1k views

Displaying Json Data on Visualforce

{"QueryResponse":{"Item":[{"Name":"Concrete","Description":"Concrete for fountain installation","Active":true,"FullyQualifiedName":"Concrete","Taxable":true,"UnitPrice":0,"Type":"Service","...
1
vote
1answer
735 views

Callout response: Illegal character sequence in string literal

I got a problem that is driving me crazy. Hopefully you guys can help: I am trying to integrate the eKomi Api. For this I am doing a callout which returns the response System.HttpResponse[Status=OK,...
0
votes
0answers
305 views

Salesforce redirects the knowledge article URL in a Napiili Community to another version with 301 Status Code

I am facing a strange behaviour in a Community tailored with Napiili Template. The technical details of the community are: I have enabled 2 languages for my Community: English(UK)(knowledge default ...
2
votes
1answer
131 views

Downfalls to using HTTPGet() to see if an asset exists

I'm thinking of using the HTTPGet() function in the following Ampscript of an email... var @ItemId, @ItemAsset, @ItemAssetCall, @ItemAssetCallStatus set @ItemId = '1234' set @ItemAsset = ...
1
vote
1answer
508 views

JSONParser.getText() results in null but not interpreted as null in if statements

I am parsing JSON that has field 'next_page'. If this field is null, I do not want to enqueue another HTTP request to fetch that page. However, in this code, parser.getText() is debugging as null, ...
0
votes
1answer
285 views

cover httpRespone and if condition in test class

while calling method @isTest public class call_Test{ static testMethod void unitTest(){ uptodel.qTis(); } } its given error that Methods defined as TestMethod do not support Web ...
0
votes
1answer
2k views

HTTP POST Response Body is blank - 204 status

I've changed the endpoint url and the json payload for security reasons but let's assume that I've tested the endpoint using advanced rest client and with the same json in my apex code and it works. ...
0
votes
1answer
212 views

Marketing Email - HttpGet Ampscript with XML Response

I'm trying to configure an email in Marketing Cloud with the ampscript function HttpGet in order to retrieve a coupon from an external system. I've seen that the HttpGet could return these values 0 ...
0
votes
1answer
306 views

How to read HTTP Response values from Visualforce correctly?

I'm calling an external site from Visualforce and it's returning me a response as below (i.e. HttpResponse.GetBody() returned sting). <DtResponse RequestId="" ResultCount="1" ErrorMessage=""> &...
1
vote
1answer
135 views

Why do I get “method doesn't exist or bad signature”?

What am I doing wrong here? I have an ApexClass named SearchController, which starts with: public class SearchController and which includes these two methods: public void save_search_results(...
2
votes
0answers
134 views

pdf not downloading properly

I have these lines of code: public String getCoverPdf() { if(!String.isBlank(pdfLink)) { Http h = new Http(); HttpRequest req = new HttpRequest(); ...
1
vote
1answer
82 views

HTTP Request Ignoring Body

I have written a trigger that parses url's stored in a number of objects and requests them to see if they are still valid. private Boolean pollserver(string url, string referer) { ...
2
votes
0answers
44 views

Fetch Data of Different Organization?

I have 2 Orgs- Org A & Org B both are ap1 Instance In Org A I've created a Connected app In Org B I am trying to Query accounts of Org A From the Connected App Through Http Call, but I am ...
2
votes
1answer
635 views

How to Create Records from XML Data?

This is the webservice response I am Getting in XML Format. <?xml version="1.0"?> <ListOrdersResponse xmlns="https://mws.amazonservices.com/Orders/2013-09-01"> <ListOrdersResult> ...
1
vote
0answers
160 views

How to Make Https Request From Salesforce to Flipkart

Hi guys I'm trying to generate access token for Flipkart Application from Salesforce. When I run this below command in curl I'm able to get Access Token curl -u 52a83780666645a39a6b57103657866a9069:...
3
votes
1answer
202 views

HTTP call using Salesforce

I am trying to rewrite the following Java HTTP request in Salesforce. String apiUrl = "url"; String wsUser = "YourWSUser"; String wsPassword = "YourWSPassword"; CredentialsProvider ...
2
votes
1answer
59 views

batch fired callout only received response from last callout

So my batch will collect 843 records, for each batch, which is 200 records, i constructed a json and made the callout, so in total, it is 5 batches and 5 callouts. I have a server hosting my rest ...
1
vote
1answer
2k views

How to work with HttpResponse?

I am able to do a successful callout and get the response just fine. Having issues referencing the data inside the response.getBody(). What method do you use to be able to reference the data sent ...
0
votes
0answers
727 views

How to use Simple Stripe Checkout in salesforce

I am trying to use the Stripe's Simple Checkout Demo with Salesforce to receive a token. Can someone help me figure out why this simple demo does not work? I am not receiving any value in the ...
6
votes
1answer
3k views

RestResource Class: Set the HTTP Response Status in APEX

We have exposed an Apex Class as a Rest Resource. It is a HTTP Post class and broadly it has the following logic: Get parameters to create a new Account Validate if existing database if it is a ...
1
vote
1answer
378 views

Why returns 500 when I tested SOAP API in apex code?

I got OK when I was testing Marketing Cloud SOAP API with SoapUI tool. So then I tried to send http request in apex, but I got 500 result: Status=Internal Server Error, StatusCode=500 The code ...