Questions tagged [callout]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
51 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
70 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
36 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
41 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
49 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
70 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
53 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
38 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
76 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
39 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
157 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
42 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"}, ...
0
votes
1answer
94 views

Schedule a Queueable class

i am quite new to salesforce so i am not sure about this, and i wanted to get a clear answer since i haven't found one yet. Can i schedule a Queueable class that basically makes a callout to get and ...
14
votes
1answer
707 views

Apex Framework / library for consuming REST services

To consume REST services there is a lot of boilerplate code needed: Build Apex Objects to model the responses Code to deserialize REST responses to those classes Handling of HTTP requests, responses ...
1
vote
1answer
39 views

Uncommited work exception in Queuable with Callback and Rollback

Is there a way to do all that Do Callout in Queueable Do Dml based on the Callout result Catch errors in 1 and 2. Rollback 1, 2 on error Report error via email and log in Custom object without ...
2
votes
1answer
143 views

How to access a Per-User Named Credential from Apex

My managed package Apex code is making callouts but I can't use a packaged Named Credential as the user also needs to be able to adjust the endpoint URL not only the username and password. I planned ...
0
votes
2answers
381 views

How to call a third party api from salesforce

I am into a integration project and its new to me, till now I have share the standard Salesfroce REST API, apex class to get and post data from third party website. Now the third party webite as a api ...
0
votes
1answer
151 views

Trailhead - Apex SOAP Callout

I'm new in salesforce and I'm learning through the trails. Doing the Apex Integration Services module, in the Apex SOAP Callouts unit I had to get info from outside salesforce. It asked me this: ...
0
votes
0answers
271 views

POST API: System.HttpResponse[Status: Forbidden , StatusCode=403 ]

I am working callout to post my JSON. When I test my JSON at PostMan it's all correct but when same JSON with my api, I got ' System.HttpResponse[Status: Forbidden , StatusCode=403 ]' ( 403 Confirmed.....
1
vote
0answers
60 views

How to use ampscript from Marketing Cloud to make a callout to salesforce rest api?

