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]

The REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

0
votes
3answers
33 views

What's the difference between an HTTP Request Message and a Salesforce Rest Resource and the HttpRequest class?

I am new to HTTP and Salesforce's APIs What is the difference between the salesforce rest resource they talk about in this trailhead module - https://trailhead.salesforce.com/content/learn/modules/...
1
vote
2answers
41 views

Dynamic JSON Body in HTTPPost Ampscript

I am trying to set dynamic JSON parameters in an ampscript HTTPPost. When attempting to insert those parameters it only returns the actual ampscript function and not the data that was supposed to be ...
0
votes
1answer
28 views

How to serialize REST Request from Wrapper class for existing Salesforce data?

I am trying to format my SObject data within a wrapper class to POST data to another Salesforce org from a custom Work__c object, but I am having a hard time understanding how to add an instance of "...
0
votes
1answer
43 views

How to create JSON string for REST callout from Wrapper class

I have found a lot of different examples of this, but I'm still having troubles accomplishing this. Here is the webservice which is working: //WORKING Webservice in target org @RestResource(...
0
votes
1answer
19 views

Rest API Response - Break Address into multiple fields

I am working on an assignment where we enabled an external system to search for contacts in Salesforce based on lastName, firstName, BirthDate. I have developed a webservice which queries the Contact ...
2
votes
3answers
66 views

Calling a rest API from one Org to another Org?

