Questions tagged [callout]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Attach pdf only the visual page but not the dynamic content

I have a callout function in a controller that calls an external api. I gather the info and I analyze it with some loops. The content is displayed in a visual page that I render as pdf. Until here ...
1
vote
1answer
23 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
25 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
35 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
81 views

Callout from Trigger using future or queueable [on hold]

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
26 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
28 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
23 views

Issue calling a Sharepoint O365 object in Salesforce Apex

I'm trying to retrieve an object from Sharepoint Online in Salesforce Apex and I keep getting the following raw response from O365 when I attempt to call it: { "error": { "code": "BadRequest", ...
1
vote
1answer
34 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
19 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
48 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
20 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
33 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
44 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
22 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
46 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
30 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
86 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
27 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
35 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
65 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 ...
0
votes
0answers
16 views

Implementation approach suggestions for a realtime Callout

Our data model for Contract is like below: Contract Contract Line Item (Each Contract Line Item corresponds to an Opportunity Line Item) Each Account(Customer) is associated with a Contract ...
0
votes
1answer
48 views

STATUS_CODE returned for the response: 403 STATUS_MESSAGE returned for the response: Forbidden

Can someone please guide me how to resolve the access forbidden 403 status code error ? What can i do to at least hit the end point? I am executing the code anonymously in developer console string ...
0
votes
1answer
40 views

How to deserialize the following JSON to get the list of values? [duplicate]

I have used the code below to deserialize the json but throwing an error. Map<String,Object> root =(Map<String,Object>)JSON.deserializeUntyped(res.getBody())); "Callout error Invalid ...
0
votes
1answer
42 views

Consuming a REST api in Salesforce

I need to create an integration between Salesforce and a third party service. Essentially Salesforce will trigger a callout to the third party when a status change occurs on a custom object record. ...
3
votes
1answer
56 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){ ...
5
votes
0answers
148 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
1answer
45 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"...
0
votes
1answer
29 views

Batch with multiple callout to get record

Is it possible to create a batch class that makes x calls to take n records at a time and run the dml of these records? For example. I call the service. I read the first 200 records and do dml, then ...
0
votes
1answer
28 views

How can I do a 2-way real time sync with large data sets from external database to Salesforce

I have a requirement where I have to do a real time sync with an external database and salesforce. Objects that I need to sync Contacts, its notes and events. I have used Bulk API previously to push ...
-1
votes
1answer
55 views

TestMethod do not support getContent call [duplicate]

I have a requirement to send a specific report as an attachment on schedule basis. So, i have created a schedule class with future annotation to send.But now when i'm trying to setup apex class I'm ...
4
votes
1answer
148 views

Enqueue Queueable class multiple times

I need to do five different callouts from my trigger. I'm planning to use one Queueable class for all the callout using the parameter passed in the constructor. I'm not sure if it is possible, if it ...
0
votes
2answers
64 views

Using REST to update Salesforce record from Salesforce

I am trying to update a Salesforce record but I have to update it using an older version of Salesforce API (v44) due to some new standard behavior changes salesforce made. I am doing this by making a ...
0
votes
1answer
16 views

I'm getting an error “Unknown property 'PDSrestCall.userProfile.ibmUniqueId'”

I'm trying to display my deserialized JSON on my VF page but I get Unknown property 'PDSrestCall.userProfile.ibmUniqueId' Help Please. PS i removed the API endpoint for security purposes. Here is my ...
0
votes
1answer
38 views

Flow and synchronous callout

we have a flow where the user can enter data to create a record of a custom object. That works fine. But requirement is that new record must be transmitted to an external system and user should get ...
1
vote
1answer
57 views

How to pass an attribute to XML message in SOAP webservice callout

I have a WSDL that I have imported in Salesforce and parsed using the WSDL2APEX option . It generates a sample message like below. <LineItems> <LineItem> <...
0
votes
1answer
34 views

Is it possible to decompress zlib data in Apex?

I have a data provider who is passing base64 encoded zlib blobs to my Salesforce environment. I will be receiving this data into an Apex controller, and I already know how to convert the base64 ...
0
votes
1answer
38 views

Apex call-out 404 not found error on Developer console while it works perfectly when the request is sent through postman

This is the request, I've added the URL to named credentials. What am I doing wrong!! Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('Callout:AppointmentTest/...
0
votes
1answer
48 views

Convert hierarchically structured JSON data into a list of sObjects Contact

My webservice contains hierarchical data so that I cannot transform it into an sObject when making the GET request. Here is an example for Contact, but the phone number is grouped so that I cannot ...
0
votes
1answer
69 views

How to elegantly handle asynchronous pushes from Salesforce to external system via a REST API [closed]

The key word in the question is elegantly; I'm an experienced developer familiar with the mechanics of asynchronous programming, REST APIs, database triggers, programming idioms and design patterns. ...
0
votes
1answer
52 views

JSON response structure change

JSON response from the callout is changed. 1) Current JSON response : { XYZ { } DEF { } MNO { } } Now its changed to : { ABC_Stage{ XYZ{ ...
0
votes
0answers
34 views

Platform Events from flow are processed one by one or in bulk?

I know events are processed asynchronously in the subscriber. Currently we have a flow that creates an event (and publish it), We are creating a trigger that listens to that event and invokes a http ...
0
votes
2answers
65 views

How to get the response data in @future(Callout=true)

I need to catch the response of a callout method and insert it into a database. But what the problem is, the callout method called from a trigger. Therefore, I have to add the annotation @future(...
0
votes
0answers
37 views

Lightning Page - You have uncommitted work pending. Please commit or rollback before calling out

I have some issues with my lightning Page. There are some lightning components who are filled with some data that came from more than one service. There is a component Asset Contact, the data from ...
0
votes
2answers
112 views

PATCH Issue - {“Message”:“The requested resource does not support http method 'POST'.”}

I have a callout that is having an issue with it's POST. I have seen a couple of work arounds for this issue but none of them seem to work with my integration. req.setMethod('POST'); req.setHeader('...
1
vote
0answers
39 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 ...
1
vote
1answer
27 views

Real time synch with external application on insert and update of frequently changing records

In order to synch very large amount of frequently changing data to an external system, what will be best way to do it ? We can't use trigger or schedule batches as these will fire so many times that ...
0
votes
1answer
25 views

JSON structure in Salesforce?

How would i store this kind of JSON structure in salesforce? "elementOne": [ { "itemOne":"valueOne", "itemTwo":"valueTw0", "embeddedElementOne":{"embeddedItemOne":"embeddedValueOne"}, ...