New answers tagged

-1 votes

Call Salesforce API from Apex and not fail Security Review

Salesforce Security recommends using OAuth instead. Just saw the post in "AppExchange Partner Security Review" user group for the Salesforce partners.
1 vote
Accepted

How to create system object definition of enum of strings using OCAPI

This is not supported in the OCAPI. Ran into this limitation too.
0 votes
Accepted

Using SSJS to report on email sends using the Single Send ID as a URL parameter

To get a JSON return, you would have to build your own API endpoint to accept this in via a Code Resource. From there you would use either the Core function or WSProxy via Send object to retrieve via ...
  • 29.1k
0 votes

API POST not working on executeAnonymous BUT IS working on Postman

via: https://stackoverflow.com/a/36284027/19789973 I found out it is the whitespace in the text string causing the issue. I Replaced this using '%20' and the POST was successful! For example: text:&...
1 vote

How to fetch "Customize Application permission" values for a user through an API call

A query like this can answer that question: SELECT COUNT() FROM PermissionSetAssignment WHERE AssigneeId = :UserInfo.getUserId() AND PermissionSet.PermissionsCustomizeApplication = true If you get ...
  • 451k
1 vote
Accepted

How to generate Access token dynamically and use in POST Webhook call from Salesforce?

You'll use a Named Credentials to generate the OAuth session, then use that in your webhook callout code by replacing the current URL https://app.onetrust.com/ with the Named Credential name callout:...
  • 451k
0 votes

Metadata API : How to get the translated values of picklists of my object

Not sure if this is the latest change or not. Buit to get the Translation value for the picklist you have to include 'CustomObject' along with 'CustomObjectTranslation' to get the Translation value ...
0 votes

Is it possible to pause an automation that is already running using SSJS in SFMC?

To stop an automation that is currently running you will need to use the following REST API (This is what is being used in the UI of SFMC as well with the 'stop' button.) It is undocumented, but is ...
  • 29.1k
2 votes

Does Salesforce support the Client Credentials Grant for OAuth?

The JWT Bearer Token Flow is still a very valid alternative for server-to-server communication, but since the Winter '23 release the Client Credential Flow is now also supported by Salesforce. The ...
  • 2,632
3 votes

Call Salesforce API from Apex and not fail Security Review

This is part of the JWT Token Client code from my PoC. This code uses a Named Certificate. This is great for testing in unmanaged code. I'd need to find another way of providing the certificate from ...
0 votes

Should I be using a better OOP pattern (DI, Factory?) for this API callout with a big wrapper class

One thought public class ChargeOverride { public String productRatePlanChargeId; public ChargePricing pricing; public SubscriptionRatePlanChargeCustomFields customFields; public EndDate ...
  • 64.6k
9 votes

Call Salesforce API from Apex and not fail Security Review

The OAuth flow we used for our AppExchange app is Web Server Flow for Web App Integration. There are various types of flows that can be used as per your requirements; we used Web Server Flow for Web ...
  • 1,189
2 votes

Call Salesforce API from Apex and not fail Security Review

IMHO You need to create a connected App inside the managed package; better if you use a certificate and enable the Oauth flows. then implement the JWT bearer flow to get a new access token previous (...
  • 1,518
0 votes

Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') in very simple Callout

If you are using asynchttpclient, you can use this. Response response = this.asyncHttpClient.prepareGet(dBoxSyncConfig.getUrl()) .setBody(requestBody) .addHeader(...
1 vote

Python - Constructing SOAP Packet - Requests Library

Give this a try: url_ = f'https://{subdomain}.soap.marketingcloudapis.com/Service.asmx' soap_payload = \ """ <?xml version="1.0" encoding="UTF-8"?> <s:...
  • 28.7k

Top 50 recent answers are included