Questions tagged [httprequest]
httprequest is the request sent by browser to server for particular resource.
430
questions
1
vote
1
answer
97
views
HttpRequest to SAP encoding $ and space caracters
I have a wierd problem:
I'm calling SAP from salesforce apex and I have trouble with one of my request.
This one is working.
request.setEndpoint(authentification_details.Webservice_enpoint__c+'/...
1
vote
1
answer
175
views
Attempting to pass Flow variable to Apex to use in HTTP request & create PDF
I think I'm quite over my head in this class. I'm trying to do about three different things that are brand new to me. In short, I'm trying to do this :
Pass a variable to an Apex class from a Flow (...
0
votes
0
answers
67
views
Scheduled-Trigger Flow only updating first record
I am having an issue with a simple Scheduled Trigger Flow. It is my understanding that a flow of this type should be able to update a batch of records at once without requiring a loop to facilitate ...
0
votes
0
answers
57
views
" the field is not available to the running user" error when updating from a Transform record collection
I have a simple flow that looks at the VIN number on a customer Trailer record, and looks up info from that VIN via the NHTSA API. Immediately after the HTTP call I have a Transform element that maps ...
0
votes
1
answer
83
views
Cannot see Http Callout in Flows
To turn on Http callout in flows, at first I have made an external credential with authentication protocol as custom.
After that, I have made a named credential, enabled it for callouts, and use the ...
0
votes
0
answers
17
views
How to sent ContentVersion's VersionData through API? [duplicate]
I am trying to send a pdf file attached to a record of custom object to an external system. I am using ContentDocumentLink and ContentVersion to get the file in apex and make a api call. File is ...
0
votes
0
answers
42
views
Problem with sending files through HttpRequest
I'm getting problems when try to send files larger than 3MB (aproximated) to third-party through HttpRequest in a Integration Apex Class. This third-party tell us than they received the request but ...
-1
votes
1
answer
31
views
Getting Error in This Test Class
@isTest
private class LeadUpdateTriggerHandlerTest {
@isTest
static void testHandleUpdate() {
// Create test data
Lead testLead = new Lead(FirstName = 'Test'...
1
vote
1
answer
198
views
How to write an APEX Test Class with Multiple Http Callouts (Renamed)
I'm relatively new to programming, and I am attempting to write the Test Class for an Apex Class that has an HTTP Callout. I have already created the HTTP Mock Class to simulate the Callout, but when ...
-1
votes
1
answer
120
views
Metadata service Invalid Session Id on future method
I'm making a call to the Metadata service API.
The Api call happens in future methods.
I have tried both approaches of passing the Session Id as a parameter to the future method and also getting the ...
2
votes
1
answer
207
views
Visualforce CORS Error Even When Origin Is Whitelisted, Headers Are Also Set
I'm creating a PDF viewer using Visualforce and the PDF.js library. My project doesn't include react.
When I try to execute pdfjsLib.getDocument() passing the URL of a PDF stored in Salesforce itself, ...
0
votes
1
answer
163
views
Security scan is complaining on setEndpoing
My company uses a security scan tool called Snyk to scan code for security vulnerabilities.
It is complaining about a Server-Side Request Forgery (SSRF) vulnerability.
The details says Unsanitized ...
-2
votes
1
answer
2k
views
The callout couldn't access the endpoint. You might not have the required permissions, or the named credential
I have created a named credentials which has a endpoint like this and it is authenticated
https://#######-#####.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=####&deploy=1
while ...
0
votes
1
answer
487
views
Creating HTTP Request with graphql Query
I've been trying to add a graphql Query in a httprequest that is sent out to an api that receives the query. I've tested the query within postman and was able to get the result. However when I try to ...
0
votes
0
answers
363
views
Named callout Null in http request with named credential - What would cause it?
I am making a callout and getting the error
"System.CalloutException: The callout couldn't access the endpoint. You might not have the required permissions, or the named credential "XXX"...
0
votes
1
answer
314
views
how to 'encode' the body in an HTTP body?
i am trying to send this body exactly as it looks
{
"table":"inquiries",
"response_type":"json",
"query_array":"{\"fname\":\...
0
votes
1
answer
272
views
Retrieve Request Method from HTTP Request Header
I would like to know if there is a way to retrieve an HTTP request method from the HTTP request headers.
Based on the method used (GET, POST, ...) I will run a different logic on my Cloud Page.
If I ...
-1
votes
1
answer
191
views
Pass Http Get and Http Post as asynchronous apex in order [closed]
My requirement is to pass data from my org (Salesforce) to external org (SAP S4). I have successfully made the class for integrating both. However, I need to pass this class in a trigger and since it ...
0
votes
0
answers
140
views
Apex callouts - TLS ciphersuite
I'm working on an integration with Salesforce using Apex code to make outgoing API calls. One of our users is asking what cipher is being used. Is there any way to figure this out? Some way of viewing ...
0
votes
0
answers
99
views
How to Create a Test class with a Future Callout that is not dependent on an HTTP Response?
I am new to Apex, but I have been tasked with sending a Salesforce Custom Object to another Company system. My Class works as expected, but my test class fails due to having a @future method. I did ...
1
vote
0
answers
317
views
Unable to access array within an array from Salesforce flow http callout (beta)
In sandbox, I am attempting to gather the information from https://data.nasdaq.com/api/v3/datasets/USTREASURY/YIELD.json
I used the beta feature of creating an HTTP callout right from the flow. It ...
-2
votes
1
answer
2k
views
HTTP Request Body Call Out Salesforce Apex
I just want to call an API from an Apex. But all i know how to do is thru JSON String for the body. The integration team required me to call it thru Data Form which i can call it from Post. I got no ...
0
votes
1
answer
356
views
AMPscript InsertDE is inserting an empty row
I have a code on client-side that is using JavaScript to create an object called "data" that contains several variables such as "matricula", "scheduled", "...
0
votes
1
answer
81
views
HttpCallout to external Worldline API authenticaion not working but same call working frrom Postman
I'm currently working on interactions from SFDC to Worldline APIs and I have an issue with the authentication to their API. I have followed what they wrote here and the generated authorization header ...
0
votes
0
answers
208
views
How to update StandardValueSet metadata using Tooling API
I am experimenting with the Tooling API to update the standard picklist values for the Type field on the Account. I have created Apex code to retrieve the metadata:
HttpRequest req = new HttpRequest();...
0
votes
0
answers
96
views
Routing Form POST request from Visualforce Page through Salesforce
I am making a form post request from page and hence the request is taking user's IP address into consideration. Is there any way to continue having a form POST and provide a dummy URL in action tag ...
2
votes
2
answers
220
views
How can I dynamically upsert data in object
I want to upsert data in SF based on the selected columns by the user. I make HTTP callout to an external service and it returns the data. Then, I want to iterate over the each returned row and create ...
0
votes
2
answers
35
views
Retrieve data from 2nd SF Org
I'm making a SF org where i need to retrieve data from a 2nd SF org.
I have created Connected App in my Source Org, and i have created Auth. Provider and Named Credential in the Portal Org (that the ...
-1
votes
1
answer
162
views
Multiple Web Callouts In Scheduled Apex
I'm trying to get some additional information on specific phone numbers in my database using web callouts. I won't hit the governor limits as it's going to be less than 100 numbers per day. I'm also ...
0
votes
1
answer
679
views
HTTP Callout vs. Callout Processing Time / Long-Running Request Limit
I have a LWC that loads on a frequently accessed lightning page (thousands of times an hour).
It makes a request through synchronous Apex to a legacy webservice where response times are 20 seconds. ...
0
votes
1
answer
370
views
HttpRequest callout timeout
Is there a way to check the setTimeout() value of a HttpRequest object?
use case: a method is receiving a HttpRequest object. I want to check if setTimeout is setup in the object before setting it up.
...
1
vote
2
answers
387
views
How to check which controller a request is coming from?
Can anyone give any clues on how I can check if a request is coming from a specific controller? I meant, to meet this requirement:
As the order model gets loaded whenever the customer has an
...
0
votes
1
answer
3k
views
HTTP response content showing null value when using Script.Util.HttpRequest
I'm trying to create an SSJS script that can store the values in the marketing cloud's database using the Script.Util.HttpRequest method. When I try to print the HTTP response content, I get a null ...
1
vote
1
answer
850
views
Unable to retrieve security descriptor for this frame error in SSJS
I'm trying to get my head around SSJS to create a script that can store the provided values in the SFMC database using Script.Util.HttpRequest function. I am able to see that the values provided were ...
0
votes
1
answer
136
views
Help with test class on
I need help to get more code coverage for the test class but I'm not sure how to approach it
Class:
public class salesforcetoJiraHandler {
public static void newmed ( List<...
1
vote
0
answers
93
views
SSJS: Unable to retrieve security descriptor for this frame error
I'm trying to create a script to store values from a form on a cloud page in the SFMC database using the SSJS HTTP Post method, but I'm receiving the following error:
Exception occurred: Unable to ...
2
votes
1
answer
554
views
How can I create custom HTTP body
I'm building aura app and I have trouble sending custom body to HTTP callout.
I have problem constructing custom body for HTTP API callout in Apex. I want to get data from third party system (piwik....
1
vote
1
answer
577
views
Parsing HTTP JSON Response [duplicate]
I'm pretty new to Salesforce/Apex and I'm trying to extract the information I need from the HTTP API call I make to an external system (like Piwik.pro) and store in list or a map. I want to get all ...
0
votes
1
answer
1k
views
Convert PDF file returned as byte[] in apex callout into blob and Save as file
I am making third party api call from Apex using below piece of code:-
HttpRequest req = new HttpRequest();
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setBody(Body);
req.setHeader('Content-...
-3
votes
1
answer
49
views
This is my class for httppost request ,so i want to send the response code with error message when the request is come into the system [closed]
This is my code, what I want to send is if request is sucessfully created then send code 201 with sucess message and if not created then send 501 with error message
@RestResource(urlMapping='/...
0
votes
1
answer
220
views
Heapsize error on Queueable class
I have a queueable class and I am doing a REST Callout. I am sending 2 files that are less than 12MB. When I run the code I am getting a Heap size error. Salesforce document says if you use Asyncrous ...
0
votes
1
answer
299
views
Accepted status in /connect/files REST service in lwc controller context
I am trying to convert docx to pdf with /connect/files service.
Sample code:
String ContentDocumentId = '0697Q000002LuE1QAK'; //some .docx id
HttpRequest req=new HttpRequest();
req.setMethod('GET');
...
1
vote
0
answers
103
views
Can I config number of action in boxcar request?
I created a community site.
In the site I have a form with a lot of item dynamic (item stored in database: type (input, radio, checkbox,...), label, max length,...)
When I submit form, cause of number ...
0
votes
1
answer
769
views
How to set StatusCode on Test.setMock [duplicate]
I have a simple class that just calls the generic HTTPCallOUt method for its test class.
I want it to be able to fail in order to catch all the code. Here is my code:
Test.startTest();
Test....
1
vote
3
answers
724
views
HTTP/1.0 Requests
We have received a notification that requests are reaching our salesforce.com Org using HTTP/1.0 and such requests are no longer supported.
I assume these requests are, most likely, coming from some ...
0
votes
1
answer
353
views
Test class for HTTPCallout POST with Invocable Method from Flow [duplicate]
I'm still pretty new to this, and I've looked around and haven't been able to find the solution that combines everything like I'm trying to do. I've tried quite a few things, but here's where I ...
0
votes
1
answer
211
views
Getting a script-thrown exception on a PUT to Amazon S3
Code generates an XML document and PUTs in into an S3 Bucket.
If I comment out the Header code for Content Length, it does not throw, but S3 requires Content Lengths in the header. So it fails at the ...
0
votes
2
answers
174
views
Why Places field on account object is not getting updated in the UI after making callout from trigger using future method?
I have made two custom fields 'Pincode__c' of type text and 'Places__c' of type Long Text Area.I am inserting account record by providing 'Pincode__c' value and want the custom field 'Places__c' to ...
1
vote
1
answer
4k
views
Named Credential Permission Error - How to enable named credentials with "Named Principal"
I've got a new named credential setup using an OIDC auth provider and the named principal type. It's authenticated successfully but when I try to call it I get
String namedCredential = 'callout:asdf';
...
0
votes
0
answers
2k
views
REST API - File Upload using HTTP Request with multiple parameter in apex (salesforce)
I'm trying to post form data using HTTP request with multipart/form-data with multiple parameters but It's always showing error "invalid file contents".
{"http_code":400,"...