Stack Exchange Network

Stack Exchange network consists of 174 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

Questions tagged [rest-service]

The tag has no usage guidance.

0
votes
1answer
29 views

Get Object id using rest api

Is ther any unique id available for object. If yes, How to get a object's unique id ie.object_id using rest api.
0
votes
1answer
25 views

How to Insert or Update Blob Data using Workbench

Bascially I'm trying to execute the example given here for the upload of Blob Data from Workbench. but on executing I'm getting below error: message: Unexpected character ('C' (code 67)): expected a ...
0
votes
1answer
25 views

Call back URL generic

we are working on a project to build manage package . We have webservice integration where call back URL needs to be defined so that token can be received from that call and again this token will be ...
1
vote
1answer
83 views

Salesforce limit of synchronous rest service

I have to implement in salesforce many inbound synchronous rest services. What are the salesforce limits that I have to consider? I found only the following: API Requests. A long-running API request ...
0
votes
1answer
38 views

How redirect to record detail page after record is created in REST API

I have implemented rest service for getting the response from external system (Repco) to salesforce. For this, i have implemented Lighting component for sending appropriate required parameters to ...
0
votes
0answers
129 views

Issue in upload PDF through Document's REST api

For learning purpose, I am trying to upload a PDF through a REST api. I tried to write apex code for the same, I am able to insert/upload pdf but the PDF is corrupted. I am unable to open the ...
0
votes
1answer
26 views

Correct HttpPatch and correct test for it

I need to update a right record with ExternalID = Id of inserted record. And I try to check this field (ExternalID) in SOQL, but get an error System.QueryException: List has no rows for assignment to ...
0
votes
0answers
26 views

How to get pardot's prospects back up into salesforce's custom object using pardot api

I have requirement where I need to backup all the pardot propects from pardot to salesforce's custom object. Is there easy way to do it ?
0
votes
1answer
324 views

Status Returned 200 but response body is blank

I'm new to integration. I am going to generate an access token for the third-party application. I tried to build following javascript request in sfdc. But the response body is blank. I need to ...
0
votes
2answers
23 views

Send response body back from Salesforce API

