Questions tagged [callout]

"HTTP Callouts" connect to a remote web server from Apex code.

Filter by
Sorted by
Tagged with
1
vote
1answer
93 views

System.CalloutException: Web service callout failed: Unable to find field status

I have downloaded the WSDL file from this link: download. This WSDL contains 2 bindings, 2 ports so to generate apex class in Salesforce, I have removed the additional binding & port then I'm able ...
0
votes
1answer
32 views

DML operation and callout (synchronous)

I have a requirement where, on changing a particular field value of an account record from Lightning page layout, I have to make a callout. If the response from the callout is not successful, then the ...
0
votes
1answer
38 views

Need work around for salesforce limitation when making callout

I have searched but i didn't get how to fix this issues Actually I'm making callout to Google Vision Api from salesforce apex class. When i m uploading image with more text content, response from ...
0
votes
1answer
71 views

Quote Calculator plugin doesnt seem to be firing at all

I have a requirement that, whenever we click 'edit lines' button on Quote object the price of the products selected needed to be updated in realtime from SAP. I have created a Custom script JScode ...
1
vote
2answers
32 views

Uncommitted work pending in unit test with queueable chain and httpcallout

I have a Schedule job that invokes a class and from there i call the Queueable class like this: ID jobID = System.enqueueJob(new NSQueuebleJob(acList)); The queueable class is: public class ...
0
votes
0answers
128 views

AWS Signature Version 4 Named Credential doesn't seems like working

I have requirement to fetch a file from s3 server to Salesforce. As a part of Summer'19 release, Salesforce has provided AWS Signature Version 4 protocol in Named credential.From below link I see that ...
0
votes
2answers
138 views

Aura/LWC: How to do not merge multiple apex calls and send them separately?

If open network you can see calls like this: /aura?r=14&aura.ApexAction.execute=3 where 3 (or 1, or 2, or any other number) is apex calls count has been sent together. And it causes errors ...
1
vote
1answer
72 views

Mock test for callouts in a queuable function

I am having issue creating mock for callouts in a queue. I have done following.  I have a handler (OpportunityTriggerHandler) which creates a job called EnableOnboardingCompleteJob. This job calls a ...
4
votes
1answer
76 views

Is it possible to upload a self-signed certificate into Salesforce for callout purpose?

We need to make a callout to an external system. The external system uses a self-generated certificate to verify the caller. So is it possible to upload a certificate into Salesforce for this purpose? ...
0
votes
2answers
473 views

Parsing Array of Nested JSON Objects

I am trying to parse an array using Apex that contains nested json data from an external REST API call. The code is shown below, the response comes back, but I want to get at the keys/fields in the ...
0
votes
1answer
103 views

HttpRequest and setEndPoint not working

I am using developer console and trying to create a new simple class so I can make an external callout to a REST api and return some json data. I've added the remote URL in the Remote Site settings ...
7
votes
1answer
168 views

Reason not to implement Database.AllowsCallouts

I have a number of batches all extending a base batch class that handles logging of sorts. Some of these batches do callouts, while others just handle data in Salesforce alone. It happened to me on ...
0
votes
1answer
142 views

EXCEPTION_THROWN|[22]|System.CalloutException: Exceeded maximum time allotted for callout (120000 ms)

