Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

Not able to hit restresource URL from LWR community site

Issue: From my LWR community I am not getting the output from the restresource URL I created one rest resource like as below code. PS: I commented all my original logic and just trying with some test ...
SFDC-Beginner's user avatar
-1 votes
3 answers
91 views

Unexpected parameter encountered during deserialization: Name

Unexpected parameter encountered during deserialization: Name @RestResource(urlMapping='/Account/*') global with sharing class MyRestResource { @HttpDelete global static void doDelete() { ...
Rahul's user avatar
  • 1
-2 votes
1 answer
159 views

To have different data type for same variable in Rest API Request body

I am trying to wrap a request body from callin request which has a variable but values can be different data types. Example request body 1 : { RecordId:"cncjdn" } Example request body 2 : { ...
sf developer's user avatar
-1 votes
1 answer
65 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 (...
Kevin Yao's user avatar
  • 167
0 votes
1 answer
217 views

Why Tooling API doesn't support composite/sobjects resource? [duplicate]

The documentation for Tooling API suggests that Tooling API supports composite/sobjects resource Update Multiple Records with Fewer Round-Trips Use a PATCH request with sObject Collections to update ...
Patlatus's user avatar
  • 17.8k
-1 votes
1 answer
312 views

Can I add suffix in urlMapping for HttpPost in RestResource

I'm having an apex class like this: @RestResource(urlMapping='/api/v1') global without sharing class MyRestService { @HttpGet global static List<sObject> getDataById() {...} @HttpPost global ...
Tuấn Trần quốc's user avatar
1 vote
0 answers
193 views

REST resource Unicode characters not working (form data)

I'm currently developing a Rest Resource that will be able to handle post method into Salesforce. The request that I get is in form-data(!!!). It contains Hebrew characters translated into Unicode (i....
Yaac0's user avatar
  • 165
0 votes
1 answer
2k views

How do I convert a ContentVersion record to JSON to pass via API?

I need to share files attached to an account externally via API to another Salesforce org (to recreate the files there). In order to do this I'm trying to create a JSON file to contain the file/s ...
Irene's user avatar
  • 1,885
0 votes
1 answer
122 views

Is that we can send the multipart/form-data till 2GB by using rest api in apex

Is that multipart message is available in RestAPI in Apex 2021 to send the large files(till 2GB) from source org to target org??
computer's user avatar
3 votes
1 answer
3k views

Why am I getting "Service not found error" when trying to access a @RestResource when it is exists?

I have a rest class with a @RestResource annotation and a method with @HttpPost annotation. Something like - (urlMapping='/abc/contractors') class ContractorInfoWebService { @HttpPost global ...
Knight of the Vale's user avatar
1 vote
1 answer
383 views

Is there a way to check @RestResource usage frequency?

Can you please tell me, if there is a way to check @RestResource usage frequency? Short summary: I have a legacy @RestResource which is supposedly not used by anyone. I want to check that. I have ...
Mariia Illarionova's user avatar
0 votes
1 answer
950 views

Time delay @future method - need delay for recurring batch process to complete

I have the following requirement and am looking for advice for the best way to process it. We have multiple orgs linked to each other via S2S, with batch jobs running every 10min to pass updates ...
Irene's user avatar
  • 1,885
1 vote
1 answer
3k views

Callout to other Salesforce org using Named Credential - which Authentication option should I use?

I have 2 Salesforce orgs (with identical code) - a hub and a client. I need to pass data from the hub to the client. Using S2S is fine for normal data, but when it comes to files (eg pdf) we can't use ...
Irene's user avatar
  • 1,885
1 vote
1 answer
137 views

Responsive JSON data

Hi my requirment is : In RestExplorer, Get Method, When i pass below URL # /services/apexrest/partyInquiry?recordId=a1K2F000000Wsom I can get Results below Structure : { "caseInfo": { &...
VidRa's user avatar
  • 11
3 votes
1 answer
1k views

Improve performance of a rest resource

I have a rest resource which fetches more than 10000 records. iterates the list using foreach and adds each record to a custom wrapper class list and finally returns the custom wrapper list as ...
Sisir's user avatar
  • 111
7 votes
1 answer
1k views

Good way to offer both LWCs and a REST API in the same code?

We are building a product that will make use of multiple Lightning Web Components (LWCs), and some of those will make use of @AuraEnabled Apex methods. We also plan to provide an API that non-LWC UI ...
Keith C's user avatar
  • 137k
1 vote
1 answer
592 views

How can I disable my existing Apex REST Webservice in production?

I have an existing Apex REST Webservice configured in production for consumption by a partner for Lead creation. However, we are not working with that partner anymore and hence want to disable this ...
srmaind's user avatar
  • 95
2 votes
2 answers
809 views

WebService Post Rest API is Receiving as GET

I wrote a web service using @RestResource With both Get and Post methods. When I try to send a request via workbench - everything works great, but when I try to send a post request using other ...
Salvation's user avatar
  • 1,209
1 vote
1 answer
5k views

Is there a better rest endpoint for downloading file contents?

I'm trying to use https://[domain]/sfc/servlet.shepherd/version/download/ to download files (lightning files not attachments) from salesforce and it works sometimes and I can get it to work in postman ...
Scott Morrison's user avatar
1 vote
2 answers
1k views

RestResource HttpPost - 401 Unauthorized - INVALID_SESSION_ID

I am attempting to call a RestResource HttpPost method, but receive an INVALID_SESSION_ID response. [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] Apex Code (version 43):...
Brad Ullery's user avatar
  • 1,457
5 votes
1 answer
14k views

URL_NOT_RESET error REST API

I have created the REST Resource to fetch the data from Salesforce. My Domain is also activated in our Org. When I fetch the data using https://myDomain.my.salesforce.com/.../... it is returning me ...
Nirav Shah's user avatar
0 votes
1 answer
2k views

Total Record Count in API Call

I have created Restful Resource (Http Get API) to fetch the data from Salesforce. I have more than 9 Lac records in my custom object which I need to send via API. I have implemented the Max Row and ...
Nirav Shah's user avatar
2 votes
1 answer
789 views

RestResource Annotation - UrlMapping is NOT allowed

As per the Salesforce Article Winter / Spring '18 Apex Compiler Changes it is mentioned that UrlMapping is NOT allowed for @HttpPost UrlMapping and URL strings are NOT allowed for @HttpGet but ...
Nirav Shah's user avatar
1 vote
1 answer
371 views

@HttpPost test will not run - Method does not exist or incorrect signature: void doPost(String,

Just started with Apex last week so very new. Building a @RestResource to pick up webhooks sent from an external DB. Code has been tested and working as expected in Sandbox. Can not get the unit ...
Dylan W's user avatar
  • 13
3 votes
1 answer
210 views

How to consume a salesforce REST service?

I want to integrate two salesforce orgs using username-password flow. First I got access token, after that I'm trying to call another service which is located in the org. I'm getting following error. ...
Manoj's user avatar
  • 444
0 votes
1 answer
35 views

Why POST is routed to GET?

I have rest controller with GET, DELETE and POST. GET and DELETE work ok. @RestResource(urlMapping='/test123') global class TestRest { @HttpGet global static String getOperation(){ ...
sawim's user avatar
  • 101
0 votes
1 answer
464 views

unable to access returned values of global class method

I am trying to access the returned values of a global class method and store them in a string. The string is declared as global static string. The value gets stored in the string when in the method. ...
sfdcdev's user avatar
  • 39
1 vote
1 answer
1k views

RestExplorer in Workbench Get Error?

I would like to test a Get endpoint in Workbench via the rest Explorer. However I'm getting a services not found error when executing. Any suggestions on what I need to change? Below is the endpoint ...
Starley Flynn's user avatar
0 votes
1 answer
305 views

Rest Test class failing in production

I have the following Rest class and test class. The test class is working good in sandbox and failed in production. I have gone through numerous post and also followed to test with Mockclass as well. ...
user28452's user avatar
  • 451
3 votes
1 answer
2k views

Use of Wildcard in Apex rest service

I have been using rest service and building them for long time but something which I am not clear is on the wildcard part. Whenever I had to expose an Apex rest service I expose apex class with ...
SfdcBat's user avatar
  • 4,839
8 votes
3 answers
2k views

How to see JSON response for REST service?

How I can see what the JSON response looks like for a REST service that looks like the one below? I guess I'm looking for the actual steps of what I need to do to see the JSON response. @...
Adnan's user avatar
  • 103
2 votes
0 answers
2k views

RestResource urlMapping routing is conflicting with a similar URL

So we have a number of mapped urls, and up until recently they were working fine. We recently noticed that our requests are inconsistently being routed to the wrong APIs. Example: @restResource(...
zgc7009's user avatar
  • 299
1 vote
2 answers
1k views

Calling Rest resource issue from Force.com sites

I have rest resource class which i am calling from force.com site.. Below is my endpoint https://cs22.force.com/services/apexrest/CustomerData/ @RestResource(urlMapping='/CustomerData/*') global ...
miku's user avatar
  • 1,761