Questions tagged [httprequest]

httprequest is the request sent by browser to server for particular resource.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

Parse child JSON object in JSON array

i am trying to parse a response which is a json object that has JSON array, what I need is to get value in the specific object from the array, inside "results" I'd like to get value from key "id" ...
0
votes
0answers
15 views

error“:”Unprocessable Entity“,”message“:”Server could not parse JSON"

I'm having with JSON parsing when I send PUT request via APEX, I create variable for the body and put in req_put.setBody(data_comment) and get the error error":"Unprocessable Entity","message":"...
0
votes
0answers
41 views

Continuation callback method is not invoked

The actual code is very big, I tried to simplify it as much as possible. The design is such we cannot call the continuation method directly. So looking for ways of invoking it. Many thanks! VF Page ...
0
votes
1answer
38 views

Apex Class Array to JSON - Blank data is being sent

The requirement is to send an array (Item text to JSON from APEX Class). The issue is APEX Class is passing empty array to JSON. ("ItemText":[] ) JSON code below <ns0:QUOTATION_TEXT> {%- ...
0
votes
0answers
21 views

Error deserializing response when iterating over a list in a batch

I'm doing a batch to send objects to an external web service. The class method that does the http requests receives a list and iterates in a for each, sending each record in one callout by record. I'...
0
votes
0answers
148 views

System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable” ERROR

I'm trying to make an HTTP Request to other System. They provided the endpoint URL which contains a Port number. https://Test.com:50001/RESTAP/BGN/PRDV/CREATE When I'm trying to make the request I'...
0
votes
0answers
22 views

Keep getting WSA Action = null error and null header for Http Request

I am trying to post XML data to an external service using an endpoint WSDL. I have set up a Named Credential in Salesforce with authentication. When I run the code below I get the following error: &...
-2
votes
1answer
54 views

System.JSONException: Unexpected character ('<' (code 60))

I am trying to connect another org using user agent auth flow, I am getting auth code and passing it to apex method and then I am getting the below error. private static final string ...
0
votes
1answer
46 views

How to get file name in http response?

I am using apex code to get file from url and able to insert it as attachment. I would like to know file name as well while insert ? When I open link in chrome it save the file with file name. ...
0
votes
0answers
32 views

Has anyone solved the error 415 (Unsupported Media Type) in salesforce?

Has anyone solved the error 415 (Unsupported Media Type) in salesforce ? I tried to upload a file to ContentVersion via rest api request but it 415 error will be returned by my org. Is there any ...
0
votes
1answer
25 views

Named Credential Tooling API SOAP Envelope

Attempting to switch from using custom setting to named credential for authentication. I've updated the http request endpoint to use the named credential but how to update the SOAP envelope to not use ...
0
votes
1answer
120 views

HTTP request - Whitelisting

I need to send an HTTP request to an external Server. They need to open my permissions there and they asking for my URL OR IP address. Since I using Salesforce and it's on the cloud, I don't know ...
0
votes
0answers
22 views

Auth Provider for Trello?

I've spent too many hours today trying to set up an Auth Provider + Named Credential for Trello's auth flow... I guess my question is, for those who have dealt with Auth Providers in SFDC, is this ...
0
votes
2answers
111 views

call tooling API when using lightning component [duplicate]

When I make request tooling API from Apex by using lightning component, the error This session is not valid for use with the REST API is responsed. Also, the response status code is 401, and status is ...
2
votes
1answer
773 views

System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable”

I'm trying to make an HTTP Request to other System. They provided the endpoint URL which contains a Port number. https://Test.com:50001/RESTAP/BGN/PRDV/CREATE When I'm trying to make the request I ...
2
votes
0answers
71 views

Sending 100KB attachment via HTTPRequest throws System.UnexpectedException

I'm trying to upload an attachment from SF to a third party server using REST API, First, my third party does not support base64 content-transfer so I cannot send from SF a base64 attachment. ...
0
votes
1answer
47 views

HttpResponse with status code 0 [closed]

I am using an API to get some response. When I check my HttpResponse. It is like this: System.HttpResponse[Status=null, StatusCode=0] In what case we get such a response?
3
votes
1answer
92 views

Using Named Credentials in OAuth 2 authentication (grant_type=password)

I want to get an access token from an external endpoint (HTTP callout to REST API) without hardcoding passwords. The external system expects a request with Oauth 2.0 authentication details provided in ...
0
votes
0answers
37 views

How to fix callout error — You have uncommitted work pending. Please commit or rollback before calling out? [duplicate]

I'm doing an upload attachment to AWS, but I'm getting this error -- 'You have uncommitted work pending. Please commit or rollback before calling out' How do I fix this? @AuraEnabled public ...
3
votes
1answer
596 views

JSON Serialize and Deserialize on HttpRequest

In order to make a @future(callout=true) call, I'm serializing an HTTPRequest object in order to send it to the @future method accepting a String jsonHttpRequest parameter. Instance Method ...
1
vote
0answers
72 views

Whitelisting Marketing Cloud for SSJS and custom Journey Builder activities

I'm trying to get Mulesoft open for data coming from the following sources in Marketing Cloud: custom Journey Builder activities server-side JavaScript (HTTP requests) Ampscript (HTTP requests) ...
0
votes
1answer
18 views

When using the Favorite API to get all the favorites for the current user it returns as Http Response the Code: 302, Status: Moved Temporaly]?

I am using as reference this documentation: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_favorites.htm And it says that by doing an HTTP GET request to this url ...
3
votes
1answer
79 views

Read Time Out - First HTTP request - rest

