Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
5

There are two adaptions you need to make to get your example to work: Supply the payload as string using Stringify(payLoadDeletion) Supply the headerValues as Array: var headerValues = ["Bearer " + accessToken];


4

If you want headless, no-interaction authentication, implement the JWT Flow. You'll authorize with a private key and a username, no password. If you "pre-approve" specific Profiles and/or Permission Sets on the Connected App you build in Salesforce, no user interaction of any kind will be required. The alternative would be to implement another flow, like ...


3

This is fairly easy to test using Workbench I used this PATCH REST command /services/data/v45.0/sobjects/Foo__c/a094000000P3BVp with this body: { "some_datetime_field__c" : "2000-01-01" } and the field in the Foo__c record is updated to 2000-01-01T00:00:00Z, displaying in my (Pacific) timezone as 12/31/1999 4:00 PM


3

I made some investigation and think that to create/update Automation using REST, it is needed to use .json payload in this format: { "id": "e906af34-4a19-42e9-9ce2-ac6413a77a09", "legacyId": "X0p0TVdZSUxWZ09sVEV0dlJiTk5CUToyNTow", "name": "Maciej_testAut_20190513_1721", "description": "ddddd", "key": "Maciej_testAut_20190513_1721", "...


2

It doesn't matter. You can place it in either org, or even one in each org if you wanted to. Note that only the org in which the Connected App is created in can change the Client ID/Client Secret.


2

Create a query Bulk API job for the Attachment object using the XML content type. Use the query SELECT Id, Body FROM Attachment. The result will contain the Body element with the contents base64-encoded. Unfortunately, PK chunking is not supported for the Attachment object, and with a lot of Attachment records the bulk job may fail with "Retried more than ...


2

Using a chunk size of 2000 will automatically add a filter on Id to your WHERE clause such that there are 2000 rows in each batch before any other filters in your WHERE clause are applied. If you had 10,000 total Accounts in your org, using a chunk size of 2000 will result in five batches being created even if four of those batches will contain no results ...


2

It is not possible, but if you want to remove a contact, Contact Deletion Framework will remove a contact key across all sendable data extensions


2

While %%=v(varName)=%% works, the v() function isn't necessary. All that's required is %%varName%% outside of an AMPscript block or varName inside a block. If the value you're referencing doesn't exist, the email won't compile or preview and your send will get aborted. My rule of thumb -- no naked personalization strings. I never use %%varname%% notation ...


2

ContentDocument is not directly created - if you submit a ContentVersion without setting ContentDocumentId, it will create a new ContentDocument. You won't get the ContentDocument's Id in the response, so you'd need to retrieve or query the new ContentVersion to get the ContentDocument's Id for creating ContentDocumentLink records. But, when creating a new ...


2

If you're creating a REST API in Salesforce that other systems call into, then your result depends on how the variable is defined in your request class. If your request type serializes the field as a a datetime variable - it'll do what @cropredy says. However, if you serialize it as a String variable, the JSON will serialize, but upon inserting the record, ...


2

I think this is both an AWS and SF question, but I think I can help. You're trying to Authenticate via HMAC. It depends on the SHA1 Algo and the Content-MD5 header that is later base64 encoded. Re: Keys/ Secrets: In AWS, Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) and a secret access key (for example, ...


1

100+ from off platform if you are doing that should be fine . If you are using apex callout , then a single context allows only 100 callouts , so you might want to do this in a batch apex with a batch size of 50 .


1

api.status.salesforce.com deals with instances of Salesforce itself rather than individual orgs such as yours. Example: https://api.status.salesforce.com/v1/instances/na14/status will tell you what's running on NA14 instance You want https://mobilecustomdomain.my.salesforce.com/services/data/... See docs for more info.


1

There is a typo in your rest resource its not /services/data/45.0/sobjects/Lead/listviews its v45.0 /services/data/v45.0/sobjects/Lead/listviews


1

A lesson I've learned for incoming requests where structure varies over time is to do your own deserialization/serialization to avoid getting locked into no longer valid signatures (in managed packages). So something like this: @RestResource(urlMapping='/xyz/*') global with sharing class MyRest { @HttpPost global static void post() { ...


1

If the triggersenddefinition status is not being set to "Active" when specifying "Active" but being set to "New", ensure that there is not a validation issue with the email you are using in the content node. The easiest way to validate the email is to do a send preview within Content Builder, and reviewing any errors. Then do a patch call to set the status ...


1

I think terminology is missing here, creating a barrier to moving forward. Postman is just a tool that sends API requests. The first API request you are sending is authenticating via OAuth to obtain an access token. The second uses that access token to reach the Apex REST service. Any other API client must do structurally the same thing, although they may ...


1

Good question Salesforce has a native web to lead form This allows you to create leads and feed data into salesforce. it's easy to setup and doesn't require any authentication or javascript. If you have any logic that you want to apply to the lead, you'd do it in the before insert trigger... Here's some info for you. https://help.salesforce.com/articleView?...


1

If you are thinking only about Filtered Data Extensions from a Main Data Extension, then it is possible. You know that the fieldnames from the Main Data Extension (the DE that all filtered DEs were created from) will be copied to all Filtered data extensions. This makes it a lot easier because once you have determined all relevant DEs, you can perform the ...


1

There's at least a couple of things wrong here. request.setEndpoint('Callout:AppointmentTest/services/data/v45.0'); The endpoint /services/data/v45.0 does not accept PUT requests or requests to create an sObject. If you're trying to call an Apex REST service class, it is definitely wrong: the endpoint for an Apex REST service starts with /services/...


1

Do I have to list all the fields as parameters in the method or is there a way to use DOMElement as a parameter while defining the method and then I go about extracting the data out of it. One Approach is like declare your http post method with no parameters and when you pass the XML request body it will be copied in the RestRequest.requestBody as Blob.Then ...


1

parsing/deserializing Dealing with XML in Apex is a pain. The best approach that I've found so far is to use the classes in the Dom namespace, Dom.Document and DOM.XmlNode, in combination with a class structure that mimics the schema of your XML. Think of it like creating the class structure that you'd need to deserialize the data if it were JSON. The ...


1

My 2 cents First of all i think callout is a wrong choice here. If you are looking at bulk insert of records i would ask the external system to use bulk api to hit salesforce and insert records. At the least if they cannot use bulk api they can use rest api to hit salesforce If you are still hung up on callout you will most likely hit other limits like ...


1

I can see 3 potential solutions to that: Automation: As per Eliot's excellent (as always) suggestion, you can put it in an Automation. Now, the status icon has been unreliable for me in the past, and who wants to check the status the whole time anyway? Instead, you can also set an email notification when the automation has ran. When you are on your ...


1

I would suggest using the Bulk API Introduction to Bulk API Bulk Query Walk Through a Bulk Query Sample Trailhead: Using Bulk API


1

What is wrong with the above configuration? The Sandbox Org Auth. Provider should have been configured to use: Authorize Endpoint URL: https://login.salesforce.com/services/oauth2/authorize Token Endpoint URL: https://login.salesforce.com/services/oauth2/token Which are the URLs for production login, allowing me to authenticate against the Production Org ...


1

Based on the comments, it seems you are using a Guest User here to be able to get a Session Id and utilize that in your code using request.setHeader('Authorization', 'OAuth ' + UserInfo.getSessionID()); The error INVALID_SESSION_ID you are receiving is expected in that case. Refer to Guest user session ID returned NULL in UserInfo.getSessionId() knowledge ...


1

It is possible to generate the email in APEX and not send it using renderStoredEmailTemplate method on the Messaging class. This will allow you to specify the Email Template Id as well as the objects where you need to populate the merge fields from and will return the HTML Body as a string. Since it is a string, you can push it to your system either via ...


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