Questions tagged [rest-service]
The rest-service tag has no summary.
115 questions
1 vote
1 answer
505 views
REST call with GET method and Body
I am trying to make a REST call with method as GET and body included . This call works fine from POSTMAN however from salesforce the call at server is received as POST call. Can i make any change in ...
1 vote
1 answer
160 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 ...
0 votes
1 answer
232 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
744 views
Update record using HttpPut method only specific field
I am trying to create Callout class to allow external system to update records,like below @RestResource(urlMapping='/OppleadUpdate/*') global with sharing class test_Callout2 { @HttpPut global ...
1 vote
1 answer
618 views
REST Request is rejected since Winter 23 hit the preview enabled sandbox
REST Requests seem to be rejected by SF since Winter 23 hit our preview enabled sandbox. Below sample code runs (run on Exec. anonymous) smoothly in v54 sandbox, but fails with below error in v55 (...
-1 votes
1 answer
356 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 ...
-2 votes
1 answer
3k views
Consuming salesforce Rest API with out security token [closed]
I am exposing a API in salesforce which will be hit by an external c# application. I am enabled oAuth mechanism. Things are looking good but when the external end point needs to pass user id and ...
4 votes
1 answer
542 views
Check if apex is being run in Rest Resource
Is there a way to check if being run in RestResource Context? I have a script that posts messages to an endpoint but we can end up in an infinite loop scenario as they are now posting their comments ...
0 votes
1 answer
1k views
JSON_PARSER_EXCEPTION "Unexpected parameter encountered during deserialization:
I am trying to create some records using post method but it throws an exception as below: JSON_PARSER_EXCEPTION "Unexpected parameter encountered during deserialization: JSON Body: { "...
0 votes
2 answers
225 views
Test Class Cannot Find @RestResource Web Service Class
I have a @RestResource web service class that works fine in the real world, and works fine from Workbench, and its test class runs without errors, yet the test class does not actually run the web ...
0 votes
0 answers
352 views
Any Ideas for Building dynamic JSON with apex
I need to build a json for external rest service(non salesforce platform) dynamically according to mapping stored in a custom metadata object (named SobjectToJSONFieldsMapping__mdt) records(i.e. ...
1 vote
0 answers
1k views
Calling Webservice from Apex class, getting 302 response error
I have the below code trying to make a HTTP callout from a APEX class. The response I get back is System.HttpResponse[Status=Moved Temporarily, StatusCode=302] My class is public with sharing class ...
-1 votes
1 answer
228 views
How can @HttpPost methods ingest complex JSON from webhooks?
I'm integrating Square with SFDC, and Square has nice webhooks (https://developer.squareup.com/reference/square/customers-api/webhooks/customer.created) that it sends for any event on its platform. ...
-2 votes
1 answer
695 views
Setting REST Request Body [closed]
I need to set below request body in a http rest callout which is working fine in postman. [{ "notification_type": "complaints", "notification_mode": "push&...
0 votes
1 answer
1k views
Do a post callout and get the location header from rest service class
I have a requirement and I am not sure is it possible or not. My requirement is that I have a rest service class with @httpGet annotation where I am getting Id of a record after that I need to do rest ...