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

New answers tagged

0

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

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 .


0

I used a Custom REST API and populated OwnerId via the apex logic of the Custom REST API


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, ...


0

Make sure your connected app is set up in Production, its correctly provisioned and permissioned and client_id/client_secret values are correct. Password should contain the security token Login URL and grant_type parameter are correct. Take a look at the docs, they spell this out. If your authentication use case is service-to-service (no user interaction), ...


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 ...


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() { ...


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 ...


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];


0

I wonder since I have not incorporated consumer key and consumer secret in my code above, how does that REST class got connected to my "Connected app" in Salesforce and the specific Consumer key and secret coming from the connected app? You need a valid "access token" to be able to access your API resources. And that you got this by authenticating and ...


0

The rest Class that you have created is for the business logic that needs to happen. Typically what happens when external vendors needs to invoke a rest service in salesforce is that, we create connected app in salesforce and based on the oAuth flow we choose we need to provide one of username/password/certificate along with client id/client secret to the ...


0

there is a Salesforce Labs app that can now accomplish copying the canvas from one BU to another


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 ...


0

Workbench does not run on the Salesforce core platform; it runs on Heroku. For that reason, Workbench, the Salesforce org itself, and any connections you make locally using an application like Postman come from different IP addresses, all of which must be allowed for the user under which you are authenticating. It sounds like your org has whitelisted ...


0

Please check the Login IP ranges in the profile of the User you're using to make this callout. When you execute it from Workbench, it runs in your User's context.


0

Maybe you can have different clients serving different purpose for the same user or for the other way around with the existing client with which you got the Authorization code, extend that client to handle that job as well


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?...


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", "...


0

Go to campaign monitor the API key from the Account Settings page when logged into your Campaign Monitor account. Below is the code for cURL and Apex that will help you get started. Note that this uses BASIC authentication, not oAuth. The header construction is the major difference here. your curl will look like this curl -u "YOURAPIKEY:x" https://api....


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, ...


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


0

You can use my XML Serializer. Here is the link to it: https://github.com/skolakan/Apex-XML-Serializer Here is how you can approach it 1. Create Apex class that matches the XML Since yours is a simple XML, you can just convert it to JSON (there are many online converters for ex:https://codebeautify.org/xmltojson and use https://json2apex.herokuapp.com/ ...


0

There is no reporting on API limits within the marketing cloud. For incoming calls if your API process is causing an issue they will be ratelimited


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 ...


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


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 ...


0

No, there is no way to do that but you may explore more about it doing R and D But When you upload the csv file then the datasets itself create a json of it .


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 ...


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 ...


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 ...


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/...


0

you should be creating it in target org. Rule is simple: whom to access- connected app should be setup there who is accessing- consumer or client


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.


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

We push data from SAP HANA into tableau and use sparkler to push that into a VF page. But what you're doing... If you want sfdc to consume it as a service then make a WSDL and upload to SFDC, that will create an Apex class for you to use. Now as for getting that to display... Ehh someone else that knows lightning components can chime in.


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 ...


0

I haven't received any response here, nor at developer.salesforce.com/forums so far and this is disappointing and surprising to me. Whatever, here is my solution with a guide inside: https://github.com/kahramanbayraktar/sage-people-api https://github.com/kahramanbayraktar/sage-people-api/blob/master/how-to-use-sage-people-api


0

I realize this question is quite old, but since it has come to the top of the queue, I thought I'd respond to it. From the data you've provided: //Time the query actually occurs during your call: 15:03:54.188432 > GET /services/data/v39.0/query?q=SELECT%20Id%20FROM%Account%20LIMIT%201 HTTP/1.1 //Time when "success" returned from your REST call 15:04:...


0

You need to wait until the chunking is complete before closing the job. The first batch will create all of the chunked batches. Poll this batch's state until it is NotProcessed. Then it is safe to close the job and let each of the automatically created batches complete.


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 ...


1

Here is my updated answers: I need to carry a pair of flags in the record to prevent the correlation ID update from looping back into the trigger causing another redundant call to the external system. To prevent recursive trigger call from future callout execution and updating records after callout, you could check System.isBatch() and System.isFuture(), ...


1

The UI API is not one of the supported API resources for the sObject Composite API: Composite is supported for the following resources. All sObject resources (vXX.X/sobjects/) The Query resource (vXX.X/query/?q=soql) The QueryAll resource (vXX.X/queryAll/?q=soql) The SObject Collections resource (vXX.X/composite/sobjects). Available in API ...


4

An example is included in the help docs: https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/retrieving_data_from_a_data_extension.htm <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header>...


2

Unfortunately no - this is not possible via REST API. Almost all things inside of Email Studio are still only accomplished via the SOAP API. See below (ref) for example of SOAP envelope needed to create a DE. <soapenv:Body> <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"> <Options></Options> <...


Top 50 recent answers are included