global class UpdateLeadInfo implements Database.Batchable,Database.AllowsCallouts { global Database.QueryLocator start(Database.BatchableContext BC) { String query = 'SELECT Id, ...
0
votes
0answers
15 views

SOAP Web service callout to 'https' endpoint with one-way SSL certificate by the service provider

What is the approach to make a SOAP web service callout from Salesforce to 'https' endpoint url, when the service provider gives a one-way SSL certificate?
1
vote
3answers
76 views

Limitation with callouts

I want to listen to the change in permissions of salesforce records. For that, I am thinking to fire a callout from an afterUpdate method of a trigger. Whenever a record is updated through any means, ...
6
votes
1answer
114 views

How can I unit test a http callout that uses a certificate?

The .setClientCertificateName method of the HttpRequest class requires a string that is the name of a certificate in the organization. In a unit test class, is it possible to mock this method? When I ...
0
votes
1answer
43 views

Can Remote Site Settings whitelist IP addresses instead of/in addition to domains?

I'm just wondering: We make a number of callouts from Salesforce to different APIs, and so obviously we need to whitelist their respective domains with Remote Site Settings. However, I'm wondering ...
2
votes
3answers
134 views

What method to use in a batch apex in order to get authentication token from a remote server?

I have a batch class that uses query locator to send data into the client's server. however, it must first authenticate and get access token and send that along with the data with all consecutive post ...
0
votes
1answer
129 views

dynamic json body as http post request

public class RequestWrapper { public static GetUrlRequest GetUrlRequest; public class OrderDetails { public String txnId; public String custOrder; public ...
0
votes
0answers
37 views

Issue converting file object types to String format from an incoming OneDrive REST API call

I'm trying to pull a file object-type from O365 via the Graph API and I'm getting back a return-type that is pretty atypical to the normal JSON return format I'd expect to see. I'm not sure if it's ...
1
vote
2answers
153 views

Testing a trigger calling batch class for making a callout gives System.CalloutException

I am trying to write unit test for a trigger which calls batch apex performing callouts first then updates the response to those record. Trigger's psuedo code looks like: trigger AccountTrigger on ...
0
votes
1answer
56 views

How to make a trigger callout to delete files from AWS?

Please help me with my problem.. what I should do is when a user deletes a file, a trigger will check if there is existing file ID (File_Id__c) in the Custom_Object__c, if so, delete it in AWSS3 as ...
1
vote
0answers
38 views

Rest API callout using basic authorisation

String filter = 'OrderNumber eq \'1000035\' and SoldtoCustomer eq \'10045005\''; String Username = user; String Password = pass; String expand = 'EvLineDetailsSet'; String format ='...
0
votes
1answer
43 views

Connect Apex Class to a custom Screen

I have created a custom apex class that makes an HTTP POST call using callouts. Right now I have it running on a schedule using an @future method. This is working fine, but I actually want to connect ...
3
votes
1answer
2k 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 ...
3
votes
1answer
138 views

Apex callout to an OpenID Connect endpoint protected by PKCE code challenge

I'm trying to write Apex code that'll call an external API. The API is using OpenID Connect for authentication, meaning I'll have to first give consent in order to get an authorization code, then ...
0
votes
1answer
28 views

Simplifying REST API calls

I'm new to Java programming and I'm trying to reduce the number of REST API calls I make in my program to better organize it and I'm not sure how best to approach it if the simplest way is to have a ...
-1
votes
1answer
41 views

Salesforce Integration with Oracle

I need to Integrate Salesforce with Oracle Platform (Create Account in Salesforce when its created in Oracle platform). I researched and understood that It could be done by API Callout methods. Could ...
0
votes
1answer
32 views

Connect Campaign Members to Opportunities Using SOQL

I am trying to create a SOQL query that will give me contact and opportunity information from people in a specific campaign. I have done the following and I can get Contact information, but I am not ...
1
vote
1answer
46 views

Unit Test - Flow Variable to Apex Class to HttpRequest

For context, I am usually just a declarative Admin and can usually achieve whatever I need to on the platform using Flow, PB, or simple WFR. Very seldom do I have to 'resort' to Apex. I have a Flow ...
1
vote
0answers
37 views

Testing Batchable with Callout Error: You have uncommitted work pending. Please commit or rollback before calling out [duplicate]

I have a Batchable class which does a callout. When I test the class which like this: Test.startTest() MyBatchableJob job = new MyBatchableJob(); Database.executeBatch(job, 50); Test.stopTest(); I ...
0
votes
0answers
42 views

Variables from inner class defined by JSON deserialization are coming across as null

I have a class, geolocAddress, that I created to deserialize some JSON using JSON2Apex. I really only need to access the variables from one inner class, Components, but when I try to retrieve the ...
-3
votes
1answer
153 views

Callout from Trigger using future or queueable [closed]

I have trigger on custom object and i need to make callout (Post) from trigger whenever status field change to completed I know i can do this using @future in trigger but my requirement is if response ...
0
votes
0answers
56 views

Quickbooks API PDF upload error: Maximum line length limit exceeded

I'm trying to upload pdf file from Salesforce to Quickbooks attachments via Quickbooks API. It works fine with small files, but if file size exceeds 999 bytes, the following error appears: An ...
0
votes
1answer
37 views

Batch callout: How to upload Attachments from multiple objects (dynamically)?

I am trying to upload an Atttachments based on the selection and criteria from Lightning Component that will be saved to Custom Setting. For example, the criteria is Opportunity - Stage - Closed Won, ...
1
vote
1answer
84 views

Callout from trigger is not Supported

I am trying to execute a callout from trigger. But i got as error in the debug log as "common.apex.runtime.impl.ExecutionException: Callout from triggers are currently not supported." I know we ...
1
vote
1answer
162 views

Batch method making callout: uncommitted work pending

My app is an SMS lightning component, so in many situations, I'm doing DML updates AND making a callout. I have avoided the "uncommitted work pending" errors by using @future (callout=true) on all the ...
0
votes
0answers
19 views

Test batch with multiples Callouts - HTTPMock [duplicate]

I have a Class that integrate Api , there are many Callouts in there. And I have a Batch Class that running on functions of this class. My question is about the test class. test class: @...
3
votes
1answer
261 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
79 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 ...
1
vote
1answer
59 views

How to do this 'GET' through Batch?

I have a void callout class. But I need take all these tools through Batch to make it in Schedule later. How can I convert it into Batch structure with start, execute, finish? public static void ...
1
vote
1answer
89 views

Sending multipart data throws error?

I am using exact answer from this link, just with some minor modification. Post multipart without Base64 Encoding the body I have developed a spring boot application which accepts two formdata, one ...
-2
votes
1answer
210 views

Apex Trigger to callout Rest API to external system when the status is updated

I have a REST API class which will send the response to external system as { "AccountId" : "0098", "email" : "Email-ID", "status" : "active" } Below is the REST API class that will send data to ...
0
votes
0answers
25 views

Problem calling specific variable of a json

This is my Invoicewrapper class that is working perfectly fine: public class InvoiceWrapper { public class Counts { public Integer returned {get;set;} public Integer total {...
0
votes
1answer
601 views

Calling a Batch Class from Lightning component [closed]

How can I call this Batch Class from Lightning component? global class BatchSync implements Database.Batchable<sObject>, Database.AllowsCallouts { public String query = 'Select ID, Name ...
1
vote
1answer
63 views

lightning:empApi and Callout: Streaming API

I created a test platform event with checkbox, added my custom object to Change Data Capture and did this: empAPI.cmp: <aura:component implements="flexipage:availableForAllPageTypes" access="...
3
votes
2answers
110 views

Let external system modify Salesforce data on behalf of logged in user

I am going to build a native Salesforce app (Managed package) that will be installed in many subscriber orgs. The app will make callouts (eg. calling REST endpoint) to external Java app. The Java ...
0
votes
1answer
43 views

Callout conflicting with Messaging in batch job

I have a service that is making callouts to another system and if it fails for some reason send email notifications. When I do the service for one record it is fine (e.g. call it from a trigger). ...
0
votes
0answers
90 views

Avoid Using Hard Coded Credentials for Authentication

We have done the code review by salesforce,and got "Avoid Using Hard Coded Credentials for Authentication" at quite some places where ever we are setting up Authorization Header.(On the 5th line of ...
2
votes
1answer
79 views

Deserialize api callout problem

I am facing a problem which I am not finding any answers. I am trying to call a third party API (which is working). But when I try to deserialize the json receive, nothing is happening. Here is my ...