Questions tagged [callout]

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

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

BambooHR HTTP Request failing due to characters

I'm working on an integration between BambooHR and Salesforce. The BambooHR API states that the authentication must be "url implicit", so it follows the following format: https://*API_key*:x@api....
0
votes
1answer
851 views

Lightning component immediate server action?

I have an application which depends on outbound calls to REST APIs to fetch data. Is there a way to enqueue and process actions right away? It seems like if I enqueue an action, it is not processed ...
-3
votes
0answers
19 views

test void class for production migration [duplicate]

I have this class that makes a callout to get dollar exchange. I call this from an Apex schedule job every day. Im trying to migrate this to production but i need to add the test class but i dont know ...
6
votes
1answer
47 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 ...
-2
votes
0answers
30 views

Getting an Executable error : is no viable alternative at character '<EOF>' [on hold]

global class ODY_BatchAccountSync implements Database.Batchable<sObject>, Database.AllowsCallouts { global Database.QueryLocator start(Database.BatchableContext BC) { ...
0
votes
1answer
337 views

Override Save button without additional VF page

I try to implement the following: After clicking the Save button on a Standard Object I want to make a callout to a web-service and after receiving the results I want to present a custom VF page where ...
0
votes
1answer
38 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 ...
3
votes
2answers
517 views

Automatically refresh a standard page layout

I have a webservice callout, and therefore I update a field on pagelayout according to the callback. The problem is I have to refresh the page layout (F5) everytime to see the field updated on my page ...
0
votes
1answer
19 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
69 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 ...
1
vote
1answer
2k views

Trigger to use HTTP callout and update record with the results

I have been trying to integrate Google Shortener API into my salesforce org. I wrote a class to make the call out, but am having difficulty bringing the value back into the record. I have a custom ...
7
votes
2answers
458 views

Why aren't iterators in batch jobs lazy-loaded?

I have a batch job that needs to callout to an external web service and retrieve a variable number of records. Seems like a perfect use-case to have an iterator which performs the callouts until there ...
8
votes
1answer
9k views

Why do I get 'PKIX path building failed' exception with my callout?

Error message :PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Hello all please see the above ...
5
votes
1answer
213 views

AWS Signature Version 4 Using Named Credentials

Anyone tried Summer '19 Named Credentials using AWS Signature Version 4 successfully? Trying again to use External Services and first step is the Credentials. I created an IAM user with the ...
0
votes
0answers
28 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 ...
0
votes
2answers
42 views

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

I am trying to write unit test for a a trigger which calls batch apex which performs callout and updates the response to certain record. Trigger's psuedo code looks like: trigger AccountTrigger on ...
0
votes
1answer
47 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
242 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 ...
0
votes
2answers
481 views

Callout to SAP from Salesforce using REST API

I am trying to pass a json data to an external URL. With a basic knowledge, I have added them to remote site settings. The sample URL is http://xyz-xyz.sap.xx.com:50000/xyz/xyz. I have created an apex ...
1
vote
0answers
23 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
41 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 ...
2
votes
1answer
39 views

How do I make Apex callout to a 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
24 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
30 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
30 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 ...
0
votes
2answers
625 views

Serialize and deserialize the List<sObject> in APEX

How to serialize and deserialize the list of sObjects in APEX. I tried to serialize the list of sobjects like this . JSON.serialize(Trigger.New) This is returning a json array of objects like the ...
1
vote
1answer
29 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 ...
0
votes
0answers
37 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 ...
1
vote
1answer
320 views

Soap Callout From Trigger - how to get the response

I am struggling with a weird issue. I have a Soap webservice fired from a after insert/ after update Trigger. i made my function @future to be able to make the call but the response that i have is my ...
-3
votes
1answer
89 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 ...
1
vote
0answers
32 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
1answer
419 views

Create folder using dropbox api

I want to create the folder & sub-folder using dropbox api using apex. I have gone through few links but not able to find complete documentation. On most of the links I have found the below code ...
0
votes
1answer
29 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, ...
0
votes
0answers
38 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 ...
3
votes
1answer
396 views

Callout to web service doesn't work depending the profile I'm using

I have a customized button that once you click it, a new window it's open displaying some data from an external app, getting the data through a SOAP web service. If I'm logged as System Administrator ...
1
vote
1answer
47 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
301 views

Testing future callout method

I am attempting to test a @future callout class that pings another class to make an API call and update some fields in the Lead object. I am using the mock http method and here's the script: @isTest ...
21
votes
5answers
15k views

Unit Test: You have uncommitted work pending. Please commit or rollback before calling out

So I have a method that takes as a parameter an Id of a object and uses it to make an external callout. Unfortunately I can't seem to figure out any way to test it. @isTest static void ...
1
vote
1answer
34 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
15 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
62 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
24 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
56 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
35 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
59 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
23 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
108 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
34 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
95 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 ...
1
vote
1answer
769 views

salesforce to salesforce using partner wsdl in Apex - query call failing

I am trying to connect to other salesforce org. I have partner wsdl. I have used FuseIT SFDC explorer to create Apex class from this partner wsdl. I am successfully able to login to other SF org using ...