Questions tagged [callout]

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

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

Is Apex Callout chaining from Javascript controller using Async/await or Promise possible?

I need to make 5 callouts serially. I have written 5 different apex classes. I want to chain these callouts from JavaScript controller using Async/Await or Promises. Had anyone worked on such scenario?...
user avatar
1 vote
0 answers
17 views

Input Data Type in Flow

I have gotten help already from you kind folks. I could use pointers for another issue I am encountering. I am currently attempting to POST to another service from salesforce. However, the expected ...
user avatar
0 votes
0 answers
16 views

Sometimes workflow rule update doesn't appear in user interface but in debug logs it was updated

I have updated the contact's Mailing country to two-letter name through workflow rule. Besides, I have a process builder that uses mailing country and makes API calls (API call is occur in apex class ...
user avatar
1 vote
1 answer
33 views

"Variable does not exist" error where variable is a class does exist

I have an Apex class OpportunityUpserter with a static method, where the static method makes a call to another static method in a class called IntegrationUtilities, as shown below. This gives me a ...
user avatar
  • 113
0 votes
1 answer
44 views

Apex Class CallOut

I'd like to apologize in advance as I'm quite new to writing APEX Classes / Triggers. I've followed a tutoriel of which the aim is to POST a comment to an external system, in this case it's Jira. I ...
user avatar
0 votes
0 answers
29 views

Getting full coverage for test class for boolean value? [duplicate]

This UserMigrationRoute class is migrating Community profile users to Partner profile and saving their username Password in userMigration object. I have really hard time writing test classes. I have ...
user avatar
-2 votes
0 answers
30 views

Unable to resolve host "na111.salesforce.com": No address associated with hostname

I'm doing a callout to salesforce from my external system and getting this error. I checked the instance status and it looks fine in trust.salesforce.com The external system from where I'm doing this ...
user avatar
1 vote
0 answers
48 views

Named Credentials with JWT Token Exchange: problem with "subject_token"

I was trying to setup a Named Credentials with JWT Token Exchange (i.e. not the basic "JWT" option) to use GCP Identity Federation and I got this error when doing an APEX Http callout: ...
user avatar
  • 111
0 votes
0 answers
64 views

Data Integration Super badge: Callout to external service is throwing 500 error [closed]

I am attempting Salesforce Data Integration Super Badge. I have passed the first 3 challenges and currently attempting the 4th one 'Synchronize Outbound Project Data'. When I tested the REST API, it ...
user avatar
  • 35
4 votes
1 answer
48 views

Flow -> Apex -> Salesforce REST API: why "Unauthorized endpoint"?

I have an Apex class that calls into Salesforce using a new HttpRequest(). When I call that Apex from Anon Apex, it works fine. But when I call it from a Flow I am testing in FlowBuilder, it complains ...
user avatar
0 votes
0 answers
23 views

Using username and password properties from named credentials to create an access token for x-authorization header

I'm using named credentials to make a callout, I'm not using the Generate Authorization Header since the authorization uses an x-authentication header. I have tried this: aeroplanCallout....
user avatar
  • 232
0 votes
0 answers
35 views

Trying to Create a Feed Using an External Callout Using Chatter API

What works: All three files are communicating with each other The lightning button calls handleClick() handleClick() gets the return value of getFeedElements() getFeedElements(any given record ID) ...
user avatar
0 votes
0 answers
36 views

How to get 100% test coverage for an apex trigger associated with an asynchronous callout?

I am looking for assistance on why 'zipCodeTimeZone.makeCallout(objLead.Id)' in both places on the trigger is not being covered/triggered by my test method while it is providing 100% coverage for the ...
user avatar
  • 1
2 votes
1 answer
77 views

Queueable HttpCallout.TooManyCalloutsException: Too many callouts requested vs SFDC Limit: 0

I have a Queueable class that performs a single callout. When it executes, it generates this error: HttpCallout.TooManyCalloutsException: Too many callouts requested vs SFDC Limit: 0 public class ...
user avatar
  • 62.3k
1 vote
1 answer
51 views

Named Credential with OAuth Authentication Provider does not refresh access token

This is an extremely annoying unsolved issue that I see more people than I have been, and are(?), struggling with without a solution to date. Please help! Workaround or guidance. Auth Provider (AP): ...
user avatar
  • 11
0 votes
1 answer
40 views

Future Callout and Invocable Apex

