Questions tagged [httpresponse]

The tag has no usage guidance.

25 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
160 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 ...
2
votes
0answers
179 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(); ...
2
votes
0answers
67 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
0answers
2k views

Calling a web service from a Visualforce page using jQuery Ajax

I want to call a web service using REST API from the Visualforce page. Below is my code. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">&...
2
votes
0answers
162 views

Identifying Post back or not

Is there a standard way to identify a post back in apex?(something like IsPostBack in asp.net? ) For a oauth flow I'm handling this with the controller constructor like public class DeveloperTesting{...
2
votes
0answers
461 views

http mock for dom document

I am using http mock method for testing responses. But as one of the class expects DOM document and use response.getBodyDocument(). Usually, I used to insert sample response for http mock. I am ...
1
vote
0answers
34 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>>>>>: ...
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) {...
1
vote
1answer
92 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....
1
vote
0answers
172 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:...
1
vote
0answers
198 views

Encoding Issue? HTTPPost ampscript function response insert into data extension

I'm using the HTTPPost ampscript function to send a Json payload to an endpoint and receive a Json response back. I get the OK response back, but the Json response contains Chinese, Japanese and other ...
1
vote
0answers
130 views

Http Callout doesn't return the latest data

Http callout is not returning the latest json response. Below is the code used for calling Rest based web service. But it doesn't return the latest response. It takes time for the data to get ...
0
votes
1answer
24 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 ...
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 ...
0
votes
1answer
94 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
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 ...
0
votes
0answers
28 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
161 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
0answers
262 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 ...
0
votes
0answers
186 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:...
0
votes
0answers
412 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 ...
0
votes
0answers
860 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 ...
-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 ...