Questions tagged [httpresponse]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
15 views

org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte Ef in state 2

I am Uploading Pdf file please help me, I am getting the error org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte Ef in state 2** public static void uploadFile(Blob ...
1
vote
3answers
25 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 ...
0
votes
0answers
33 views

Returning HTTP Status Code from Cloud page

Question: How can I use a cloud page to return a 400 Bad Request? Context: I am trying to use a SFMC Web Studio code resource to develop a webhook endpoint to process lead submissions as described ...
0
votes
0answers
38 views

Retrive the Ip Address of SF instance which the callout is performed

We gave third party service to whitelist all the IP's range which salesforce recommended to whitelist. when I make the Integration and call to their service, I get the following error from their ...
1
vote
1answer
26 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 ...
0
votes
1answer
29 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 ...
0
votes
1answer
90 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('...
0
votes
1answer
21 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":...
-2
votes
1answer
196 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 ...
0
votes
0answers
70 views

Issue in retrieving response body for 4xx and 5xx response code via HTTPPOST2

I am calling third party API via HTTPPOST2 using ampscript, and need response body for response codes like 4xx or 5xx. For success scenario, I am getting the response body in response parameter of ...
1
vote
0answers
33 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>>>>>: ...
0
votes
1answer
137 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<...
0
votes
0answers
27 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
48 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
24 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
1answer
155 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
62 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
176 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
135 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
31 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
319 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
91 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
259 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
3k 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
310 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
1k 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
99 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
57 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
37 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
2k 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
341 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 ...
1
vote
2answers
2k 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 ...
6
votes
0answers
155 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
980 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
655 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
315 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
78 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
185 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
1k 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
413 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
436 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
446 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
130 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
907 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
413 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
2k 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
957 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
411 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
153 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
943 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, ...