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

Questions tagged [httpresponse]

The tag has no usage guidance.

0
votes
0answers
24 views

Httpresponse is not getting coverd in testclass

My response was stored in static resource and I am setting fake response by staticresource method to class but my Httpresponce is not getting covered in test. @isTest global class SmartSheetUtil_Test ...
0
votes
1answer
42 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"...
1
vote
0answers
22 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) {...
0
votes
0answers
32 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....
0
votes
1answer
51 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{ ...
0
votes
1answer
49 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
36 views

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

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
23 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
70 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
67 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
1k 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
114 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
476 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
57 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
48 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
642 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
119 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
558 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 ...
4
votes
0answers
84 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
639 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
569 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
208 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
59 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
146 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
852 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
267 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
208 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
276 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
97 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
585 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
310 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
765 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
331 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
136 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
599 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
305 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
217 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
330 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
139 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
150 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
85 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
47 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
666 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
165 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
203 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 ...