I have created Connected App & Auth Provider. This is the Code i am currently running. Getting error. What I am doing wrong? Can anyone please help me with this? 1st Org - (Class ...
0
votes
2answers
31 views

Rest Call to locally installed machine

I am working on integration PRTG with salesforce. PRTG is locally installed (at http://127.0.0.1 ). I used following endpoint public String baseUrl = 'http://127.0.0.1/api/table.xml?content=sensors&...
4
votes
1answer
598 views

REST API vs SOAP API?

One of the differences between REST and SOAP is that REST is lighter than SOAP. What does it mean when they say REST APIs are lighter than SOAP APIs? How is JSON lighter than XML?
0
votes
1answer
60 views

How to access the records associated with a custom view in REST API

I would like to access the records related to contact predefined list views (like birthdays this week, contacts added this week), and custom views created by the user, using REST API. The SOQL query ...
3
votes
1answer
51 views

Custom OAuth Auth Provider

I have a Rest API Endpoint that I am looking to callout to. Something like this: https://myrestservice.com/service/logs When setting up the Named Credential, I set up the URL to: https://...
1
vote
0answers
42 views

HTTP patch not supported as a method

I am trying to integrate with a third party service, while trying to make a http request , i want to send PATCH as a method,I have looked for two solutions mentioned here in this questionHow can I ...
0
votes
1answer
17 views

Rest API in Postman Error Message

Can anyone help me to understand about my Error message in postman?
1
vote
1answer
66 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
25 views

Malformed JSON: Expected '[': how to deserialize JSON with REST API?

Error: Malformed JSON: Expected '[' at the beginning of List/Set I think I have incorrect JSON.deserialize for my object. How can I fix it? I don't use a wrapper. List<Account> accList = new ...
1
vote
1answer
21 views

HttpGet and Callout: is not a valid Salesforce ID for the type

I get Item's list from 1 organisation and want to insert them like Another Items in 2 organisation. But it try to insert it with Id. How can I fix that? Error: System.DmlException: Insert failed. ...
0
votes
1answer
41 views

How to deserialize and parse JSON data to get particular values from the response

my http response is as shown: {"controllerValues":{},"defaultValue":null,"eTag":"31935b5a76250197159c64a2a9ec8353","url":"/services/data/v43.0/ui-api/object-info/Opportunity/picklist-values/...
1
vote
1answer
58 views

How to use HttpGet service to get a list of objects and create them?

I have a callout method which helps to get an list of objects from another salesforce-organisation. But how can I convert this list into objects on callout's organisation side? And how can I do this ...
0
votes
1answer
37 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 ...
-1
votes
1answer
62 views

How To Redirect Url Restapi to salesforce

I am creating a rest Service and its integrated with external system and sending data to external system through lightning component and its working fine while sending the data from Salesforce. while ...
2
votes
1answer
42 views

How to connect to a third party REST API using OAuth?

I have a third party REST API that needs to be called from Salesforce, using OAuth for authentication. Is this actually possible? If so, how? I really can't find anything useful on the web. For me, it ...
2
votes
1answer
33 views

Composite Api Objects and Referencing RecordTypes

Is there anyway to reference an account recordtype by Name when creating an account using Composite API which has recordtypes? I am hoping there is a way so I don't need to do a get request to get a ...
1
vote
4answers
125 views

How to update a record in a trigger with value from a REST API?

When an account is saved I need to update it with value from a REST API. I though my approach would work but I'm getting the following compilation errors. Method does not exist or incorrect signature:...
0
votes
1answer
69 views

Error when using REST API to Add Rows to Data Extension

I'm trying to use the REST API to add data to a DE, but I am getting back a validation error when I make the call: Call: HOST: https://www.exacttargetapis.com/data/v1/async/dataextensions/key:...
0
votes
3answers
36 views

Creating an endpoint in salesforce for our external service to access data

I started reading on REST API’s and have created this class to view order tracking information: @RestResource(urlMapping=‘/Tracking/*') global without sharing class TrackingRest_Service { @...
0
votes
1answer
32 views

How do I specify profile mappings on a PackageInstallRequest?

I have created an unmanaged package containing a Salesforce Platform Profile named "Foo". In the org where I am attempting to install the package, I have also created a Salesforce Platform Profile ...
0
votes
2answers
37 views

How can I send an error from HttpPost to Callout if ExternalID is the same?

I still can't send to my Callout right status code. I have an Item object in Org2 that I can post from Org1 (in Org1 is Tool object that passes its fields to THIS (Item) object). Item has ExternalID ...
0
votes
1answer
31 views

How to send error from HttpPost to Callout if ExternalID is the same?

I have an Item object in Org2 that I can post from Org1 (in Org1 is Tool object that passes its fields to THIS (Item) object). Item has ExternalID field that takes the ID from Tool. How can I send an ...
0
votes
0answers
18 views

What is salesforce equivalent OPENSSL Code

What is the salesforce equivalent code for following script: printf "$signingString" | openssl dgst -sha256 -sign example_client_signing.key -passin "pass:changeit" | openssl base64 -A` I found that ...
-1
votes
1answer
62 views

Rest Resource URL mapping in workbench

i have written a rest web service class and mapped the resource as '/Accounts/*/contacts'. where * stands for Accountid. I am trying to do a POST call from workbench and having issue writing server ...
0
votes
1answer
14 views

how can aggregate the response returned by multiple calls in the list

I am making callout and getting the response. I am fetching the records in the batch of 200 so if there is 400 records there would be 2 callouts and getting data but the issue is second callout ...
0
votes
0answers
17 views

@HttpDelete: how to change SOQL filter from Id to the custom External_id?

We have an example from trailhead. But how can we change Id =: recordId to the External_id =: recordId in SOQL? I think we also change the logic of our code, because if just change it - Http-service ...
1
vote
1answer
87 views

Test for HttpPost service: how to take JSON body for test?

I have a HttpPost methods. And I really don't know how to test it correctly. My methods: public static App__c ParseRequest(RestRequest req) { App__c app = new App__c(); String body = req....
0
votes
1answer
22 views

Callout REST HttpPost: how to create an object with all fields?

I wrote my Callout, but it create an object only with Id. How can I create an object with all fields? HttpPost: public static App__c ParseRequest(RestRequest req) { App__c app = new App__c(); ...
0
votes
1answer
22 views

Can we use a map in HttpPost to make our code shorter? (too many fields and we can add more in future)

Can we use a map? And how to do that? Too many fields here already and we can add more in future. @HttpPost global static Ticket__c postT(String title, String whattime, String whatdate, String ...
0
votes
1answer
23 views

How to to foresee External ID in HttpPost?

When we post a Box record we also send it an External Id from another side. How to to make it in HttpPost method? I have an object1 in Org1. In Org1 are all my callouts. object1 has a button POST. ...
0
votes
1answer
28 views

How to make Test Coverage 100%? HttpGet method

How can I test this for 100% coverage? @HttpGet global static List<Box__c> getBox(){ RestRequest req = RestContext.request; String boxId = req.params.get('Id'); if(boxId == null) ...
0
votes
0answers
10 views

How to get an E-Mail from a DataExtension - REST

I was trying to do a REST Call to check if a Customer exists in a data extension. I tried so maynway but I always get this response: {"page":0,"pageSize":0,"count":0,"links":{}, "...
0
votes
2answers
40 views

How to return null for list if we have too many records?

How to return an error msg, if boxes are more than 1000 and we can't return this list (return null + msg)? We need to do that with if or with try catch? Or we can try both variants? @HttpGet global ...
0
votes
2answers
133 views

DELETE a record by REST API without @HttpDelete

I need to make integration between Org1 and Org2. We created a callout POST. When we create an object in Org1, we also create an object in Org2. POST work. All is Ok. Now I need also delete an object ...
2
votes
1answer
26 views

POST a record from Org1 to Org2 with JSON and Map

I need to post created record from Org1 to Org2. I want to "put" my JSON into Map and just "open" Map in another Org. Needed result: fields from new Org1 Object's record = fields from new Org2 Object'...
0
votes
0answers
24 views

JSON_PARSER_ERROR in REST POST: Convert Picklist value from Org1 to String or Picklist value in Org2

All my values transferred good, but it's just Strings. When I try to post Picklist value into Text field I get this in debug msg: [{"message":"Unexpected parameter encountered during deserialization: ...
0
votes
1answer
76 views

System.NullPointerException: null argument for JSONGenerator.writeStringField() in POST Method

I have a custom Obj, and try to realize a POST method. But I get an Error: System.NullPointerException: null argument for JSONGenerator.writeStringField() What is wrong here? public static ...
0
votes
1answer
78 views

Apex Callout from one Org to another with method GET

Org 2 has GET Method: @RestResource(urlMapping='/jobShow/*') global with sharing class RestJob { @HttpGet global static List<Job__c> getJob(){ List<Job__c> jobList; ...
1
vote
0answers
31 views

How can I update a User Record from a custom AuthProviderPlugin's getUserInfo() method?

I am trying to integrate Salesforce with Jira using a Named Credential and oAuth 2.0. The Named Credential requires a Custom Auth. Provider which requires an AuthProviderPluginClass. The ...
1
vote
1answer
42 views

Deleting records in sales cloud using REST api

I am trying to delete multiple records using REST Api. var contentType = 'application/json; charset=utf-8'; var headerNames = ["Authorization"]; var headerValues = [("Bearer "+sessionId)];...
0
votes
3answers
45 views

DML vs REST API call to create a record

This question came to my mind out of curiosity. I have an apex class in which I want to create a record. I can use a simple insert DML operation to create it. Although I know that REST API services ...
2
votes
0answers
77 views

How do I access a Rest endpoint on a scratch org?

I've set up a connected app and a rest endpoint on a scratch org but can't access it through either the workbench, Postman or client code. I get the following error in each case: 404 Not Found ...
0
votes
1answer
187 views

Unexpected character ('a' (code 97)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]

I have a batch class which makes a call out to an api within the same org (the rest resource was developed by a 3rd party supplier and I cannot see its source code) Anyway, as per the supplier the ...
0
votes
0answers
16 views

Is there an object/table in salesforce that holds pagelayout assignments?

I am trying to get a list of which pagelayouts are in used withing the org. But I am not able to find the query/REST call to give me the list of Assignment of page layouts. In the Metadata object: '...
1
vote
1answer
173 views

errorCode“:”METHOD_NOT_ALLOWED“,”message“:”HTTP Method 'POST' not allowed. Allowed are HEAD,GET

I am running the below code in developer console to get OrgPercentage coverage, but it is throwing an error "errorCode":"METHOD_NOT_ALLOWED","message":"HTTP Method 'POST' not allowed. Allowed are ...