@RestResource(urlMapping='/UploadDoc/*') global class CreateNewDoc{ @HttpPost global static void doPost() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; ...
1
vote
1answer
463 views

How to retrieve a content builder asset by it's legacyId with REST API call?

When I fetch all assets, in assets response JSON there is a JSON object name lagecyData: "legacyData": { "legacyId": XXXXX, "legacyKey": "XXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX", "legacyType": ...
3
votes
1answer
64 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. ...
-5
votes
1answer
405 views

Test class error for callout method, System.JSONException

I am only calling my method in Test Class and getting : System.JSONException: Invalid numeric value: Leading zeroes not allowed at input location [1,2] My callout method is: global static String ...
0
votes
1answer
104 views

HTTPGet response displayed in email

I wrote a rest service using cloud page. However, whenever i try to use it in an email, the response payload is not showing up correctly. I've tried treatascontent but same thing happens. http://www....
0
votes
1answer
66 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. ...
0
votes
1answer
392 views

store custom exception in Event Log object

I am trying to create a EventLog (Custom object) record when ever a exception is caught. It works fine only when the system exception occurs (Like any DML operation. In my case If I call Update ...
0
votes
2answers
53 views

Need help Rest Webservices

I am new to Rest Webservices and need some help. I have a requirement where the external system creates an account and is calling the Rest webservice to send the created account details as a response ...
2
votes
1answer
318 views

Error calling a custom Rest API in Salesforce

I am facing a weird issue and was wondering if anyone had faced this error. Here are the details: I have written a Custom Rest Service in my Salesforce Sandbox org named CustomAccountService which ...
0
votes
1answer
159 views

How to call a apex rest service from salesforce mobile sdk-android?

I need to call apex rest service from salesforce mobile sdk-android. I can execute the soql query by calling RestRequest.getRequestForQuery() method. How to call apex service from RestRequest class?
1
vote
1answer
87 views

Apex Rest service consumes API?

When consuming a salesforce apex Rest api, the header is not returned: Sforce-Limit-Info. My question is, when I consume a personalized service, I am not consuming api? What I noticed was when using ...
0
votes
1answer
329 views

RestRequest params do not handle multiple query params with the same name

I am working with a custom REST class that accepts @HttpPost requests. The main problem that I am facing is that when the content-type of the incoming request is set to application/x-www-form-...
8
votes
3answers
1k 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. @...
0
votes
0answers
36 views

Call Apex REST service from VF Page and display the result in Pop up

There will be a custom image beside a text box and on the click of that I want to invoke a Apex REST service written in another sandbox and show the results returned from the web service in a popup. ...
3
votes
1answer
479 views

REST SERVICE - Unexpected parameter encountered during deserialization

its all perfect! why is this happening? the same endpoint and JSON works in workbench but not in my java code: REST API : @RestResource(urlMapping='/RestTest/*') global with sharing class ...
0
votes
2answers
684 views

How to connect two sales force org using REST web service?

We are trying to migrate data from one sales force org to other using REST web service. Created REST service in one org trying use that service from other org but getting error "System.HttpResponse[...
0
votes
1answer
49 views

Code isn't working for a list in the post method? [closed]

What are the changes to be performed to send the list of json's, currently its working only for 1 account record. looking for the list of json as a body to pass it to salesforce. Code: @...
0
votes
0answers
66 views

Error while creating an upsert in rest webservice?

Rest webservice for handling the json and inserting list of accounts inside salesforce, email(external id) is already present in the system then update the account else insert on account object with ...
1
vote
2answers
442 views

Issue with JSON PARSING on Rest service

I have a rest service which requires a string input and returns a string response. Currently when i test this on workbench, i am getting the following error. message: Unexpected parameter encountered ...
1
vote
1answer
52 views

how to customize the response(add CaseNumber fields) of the http POST method?

How to get the CaseNumber field in the response of the http POST method, please help Code: @HttpPost global static string dopost() { RestRequest req = RestContext.request;...
1
vote
1answer
128 views

Integration between two Salesforce orgs

Trying to transmit ticket number and attachment as HttpRequest body but not able to pass attachment from Org1 and retrieve attachment in Org2. I can get the value of ticket number but not the ...
-1
votes
1answer
397 views

How to Create post call from apex to external system with pass multiple parameters [closed]

I want to create the rest post Callout from apex to external system(C#)REST API. but I am Littel bit confused to where to start Coding to consuming Rets API.and how to pass the parameters of contract ...
2
votes
0answers
319 views

Assignment Rules are not triggered when leads are created / updated using REST API

I am making REST calls to my org to create or update Cases and Leads. Using Sforce-Auto-Assign: TRUE or FALSE, I am able to control the auto assignment rule execution on Case object but this same ...
3
votes
0answers
559 views

How to access deserialized nested SObjects

I am implementing a custom REST API to support upserting a related set of records, similar to the Salesforce composite REST API. Main reason for that is because I want all DML operations to be part of ...
0
votes
1answer
92 views

Regarding Rest Services using Rest Api

@RestResource(urlMapping='/Account13/*') global with sharing class MyRestResource13 { @HttpPost global static string sendAccount(){ RestRequest req = RestContext.request; ...
0
votes
1answer
1k views

java.security.cert.CertificateException: No name matching

I am getting this error in rest apex callout: java.security.cert.CertificateException: No name matching da1.camso.co found. Not sure why I am getting this any certificate I have to or they to add ...
1
vote
3answers
5k views

convert json to string

Trialhead Apex REST Callouts challenge https://developer.salesforce.com/trailhead/apex_integration_services/apex_integration_rest_callouts Hi i am very new to salesforce and has statred learning ...
1
vote
1answer
85 views

Reading large number of records in REST service

This is a apex class for a REST service fro inserting multiple records into a custom salesforce object- I am getting a System.LimitException: Too many query rows: 50001 error because my org data is ...
1
vote
1answer
1k views

REST & Stripe API

I'm trying to integrate Salesforce and Stripe using Cirrus Path's Stripe SDK (https://github.com/cirruspath/stripeforce). I've successfully installed all of the Apex classes and other elements of ...
0
votes
1answer
2k views

401 Unauthorized error when calling rest service in salesforce from external tool

I am trying to call a rest service(works fine in workbench) from a external tool and I am getting the following error [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
-1
votes
1answer
1k views

Publicly exposed Rest class does not support post method

I want to expose a Rest service class with a method with @HttpPost annotation. Below is the code snippet for what I am doing @RestResource(urlMapping='/webhook') global class Services { @HttpPost ...
0
votes
1answer
735 views

Test Class for REST WEBSERVICE which have Method Post and Json Deserialize

//Help me to write test class for this class. @RestResource(urlMapping='/updateCaseStatus/*') global class HttpMethodsJiraToSF { @HttpPost global static void getvaluefromjira() { ...
5
votes
1answer
3k views

RestResource Class: Set the HTTP Response Status in APEX

We have exposed an Apex Class as a Rest Resource. It is a HTTP Post class and broadly it has the following logic: Get parameters to create a new Account Validate if existing database if it is a ...
-2
votes
1answer
26 views

I am new to test classes, how to cover this REST service

@RestResource(urlMapping='/BLN_ASC_ScannedTickets/*') global with sharing class BLN_ASC_ScannedTickets{ global static BLN_Mytickets_BAL ordersList {get ; set ;} global static ...
0
votes
1answer
402 views

Having Trouble with Force.com REST API oAuth2 Authentication

I am experimenting with Pat_Patterson's "Interact with the Force.com REST API from PHP". I am using PHP Version 5.6.3 , and I already registered my app via Setup->Create->Apps->Connected Apps. I setup ...
1
vote
0answers
3k views

invalid_grant error code when trying to get the access token

I am able to get the "code" in my redirect Url but unable to get access token. I tried sending POST request using POSTMAN and also from java code but "invalid_grant" error i got. Response {"...
1
vote
1answer
5k views

Extra Backslash in Json String when exposing webservice

I am creating a middle ware in Salesforce. The external System1 calls my SFDC org and I call external system2 from SFDC in turn. The external system2 gives me Json string like {"Car":"Fiat","Model":"...
1
vote
0answers
106 views

Rest API - Duplicate products and partners are added to opportunities

I'm trying to add 2 products and 2 partners to an existing opportunity through REST API. Even though both products and partners are different, they have the same name and product code in SFDC. ...
1
vote
2answers
491 views

rest api to create account from one sf instance to another sf instance

I am trying to create account from one salesforce instance to another. Below are the configration i did. SF 1 instance - I created an apex rest serevice: @RestResource(urlMapping='/Account/*') ...
0
votes
1answer
111 views

When generate Pdf from trigger, getting Error ( HttpResponse[Status=Bad Request, StatusCode=400]),

I have a trigger on task when new task is created then trigger will fire and if condition is true it 'completed the status of task. My requirement is that before completing the status of task , if ...
2
votes
2answers
2k views

RestContext requestBody size limit

According to what i found, HttpPost doesn't have size limit, but usually limited by the server to request is sent to (https://serverfault.com/questions/151090/is-there-a-maximum-size-for-content-of-an-...