I have an invocable apex method that calls to a future (callout=true) method. The callout returns a response that needs to be returned to the front end. I am stuck because I can't return a value from ...
user avatar
  • 3,179
1 vote
2 answers
60 views

Named Credential - using a merge field

Im facing issues trying to generate the auth header in Apex when using Named Credentials. Unfortunately I cannot use the standard Named Credential approach (auto header generation) as I have to embed ...
user avatar
  • 13
0 votes
1 answer
23 views

How to properly test and assert an @restresource that do multiple API calls?

I am struggling to do a test class, mainly building a proper assert method based on the following @RestResource (at the end). This class have 3 different API calls (First API response an XML the other ...
user avatar
  • 1,889
2 votes
0 answers
78 views

Platform Event + Flow + Apex Action not behaving as a separate transaction sometimes

As we have used Async operations (Future and Queueable) very heavily in our codebase. Thus for doing callouts from trigger, I started using Platform Events + Flow. So from Trigger a PE will be raised :...
user avatar
0 votes
0 answers
31 views

ApexPages.getContent() Callout Error from Flow

I am receiving the following error when I run the below apex invocable method in my flow: An Apex error occurred: System.CalloutException: You have uncommitted work pending. Please commit or rollback ...
user avatar
0 votes
0 answers
43 views

I am trying to delete account record using Postman tool. I have created apex class and method to delete account. but the account doesnt get deleted

@RestResource(urlmapping='/v1/Account/*') global class AccountManager { @httpDelete global static String deleteAccount(){ RestRequest request = RestContext.request; String requestURI = ...
user avatar
0 votes
0 answers
31 views

On which side is the root of this issue

After callout with using a certificate, I receive the next msg in my dev console - System.CalloutException: Received fatal alert: bad_certificate Could you pls specify from what side we have a problem ...
user avatar
  • 15
-1 votes
1 answer
64 views

is it possible to add uri parameters on a http callout using named credentials?

Context: I have to call, from a source org, a HttpGet method from a target org. This method will return a list of records that match a certain value on a field, which I have to send from my source org....
user avatar
-1 votes
1 answer
84 views

Http POST/PUT data via LWC or VF

I would like some help in using a LWC or Visualforce page form to populate fields in a wrapper and then eventually post the inputs using a http 'Put' request. Expected json: { "...
user avatar
0 votes
0 answers
32 views

JKS certificate chain in call out

I am trying to make a callout based on provided JKS but received - a bad certificate. No one from the customer side can not fix it. What documentation do I need to provide for a person who tries to ...
user avatar
  • 15
0 votes
1 answer
52 views

After response from future callout how we can update the field value in record, can you please assist

here I'm calling below class from the trigger and getting response from external system as well whether my regNo is blacklisted or not, but after saving the record how we can update the status basis ...
user avatar
  • 11
0 votes
0 answers
28 views

Stub method from another class

I have stubbed class with name DataUtils and class which i am testing with name DataController. Method from DataUtils that is being called in DataController is web service callout. I cannot use ...
user avatar
  • 41
0 votes
0 answers
66 views

Bad certificate in call out

I use the certificate provided to me. During callout, I get this message in the developer console. Is this a bug on the side of SF or an external system? How can I verify the correctness of the ...
user avatar
  • 5
0 votes
0 answers
26 views

Troubleshoot Platform Event in Production Environment

We have an existing implementation where Flow 1 publishes the event and Flow 2 subscribes to the same event and processes the apex logic. The apex logic includes callout and updating the Lead. Out of ...
user avatar
1 vote
1 answer
82 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'; ...
user avatar
0 votes
1 answer
19 views

Test for three callouts in one Queueable class

I have 2 callouts in one class. I use XML mock in static resources. How to provide the right fake XML to every callout? Thank you public with sharing class x implements Queueable, Database....
user avatar
  • 5
0 votes
0 answers
88 views

External callout using Flow Builder - Apex Class Invocable Action

I would like to create a callout (webhook) when a custom field Batch_Name__c is updated which belongs to the Account Object. The purpose of this callout is to send all account information to an ...
user avatar
  • 1
0 votes
1 answer
74 views

Callout using Apex Trigger when custom field updated

I would like to create a callout (webhook) when a custom field Batch_Name__c is updated which belongs to the Account Object. The purpose of this callout is to send all account information to an ...
user avatar
  • 1
0 votes
1 answer
33 views

429 status code if I make call outs in Batch execute

From a batch apex I am trying a make a call out in for loop as like below for(eBilling__c bill : lstBilling){ try { HttpRequest req = new HttpRequest(); ...
user avatar
  • 59
1 vote
0 answers
45 views

Scheduled Job Is Not Running

I have written a REST API request that passes the response body to a class to deserialize it into a wrapper class. That rapper class then passes a list of records into a batch class incrementally so ...
user avatar
  • 13
0 votes
1 answer
48 views

I try to do callout to my apex rest service from first to second dev org, but got CalloutException

String endPoint = 'https://wise-otter-ngj5eu-dev-ed.salesforce.com/services/apexrest/v1/getAccounts/'; Http h2 = new Http(); HttpRequest req1 = new HttpRequest(); req1.setHeader('Authorization','...
user avatar
  • 13
0 votes
0 answers
141 views

LWC: Trying to get Access token

I am trying to get an access token from parent salesforce org. Here is the code which I am using: fetch('https://test-dev-ed.my.salesforce.com/services/oauth2/token', { ...
user avatar
  • 659
1 vote
1 answer
54 views

PUT method of @future(callout=true) gives us 403 Forbidden error for the added remote site

I'm working on the trigger for the custom object, when we update the custom mail field, it has to be updated in the third party api(Which I've added in the remote site settings). As we know @future(...
user avatar
0 votes
2 answers
89 views

queuable apex with more than 100 callouts

I am inserting more than 100 lead records via Data Import Wizard. I have the following trigger: if(Trigger.isAfter && trigger.isInsert){ if(Trigger.new != null){ system....
user avatar
  • 41
0 votes
0 answers
33 views

calling a post request with json given as params in the apex callout

our requirement is to call the post method in the apex class passing the json and the credentials dynamically. I have used a json wrapper class to parse the json. I need help in how to write a callout ...
user avatar
1 vote
1 answer
78 views

LWC - callouts from javascript controller or from Apex class?

I tried searching the differences between making callouts from LWC javascript controller or from Apex Class. Simple scenario is displaying an array of data in a datatable in a LWC. Are there any ...
user avatar
0 votes
1 answer
112 views

SSJS API call with form-data Content-Type

I am trying to make a request to an external API with SSJS and I have found this post where Eliot Harper posted a solution. I have made a lot of API calls using SSJS but with Content-Type JSON. Now I ...
user avatar
  • 31
0 votes
1 answer
774 views

Apex REST API GET method with request body?

How do you do a HttpRequest for a GET method with a request body? For some reason this GET method is getting converted to POST and is not successful. This is working via postman. Http http = new Http(...
user avatar
  • 372
0 votes
1 answer
61 views

Setting up a named credential for Salesforce REST Web Service

I'm learning integrations and found out about named credentials. I want to set a named credential for my Apex method which performs a callout to my scratch org: @AuraEnabled(cacheable=true) public ...
user avatar
11 votes
2 answers
250 views

Poll for long-running API responses - Solution patterns

Many REST APIs that people want to use from within Salesforce have asynchronous, long-running operation. For example An endpoint POST /api/resource to create a resource returning a handle Id to check ...
user avatar
-1 votes
2 answers
82 views

How to send multiple data to a service?

I am going through the apex integration module. I can see how we can send one record to a service. But what if we want to send multiple records to the service? Http http = new Http(); HttpRequest ...
user avatar
0 votes
2 answers
142 views

LWC Callout - which is the best option? [closed]

I am making a LWC component. It should make a GET callout to an endpoint and receive JSON data. I have 2 options: Make the callout in Javascript controller Make the callout in Apex controller My ...
user avatar
0 votes
1 answer
22 views

Can't Access 2nd Level in 'InvocableVariable' Object

I've got at flow that makes a callout and returns (to the flow) an object defined in apex (@InvocableVariable): public class MostOuter { @InvocableVariable public Inner1 var1; @InvocableVariable ...
user avatar
0 votes
0 answers
25 views

help me this error [duplicate]

public class StripeCustomer { @future(callout=true) public static void doGet(Set<String> customerIdSet) { try { List<Contact> updateConList = [Select ...
user avatar
0 votes
0 answers
126 views

Salesforce to Salesforce REST api integration to same org fails with 401 Unauthorized

The salesforce Field Service Developer Guide has this snippet of APEX designed to make a same-org REST call: String salesforceHost = System.Url.getSalesforceBaseURL().toExternalForm(); String url = ...
user avatar
  • 293

1
2 3 4 5
24