6

Well, this is quite common requirement. Lets assume a sample Rest Service. @RestResource(urlMapping = '/submitcontact/*') global class GenericContactCreator { @HttpPost global static void doPost(Contact con) { //Can be Sobject or some custom apex wrapper //do something } } If someone sends marformed JSON/XML the code wont even reach ...


4

For any external app to be able to invoke a REST API in Salesforce, it needs to authenticate itself using OAuth 2.0. The answer to your question is very well explained in Understanding Authentication Before making REST API calls, you must authenticate the application user using OAuth 2.0. In summary, you will need to: Setup a Connected App Use the ...


3

You can't perform CRUD operations on metadata in the same way you can with standard sObjects. They're part of the configuration of the system, and you've got to jump through some more hoops in order to mutate them because of their wide-ranging effects on the operation of your CRM. The API that you'll need to work with to make these updates is the Metadata ...


3

Out of the box, there is no report that tracks "failed" custom REST API calls. Best practice is to create your own logging service (examples: 1 2) with one or more of your own custom objects that track any events of interest to you. Recommended implementation: have a @future method or an event bus (Platform Events) asynchronously send a message to your ...


3

"Authentication without credentials" is fairly close to being a misnomer. By definition, if you want to authenticate a caller, you need some kind of credentials, and the best and most secure solution is to use a Salesforce user authenticated via OAuth. There is another option that is suitable for specific situations, but is not a general-purpose replacement ...


3

The answer is "yes". There are a number of different ways to deal with it, depending on the UX you want, how this process should be initiated and the level of coding you are happy to do. My immediate recommendation would be to use a Screen Flow (this is covered in the Trailhead for flows), perhaps initiated from a Lightning Action that you add to the global ...


2

The documentation states: Objects are created in the order they’re listed. The SaveResult objects are returned in the order in which the create requests were specified. As such, we do have a documented guarantee that the order will be preserved.


2

Here's an example of something I've done before to retrieve the HTML of an email. I then combined the email code with data from a DE to create my own "preview" in a CloudPage. Adapt for your own use. <script runat="server"> Platform.Load("core","1"); // Example of HTTP GET/POST to SFMC REST API to retrieve HTML of an email try { var ...


2

Yes, it's allowed; I just tried this in my org and it worked successfully. Whatever is going on here is not related to providing the same ID multiple times.


2

How many records can be sent to Salesforce ? 200 per transaction is the general limit for most APIs. The Bulk API supports up to 10,000 records per file. How many records can be consulted to Salesforce ? As much storage space as you have allocated. Most records cost 2KB each, so 500 records per MB of storage. For a Developer Edition, this is a maximum ...


1

Two things: First: The single quotes must be URL encoded. The URL code for a single quote is %27 so like this: https://my_org_name.my.salesforce.com/services/data/v45.0/query/?q=SELECT+Id+FROM+Account+WHERE+Name=%27SHOP%27+AND+RecordType.Name=%27Property%27 Second: The dot in RecordType.Name is most likely the root of the problem. Normally you should not ...


1

Apex doesn't allow multiline string literals. You'll need to quote that JSON line by line, and add newlines via '\n'. request.setBody('{ \n' + ' "Fields" : [{ \n'+ ' "Field" : "Name",\n' + ' "Data" : "Palo Alto Networks"\n'+ ' }\n'+ ' ] \n'+ ' } \n' );


1

301 is not an error. It's a redirect. What you need to do is read the response headers for the Location header, and provide all the other original headers and cookies, if provided by the HttpResponse header.


1

There are two ways of achieving this: Create an APEX trigger in Sales/Service Cloud, that initiates a SOAP-API call to Salesforce every time the field is changed. This solution would immediately update the publication list. Synchronize the checkbox fields to Marketing Cloud via Marketing Cloud Connect and create an Automation that checks for differences ...


1

You can query CustomNotificationType in Tooling API, as the article suggests. In workbench you can do this by navigating to utilities->REST Explorer and then executing the following GET request: /services/data/v46.0/tooling/query?q=Select+Id,CustomNotifTypeName+from+CustomNotificationType


Only top voted, non community-wiki answers of a minimum length are eligible