Http request using restAPI : public static String sendFormHttp(Opportunity opportunity, List<Easy_Send_Form_Mapping__mdt> mappingList, Map<String, String> systemVariableMap){ ...
3
votes
1answer
66 views

Display PDF with Visualforce using Lightning Experience

Is this post still valid as a solution to download a pdf from third-party site, then displaying it in a Visualforce page? This is what I'm doing in my code: Visualforce page <apex:page ...
0
votes
1answer
46 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
1answer
112 views

Aura Component + HttpCallout + Large File Response

Trying to figure out how best to build interfaces that retrieve external files between 1-10 MB and display them in the UI. Right now I have a Lightning Aura Component that calls a web service via ...
1
vote
0answers
51 views

HTTP CalloutException in Summer '19 sandboxes

Yesterday I started experiencing intermittent but frequent errors with HTTP callouts using Named Credentials in Apex in multiple sandboxes (all Summer '19 preview instances). These same callouts had ...
0
votes
0answers
57 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
78 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
2answers
142 views

API requests calculation on a bulk upsert costing 6 calls

I am using the simple-salesforce Python package to upsert records into our Salesforce instance. I am finding that each bulk API call counts as 6 API requests. Is this correct? Is there a way to reduce ...
1
vote
0answers
50 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
27 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
0answers
21 views

Redirect from visualforce with basic authorization header

Is it possible to send a Basic Authorization header from a visualforce page and redirect a user to a different non-sf site? If not any way on how I can do this? I was able to send a HTTPRequest with ...
0
votes
2answers
98 views

Rest API Composite - Error 302

I am using Composite API to get the opportunity record but facing 302 error { "compositeRequest" : [ { "method" : "GET", "url" : "/services/data/v42.0/query/?q=select+id,...
0
votes
2answers
401 views

System.HttpResponse[Status=Unauthorized, StatusCode=401] from Apex Controller

I have the following code, that retrieves picklist values dependent on a record type: public static List<String> getPicklistValuesByRecordType(String objectType, String recordTypeId, String ...
0
votes
0answers
38 views

What are all the options to send a file via http?

The documentation (look at the SendFax service method) for this API I'm using is not clear on how to send the actual document. Here is the java code example they used to send the file: package com....
0
votes
1answer
51 views

Integration that involves encryption

I've done quite a few JSON/REST integrations and only two SOAPs, but this API I'm working with looks like neither. They do offer example code. I stuck with the java example because that is what I've ...
1
vote
0answers
23 views

How to configure HTTP request headers for a Canvas app

I’m trying to create a Canvas app where the URL is served by a CDN. Salesforce is setting 'cache-control: no-cache' in the request header and this is causing the request to fail with status 403 along ...
0
votes
0answers
34 views

Uploading CA-Signed CRT to Salesforce?

I have an existing CA-Signed Certificate (CRT) given to me by my client, and it is needed to be able to make callouts to their external system. I have not found a way to be able to upload a CRT to ...
0
votes
2answers
42 views

Catch block code coverage for @HttpPost and @HttpGet REST API

I have some code in my catch block for both @Post and @Get methods. I need to cover catch block to get to 75% for GET, got catch block covered for POST Here is an example : // POST my JSON : [ ...
0
votes
0answers
48 views

Getting Bad Request from Post request to SharePoint Rest API from APEX

Hi i am doing a post request for delete a folder in sharepoint from salesforce i am using below code string Authorization = 'Bearer ' + spa.basicAuthCallOut(); HttpRequest req = new HttpRequest(); ...
0
votes
0answers
47 views

Having comma in HTTP endpoint using Named Credential causes exception

We have special requirement from customer that url parameter is specified like this: "www.example.com,timeoutSec=120", where www.example.com is defined using named credential. We receive following ...
0
votes
0answers
35 views

How to Log Complete HTTP Request

I am trying to capture an HTTP request in it's entirety as it is sent from salesforce. After adding headers my request I have attempted to use JSON.serialize and String.valueOf, where as JSON....
0
votes
2answers
260 views

Salesforce server IP which is making callout

I have a batch process which makes a HTTP call out to third party, but because of IP restriction third party is denaying the request. Is there any way to get Salesforce server Client IP from where ...
1
vote
2answers
333 views

Deserialize JSON Body into two different Lists of own classes

I'm writing an REST PUT request that takes in an array of Careers and Degrees from the body and converts them to inner classes within the RestResource class. However, when I am attempting to ...
0
votes
0answers
268 views

Apex Multipart HttpRequest - With JSON and BLOB

I am trying to consume a Google Drive API to create a file in an ApexController. I was successful in creating a file in the root folder without specifying a name using the code below http h = new ...
1
vote
0answers
254 views

HttpRequest gives 500 error

I have an APEX class with code to request a token from https://login.salesforce.com/services/oauth2/token. This code works on Development and Acceptance, but is not working on Production. This is de ...
0
votes
0answers
241 views

“Connection reset” exception when sending a callout (HTTP.send())

We have been receiving this intermittent exception when trying to make a callout for a few months now ("Connection reset" is the exception message): Connection reset Class.Sip_HttpUtil.callout: ...
0
votes
1answer
58 views

call out method is not called in a continuous class, call out from VF page

I was trying to do a callout from a VF page constructor. I'm using Continuation class. As I've to show the response in the Page. Yhe problem is the callout method is not called. Below is the code, I ...
1
vote
2answers
157 views

How to parse this JSON response returned in Einstein Chat-Bot?

Currently getting raw JSON response - { "coord": { "lon": 73.85, "lat": 18.52 }, "weather": [ { "id": 800, "main": "Clear", "description": "clear ...