Anyone know how to use ampscript from Marketing Cloud to make a callout to salesforce rest api? The REST API I need to call from ampscript is listed below: /services/data/v45.0/query?q=SELECT ID , (...
1
vote
1answer
68 views

Test error condition in finish() method of Batchable class

Trying to figure out how to test error condition in the finish() method of this Batchable class. I am testing the error condition in the execute() method by calling it separately in the test and ...
1
vote
1answer
42 views

Test error condition in batch class with callouts

I have an Apex class with a callout (oregonDistricts.apxc) and I have two tests written that test both the success and error conditions. These tests are passing and the class has 100% code coverage. ...
0
votes
1answer
117 views

How to redirect to external url from apex from callout response

I have a class from which I do a callout in apex. After the response of the callout I want to redirect the user to an external url how can I achieve this?. I have only been able to redirect ...
2
votes
1answer
67 views

Future method is not invoked from PostInstall script

I'm trying to create a future method that makes a callout, and for some reason it's not invoked when the script is done. postInstallScript.cls: global class postInstallScript implements system....
0
votes
1answer
115 views

System.UnexpectedException: Invalid parameter value for parameter “Decryption Exception”

I tried to execute some code in a sandbox and I got an odd error message: System.UnexpectedException: Invalid parameter value '****' for parameter "Decryption Exception". Looks like it happened ...
0
votes
0answers
32 views

Uploading CA-Signed CRT to Salesforce?

I have an existing CA-Signed Certificate (CRT) given to me by my client, and it is needed to be able to make callouts to their external system. I have not found a way to be able to upload a CRT to ...
0
votes
2answers
36 views

Parse JSON using APEX provided JSON Methods

Salesforce rockstars! I'm in need of some help, and thank you in advance for taking the time to review my question! I'm pretty new to Java/Apex, and most of the work I do is with internal Salesforce ...
1
vote
1answer
31 views

Prevent parallel executions of flow element

I have a screen flow that is included in a lightning record page. At some point it executes a callout to an external system. The scenario that I would need to avoid is to have multiple users open the ...
5
votes
0answers
247 views

Sync with Pardot by Apex Trigger | Duplicate send to Pardot button in Apex

I have Pardot installed in my SF sandbox and it is connected to a Pardot Sandbox. [Use Case]: If a prospect is in the recycle bin in Pardot, then it does not sync with Salesforce. If from a ...
0
votes
0answers
38 views

Getting Bad Request from Post request to SharePoint Rest API from APEX

Hi i am doing a post request for delete a folder in sharepoint from salesforce i am using below code string Authorization = 'Bearer ' + spa.basicAuthCallOut(); HttpRequest req = new HttpRequest(); ...
0
votes
1answer
122 views

REST Integration - JSON Serialization/Deserialization alternative to wrapper class

I am building a REST integration between two Salesforce Environments. One environment will be used to setup and stage Data and when ready the Integration will be able to push data from the src to the ...
0
votes
2answers
148 views

I am not getting refresh token on outh2.0 using Connected App in salesforce

I created one connected app in Salesforce. I am doing every time two callout one for outh2.0 and another for actual apexrest callout. I want to avoid outh2.0 callout every time. The following solution ...
1
vote
0answers
53 views

MetadataService in apex overriding the IP ranges on Profile instead of adding the new onces

I have requirement to update ProfileLoginIpRange on the profile. Lets say there are 5 IP ranges already added on the profile and I want to add 1 more to it. Code Used, MetadataService.MetadataPort ...
0
votes
1answer
38 views

Execute HttpRequest as a different user

We have a scenario that user invokes a callout via lightning component button. Its an http request to an external service, and on response - there is an update in SF. We would like that the running ...
0
votes
1answer
168 views

call Messaging Queue every 5 Minutes [closed]

I want to make Integration between Salesforce and ActiveMQ(Is is a messaging server where the company send and save messages in this service). The Context: Every 5 Minutes should salesforce a ...
2
votes
2answers
110 views

Unable to do callout from PostInstall Script

As per the Salesforce documentation, Post-Install script can perform callouts using an async operation only. https://help.salesforce.com/articleView?id=apex_post_install_script.htm&type=5 So, I ...
0
votes
1answer
97 views

How to do a dependent callout from a future callout

How do I send a future callout to an external system inserting an parent object and as soon as I get the response back with an external id send another callout with a child object to an external ...
1
vote
2answers
108 views

Make http callout in batch after insert actions

I have a batch job with http callout enabled, in the execute() method, the code logic goes like: global void execute(Database.BatchableContext BC, List<Object> scope){ List<CustomObject&...
0
votes
2answers
474 views

Yahoo API callout failing

Below code was working fine few days back. Suddenly stopped working and throws error. String endPoint = 'https://query.yahooapis.com/v1/public/yql?q='; String queryUrl = 'select item.condition from ...
1
vote
1answer
190 views

MetaData API and Tooling API

Is it possible to get below things using Apex: I want to get field Updates that are used in a particular or all WorkFlow rule/s. I want to get Workflow rules and approval Processes that are ...
-1
votes
1answer
55 views

Chunk Account list into List<List<Account>>() based on a condition

I am having trouble with a small piece of code. I am calling an API, with List of accounts address. API is working fine, but it gives error when URL endpoint length exceeds 3500. I have a look on ...
0
votes
1answer
54 views

How to execute class or method after update external id from post callout

I have a custom object in Salesforce with a set of fields. Some of the fields I sent over by an invocable method which calls a future method to send the first set of fields to entity in an external ...
0
votes
0answers
33 views

Authenticated Callout to Webservice using SSO

We are facing the following problem. We need to make webservice callout through Mulesoft in a way the user is making the call is not a service user, but the logged one: Both Salesforce and ...
1
vote
3answers
247 views

Increase the callout time limit from 120 seconds to more

I am calling a REST API from my Salesforce instance which generally takes 100-150 seconds to process and return the result. The cumulative apex callout time limit is 120 seconds. Is there any way ...
-1
votes
2answers
80 views

Iterable Batch Apex

I want to write a batch class and need to make a webservice callout from it. Once the response is returned in Json format. I want to process the same into objects of salesforce. So I know how to make ...
0
votes
0answers
95 views

Can APEX Capture Cookies in Callout HttpResponse?

I'm trying to post data from my org to a third party using a REST API they've provided for us. The process for this is: POST client_credentials (client_id and client_secret) to obtain access_token ...
-3
votes
1answer
378 views

I am getting error System.HttpResponse[Status=Server Error, StatusCode=500] for the following code [duplicate]

I am runing my code from anonymous window HttpRequest req=new HttpRequest(); Http http=new Http(); //Header req.setHeader('Content-Type','text/xml'); req.setHeader('SOAPAction',''); //Body String ...
3
votes
1answer
108 views

Mock REST and SOAP callouts in the same method

I'm trying to figure out how to test a controller method that does both REST and SOAP callouts in the same transaction. Here is the pseudo code: HelperClass public static void restCallout(){ // ...