Questions tagged [rest]
The REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.
857
questions
0
votes
0
answers
52
views
'activityInstanceId' field on execute request of a custom activity and where to find it in journey history?
I have a custom activity that uses activityInstanceId field from request as unique id for each request. I now need to somehow connect that id that I save on my side to contact for which activity was ...
0
votes
0
answers
32
views
Create and populate custom object in Salesforce
I have built a custom survey system, and I would like to see the option on saving the results in Salesforce, on a custom object. In general, the object will have the following fields:
Start date (...
-1
votes
0
answers
41
views
Iam using postman to create opportuunity its showing The requested resource does not exist [closed]
Url :: https://canarabank--dev.sandbox.my.salesforce.com/services/data/v58.0/sobjects/Opportunity
Body ::
{
"Amount" : "1000",
"Applied_Loan_Amount__c" : "...
0
votes
2
answers
70
views
Nested query works in salesforce inspector but not in request with query in url
I'am trying to get(request) Accounts with some informations from child called Services__c.
When im performing query in inspector it works fine
SELECT Legal_Name__c, Name, BillingCountry, (SELECT ...
0
votes
0
answers
23
views
I want to update part of an email in SFMC using restAPI
I am looking at updating only part of an existing email using the following Rest API call.
https://et_subdomain.rest.marketingcloudapis.com/asset/v1/content/assets/
I am able to update all the content ...
0
votes
1
answer
60
views
Getting data extension eventDefinitionKey and Id
I'm creating a journey through the journey REST API. I want to add a data extension to that journey. To add a specific data extension, as far as I can see, I need the data extensions ...
1
vote
1
answer
65
views
Test Coverage issue for a simple rest-service class
Just get started with Trailhead but got stuck with one challenge. It requires you to write an apex class to implement a REST GET service to retrieve an account and associated contacts. Then you have ...
-1
votes
1
answer
216
views
How to download a PDF file which is present in Salesforce using Rest Callout
I have to create a RestResource apex class which should let the user to download a pdf from salesforce.
I have written the following code, but I am not sure how to proceed further to let file ...
0
votes
1
answer
131
views
Proper way to store a .pdf from a REST callout using ContentVersion/ContentDocument
I am working on an integration where I am provided a URL + document ID, which should send back a .pdf, I retrieve it using a GET, and then I take the blob of the pdf and create a ContentDocument and ...
-1
votes
1
answer
261
views
Access to fetch has been blocked by CORS policy - LWC
I'm having the following error once I try to do a POST in an outside link of my Salesforce org,
So, I've already added this URL to the "CSP Trusted Sites" and the "Remote Site ...
-1
votes
2
answers
43
views
Accessing the Deserialized JSON list's values and modifying the null values
I have deserialized a JSON data into a list.I want to access the null values present in the list for any wrapper variables and modify it to an empty string.
Deserialization Code:
lstSeeds = (List<...
0
votes
0
answers
23
views
REST - Journey with DE as trigger
In my app i have a api call which creates a new dataextension through the soap API. When that is done I want to create a new journey with that DE as a starting source. I'm able to create the journey, ...
0
votes
0
answers
95
views
Login Rate Exceeded - external service calls Salesforce using client_credentials
Introduction:
We have an external Java service that communicates with Salesforce instance.
There is a connection using OAuth2.0 client_credentials. For this purpose we have created connected app.
Use ...
-1
votes
1
answer
715
views
Update multiple records at once - REST API Call
Requirement is to update a single record at once, for which I am using a simple PATCH request using REST. The request is being made from an external platform
Sample:
URL: /services/data/v56.0/sobjects/...
0
votes
1
answer
54
views
Salesforce CMS Search Rest API Cannot Work
We got an error about CMS search by Rest API
We run this url in workbench, always report errorCode: MISSING_ARGUMENT message: Specify a Library.
/services/data/v57.0/connect/cms/items/search?...
0
votes
1
answer
405
views
Composite API to delete multiple records by an external id
I have been looking for an example of what @sfdcfox suggested for this thread
https://salesforce.stackexchange.com/a/332678/133263
"The first subsequent would be a get, the second the delete call&...
0
votes
1
answer
201
views
Delete ContentDocument through REST API permission
I'm trying to delete a ContentDocument, added as attachment in an Account, throught REST API. I'm able to retrieve the ContentDocument, Get the Document Data (requesting ContentVersion as described ...
-1
votes
1
answer
166
views
How do I send a Callout after a DML operation and return the data to Flow [duplicate]
I'm new to Salesforce and I am struggling to resolve an issue with Apex. What I want to do is create a flow that activates daily and sends a GET request to an IAP protected server (I can't just use ...
0
votes
1
answer
192
views
How to use Web Server 2.0 OAuth flow with new "Salesforce API Only System Integrations" profile user
I am using recently announced Salesforce Integration license user for an integration using Web Server 2.0.
As per the Web Server 2.0 flow, I need to first obtain the Authorization Code. To get the ...
-1
votes
1
answer
52
views
RestResource HttpGet close new tab
I'm currently trying to work with an integration with an external API (Lansweeper). When trying to authenticate the API, I'm running into an issue where they authenticate through an external url (...
0
votes
0
answers
46
views
Securing API access to Salesforce from a custom mobile app
Custom mobile application sends requests to a custom REST web service on Saleforce. The request contains an external ID, which is saved on the Contact standard object along with customer data. This ...
1
vote
1
answer
149
views
Most Appropriate HTTP Method for Query with Optional Upsert?
I have inherited a REST endpoint that has one key action it performs, named find. This action will generally just query for any matching resources, rank them, and return the most favorable result. ...
-1
votes
1
answer
90
views
Batch Import ContentVersion data via the REST endpoint
I am trying to upload a large amount of photos for Salesforce via the /sobjects/ContentVersion REST endpoint. Currently I am able to use this endpoint to upload one photo at a time. Is there a way to ...
0
votes
1
answer
308
views
How To POST Request To PHP Endpoint And Process Values
I'm trying to send data from Salesforce to an endpoint hosted on an external server. The endpoint is written in PHP that will insert a new record into an external MySQL database.
I've got the ...
-1
votes
1
answer
886
views
Casting from a JSON body to a List of a specific Object
I am trying to convert JSON, which is something like this:
[{"_id":"55d66226726b611100aaf741","replacement":false,"quantity":5,"name":"Generator ...
1
vote
1
answer
1k
views
Salesforce Platform API Versions 21.0 through 30.0 Retirement
I received an email "Salesforce Platform API Versions 7.0 through 30.0 Retirement".
I am new to my org and I managed to see the list of installed packages,
I then run a query to get the list ...
0
votes
0
answers
64
views
set VF outputText value using REST call
I'm trying to generate PDF from richtext(which is not saved in SF) that I get from Flow via InvocableMethod.
Im not able to set it as VF URL parameter because in that case the URL size will over the ...
0
votes
0
answers
247
views
Salesforce : How do we block a User from using query with Rest API?
We are integrating an External System (Drupal) with Salesforce . The corner case being , A user who may get access to the shell of the server the Drupal Instance is running , may have access to all of ...
0
votes
1
answer
156
views
Nested Json not detected
I'm trying to parse a nested JSON through a REST Api but somehow it is not getting read. For example: I'm passing a JSON like this in my request body.
[
{
"first":"I like sfdc",
&...
1
vote
1
answer
85
views
Salesforce retirement from v21.0 to v30.0, generated ApiTotalUsage file from eventlog files, how to know where the resource is used
I have generated ApiTotalUsage file from eventlog files.
I followed the steps mentioned in this article and generated the ApiTotalUsage file
https://help.salesforce.com/s/articleView?id=000389618&...
0
votes
1
answer
220
views
Issues with SOAP API login callout
I have the following piece of code that used to work before:
Custom_Data__c cData = [SELECT Password__c, Security_Token__c, Username__c FROM Custom_Data__c WHERE Name = :Constants....
0
votes
1
answer
129
views
Authentication for Google DocAi Api in Apex
We try to integrate the Google Doc Ai https://cloud.google.com/document-ai/docs/drag-and-drop to send pdfs and receive parsed texts.
I am struggling with the authentication in Apex for the Api call.
I ...
0
votes
2
answers
130
views
JSON Exception "Illegal value for primitive" obtained during response parsing
I am calling a Webservice which returns the following as JSON response.
**REST Response** :
{"totalRowCount":1,
"hasMorePages":false,
"data":[
{
&...
0
votes
2
answers
416
views
Custom fields not being saved
I'm using propertybase to create contacts via salesforce (it uses apexrest REST API) and I followed this guide: https://help.propertybase.com/hc/en-us/articles/360003180752-WebToProspect-REST-API
I'm ...
1
vote
0
answers
31
views
How to use an Integration User with a REST site: documentation request
My app is a Lightning native Twilio integration that uses a REST site to receive data from Twilio.
I would like to run flows that are triggered by data created by these incoming http POSTs. However, ...
-1
votes
1
answer
90
views
Condition not checking after adding error condition in postman
I have created apex class to update existing records, and I am adding error code, but record is updating when I run it in postman. But if I miss any parameters, I have to show error which is given in ...
0
votes
1
answer
146
views
Create opportunity record in target org from source org
My company is using two different Salesforce orgs (org1 and org2). I have a custom object in org1, called Tender__c. I want an automation to create an opportunity record in org2 when the Tender__c in ...
2
votes
0
answers
1k
views
REST API: retrieving a report with more than 2000 rows
We are working with the Salesforce REST API to fetch reports.
When fetching more than 2000 records from a report how does the pagination work? Is there any querystring parameter to append to the URL ...
0
votes
1
answer
309
views
After Establishing connection from external system to Salesforce getting error
We have created a standard callout class to establish a connect between Salesforce to SMIT system, and then we have provided our Salesforce credentials (like clientid, client secret etc). They ...
0
votes
1
answer
320
views
API Callout via Connected App is Not working in React PWA but working fine in POSTMAN API
Im calling access token grant API from Postman Rest Client its working fine,but when Im calling the same via React PWA its not working error 307 is coming.
Connected App is built on UAT and Production ...
0
votes
1
answer
487
views
Call Rest API from Apex REST Class
I know it's possible to make Apex class methods available as a REST service with annotations. I also know it's possible to make a call to an external web service from an Apex class. Can I combine the ...
0
votes
0
answers
491
views
Is it possible to retrieve fields from SOQL in a simpler way?
I'm working with REST API, using endpoint /services/data/v53.0/query.
The question in place is: is it possible to retrieve requested fields API names present in SOQL?
Example. Get from SELECT Id, Name,...
0
votes
1
answer
943
views
How to trigger custom button by REST API call [closed]
I'm trying to achieve the following but can't seem to find a way to get it to work.
On a custom Salesforce object, there is a custom button present in the UI. Clicking on this button triggers an ...
0
votes
1
answer
401
views
Preserve order of params in RestRequest
In my RestResource, I need to validate the source of an incoming RestRequest. To do so, I need to create a hash using a concatenated string that includes the full request URL, including the query ...
0
votes
1
answer
245
views
Query for all Custom Apex Web Services "@RestResource"
I am looking for a way to query for all Custom Apex Classes that have a @RestResource annotation.
I am currently using the following SOQL query and filtering for anything that has @RestResource.
...
-1
votes
2
answers
1k
views
Disable "Generate new password and notify user immediately" checkbox while creating User via API
I have a usecase where I am creating new users via REST API. When we create a new user from UI then there is this checkbox Generate new password and notify user immediately which is selected by ...
-1
votes
1
answer
876
views
REST web Service to consume PDF in Binary Form from external System
I have a requirement where external system will be posting PDF to salesfore in binary form as REST Post call and I need to cosume the PDF to attach it to the Object as attachments.
Following is my ...
5
votes
1
answer
1k
views
Retrieving license consumption stats for a Customer Community Login license
I am testing my app: at this moment I check does it properly count licenses.
Everything was fine until I started checking Community licenses. I have created a user with a Customer Community Login ...
4
votes
1
answer
564
views
Flow -> Apex -> Salesforce REST API: why "Unauthorized endpoint"?
I have an Apex class that calls into Salesforce using a new HttpRequest().
When I call that Apex from Anon Apex, it works fine.
But when I call it from a Flow I am testing in FlowBuilder, it complains ...
0
votes
1
answer
297
views
setBody on HTTPCallout not working apex to stripe [closed]
I used some similar code I had done successfully in a trailhead here
public class HttpCallout {
@AuraEnabled
public static String makePostCallout() {
System.debug('----apex ...