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.

1
vote
1answer
54 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
49 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
96 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
271 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
224 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 ...
0
votes
2answers
198 views

Endpoint for getting GlobalValueSet using REST API

I'm trying to use the REST API to get the list of values for a Global Value Set. Since it is not a field on a specific SObject, I don't think you can query for the values. I am successfully ...
1
vote
0answers
142 views

sObject Collections - Update Multiple Records via REST using PATCH - Bad Request 400

I am trying to use the Salesforce sObject Collections REST API resource that was released in Spring '18. Per the Salesforce Documentation, this should be a PATCH request, however when I try to call ...
0
votes
0answers
159 views

Displaying REST response on the VF page on button click

Overview: I am making call to Pardto to fetch prospects and display them into Salesforce VF page on button click. I am getting response fine from pardot but it is not displaying on the vf page. Not ...
0
votes
1answer
21 views

How to store rest response data into Salesforce custom object as records

I have created REST service which is fetching prospect data from pardot and now I want to store it into Salesforce's custom object. I have some fields inthis object which I need to map from the ...
3
votes
0answers
39 views

Unsubscribe MobilePush Contacts with Automation

I need to unsubscribe multiple Contacts from Push Messages with the help of external attributes. It is to be done within an Automation. The only way I see I can do this is the following: Get ...
0
votes
0answers
126 views

AMQP protocol from Apex - RabbitMQ

I am trying to connect and send data to RAbbit MQ messaging protocol. At all places it is provided that we should use AMQP protocol and this is something I am not sure how to do from Apex. Has anyone ...
2
votes
0answers
32 views

Cannot insert Contact with REST API if a Lead with the same e-mail address exists

I noticed in the UI that when I try to insert a contact with an e-mail address that a lead already has, I get a warning (before I click save and insert the contact) saying that this is a possible ...
1
vote
1answer
30 views

Retrieving all calls, posts, comments etc for a Case

We have the following scenario in an application built with React and implementing the REST Api via an integration user. We currently: Retrieve a list of cases based on a custom Master ID field ...
0
votes
1answer
256 views

Create leads in Salesforce through REST API. How to assign assignmentruleHeader and emailHeader?

I am trying to add leads in salesforce through rest API.Code is in java. I have converted WSDL to jar files and added as reference in Eclipse which allow to access salesforce objects in java. PFB my ...
0
votes
2answers
29 views

Unable to convert phone to string in apex

I am working on rest API services. I need to push phone number as a string in the body of the request. I tried following way. String Str1=ts.phone.replaceAll('(',''); String Str2=Str1.replaceAll(')',...
0
votes
1answer
146 views

Post request returns error 405 on ngrok

I'm using ngrok in order to tunnel localhost and check my REST request from Salesforce. However, when I send POST request I get error 405 - method not allowed. Below there is my code: HttpRequest ...
0
votes
1answer
256 views

Invalid conversion from runtime type String to Map<String,ANY> not working

I have a requirement to call a external service with post method. When i tested in anymonous block.It's working fine. But when i try to set up test classes i got this error. in line Map results ...
2
votes
1answer
29 views

Why am I not able to parse valid XML straight from the Salesforce Documentation, but JSON works fine?

On this particular page: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm About halfway down, you'll see a method which I have included in my class @...
0
votes
2answers
127 views

Marketing Cloud sending Content Builder Email to List

I have created a list (using SOAP API) and know the ID of this. The HTML Email exists in Content Builder, I know the name and the ID. How can I send the email to the list. This is not a triggered ...
0
votes
1answer
326 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 ...
1
vote
1answer
141 views

REST Upload attachments - Json Deserialization failed on token 'null'

I'm using simple-salesforce to migrate attachments from one org to another. I'm encoding with base64 but am getting this error: SalesforceMalformedRequest: Malformed request https://my_org.my....
0
votes
1answer
344 views

How to Generate Access token in rest api with apex [closed]

I'm new to integration. I want to post a field value to other external application. So, the third party is using OAuth 2.0 Security. I'm going to generate access token through client key. They ...
2
votes
3answers
231 views

Getting JSON_PARSER_ERROR while parsing JSON

What am i doing wrong due to which i am getting JSON_PARSER_ERROR, I am using code below to parse json below : @RestResource(urlMapping='/Imbellus/CandidateScore') global with sharing class ...
2
votes
1answer
202 views

How to use upsert in REST callout JSON

"Upsert" just inserts new records from JSON, but not updates existing. It's my code: public class myClass { @future (callout = true) public static void getCallout(){ Http http = new Http(); ...
0
votes
1answer
134 views

Rest Request Callout

I am new in salesforce and I have this rest request to get the access token of the other org so that I can get the installed packages. My problem is, I get an error in sending the authorization ...
2
votes
0answers
157 views

REST API - Issue connecting JS app when CORS and Remote Site are both setup properly

I cannot connect to Salesforce to automatically create accounts from my javascript app. I continue to get the error: "Failed to load https://login.salesforce.com/services/oauth2/token: No 'Access-...
0
votes
0answers
54 views

Soql does not return record Id in main class. But returns in Test class

Hope you all are doing well. I have a issue when writing test class. I have created a method where I am inserting a objectA record. Once the ObjectA record is inserted, objectB record get ...
1
vote
1answer
45 views

How do i check if a user logged into salesforce from javascript? Either through api or reading cookie value [closed]

We want to allow users who are already logged into salesforce and have access to our application to continue to our application home page without going through the login flow , if not we want to take ...
0
votes
0answers
48 views

REST API Call to OKTA with filter fail

I'm building an integration with OKTA using APEX. One of the actions I need to call is: get all the users which has updated in the past hour. I'm executing the following code and get an error: 400 ...
0
votes
0answers
85 views

PATCH/PUT Rest - List of sObjects

I would like to create a API Rest where my endpoint receive a list of Accounts in JSON, the list contains few fields of the account with the new values to update. This is my actual code, but it works ...
2
votes
2answers
150 views

OAuth flow for using my app as the authenticator

I'm using SF Restful API to develop an app. A generic use case of the app would be: User logs into the app (app specific credentials) User requests data available @ SF. App knows that user is allowed ...
1
vote
1answer
29 views

RestResource Class with sharing keyword

I am having rest resource class on site in which I am querying contacts and leads. I am able to query contact records when class is without sharing but not able to query contact records when class ...
1
vote
1answer
155 views

BULK API V43 Pass Date/Time Value

I am trying to make a PUT call via fiddler passing in Content-Type: text/csv. I am able to pass in all fields, however it fails on one of the fields that requires a date/time value. I am passing in ...
1
vote
1answer
19 views

Is there a rest api that check the api calls limit without consuming an api call?

I wanted to check my daily api requests, with /services/data/v37.0/limits/. It consumes an API call. How do I check one without consuming an API call?
2
votes
0answers
234 views

Is there a way to create an OpenAPI / Swagger spec for my Salesforce Account?

I've been using the Saleforce REST API for a while and I'm interested in using an OpenAPI / Swagger spec to auto-generate a SDK using OpenAPI Generator and Swagger Codegen. Is there a way to get an ...
0
votes
2answers
205 views

Retrieving csv document using HTTPRequest

I'm working on a project to retrieve/GET a csv file using an HTTPRequest update the associated Salesforce records, and POST a csv back I found this 'send a report as a CSV/TEXT' thread, which looks ...
1
vote
1answer
193 views

Retrieve a list of all JobID done in Marketing cloud

I want to know if you can retrieve the list of all jobID via a REST or API call, I found nothing in the official doc so does anyone have a trick to get this list? There should be a way, because if you ...
0
votes
0answers
48 views

JunctionIdList using REST API

Is it possible to add values to fields of type JunctionIdList using the REST API? Specifically I'm trying to add multiple Contact Id's to the ToIds property on an EmailMessage object; https://...
0
votes
0answers
30 views

How to consume OAuth 1.0 webservice in salesforce

I have another application which I need to call and they are using OAuth 1.0. now I am calling their system endpoint, I have client id and client secret only. Do I need to generate token also? ...
1
vote
0answers
71 views

Retrieve the list of tracking on a Data Extension via REST

I'm trying to make an API call to, if possible, have the JobID of all sends done on this Data Extension. Is there a way to get the list of tracking on a data extension via REST API ? When you are on ...
1
vote
2answers
36 views

Are DataSource.Connection / DataSource.Provider the way to go to create an OAUTH connection to a 3rd party?

I've played with JSON.serialize() & .deserialize() to pack & unpack data that I will be sending to a 3rd party (PureCloud). We have an existing integration with Twilio to send & receive ...
0
votes
1answer
43 views

null result in bulk api 2

I followed the insert walkthrough in the bulk api 2 docs. But when I checked the results I got 0 records processed and an unhelpful status of null:InternalServerError : null I toyed with the ...
6
votes
1answer
42 views

Strip Authorisation header from inbound REST Request

I'm integrating with a 3rd party data provider. The way their platform works is you must provide an endpoint to which they periodically send REST requests to with updated data etc. They happen to ...
0
votes
1answer
242 views

How do I retrieve Country and State Picklist Values (AddressSettings) via API?

How do I get a dependent list of States by Country from Salesforce via API? Our Use Case is: We need dependent Picklists on an integrated 3rd party web platform we intend to pass the returned ...
6
votes
2answers
380 views

How do I enable REST Metadata API?

I am getting this error in Workbench when using the REST explorer: API_DISABLED_FOR_ORG message: The REST Metadata API is not enabled for this Organization. errorCode: API_DISABLED_FOR_ORG INFO: We ...
0
votes
3answers
694 views

Error : JSON request body must be an object

I have a Post method where the other system will be sending me the JSON like this [{ "query": "SELECT AccountId,Birthdate,FirstName FROM Contact WHERE(((FirstName = 'Vikram3' AND AssistantName = '...
0
votes
1answer
257 views

Journey Builder(Custom Activity): InteractionStudio RestActivity failed validation for Save

I came to you guys because I don't understand a problem on a Custom Activity in Journey Builder, here is the error : I am a beginner so sorry if it is a stupid question. I thought it was that my ...
2
votes
3answers
1k views

Generate new password and notify user immediately

While creating new users from Salesforce UI, we have a checkbox right at the bottom called Generate new password and notify user immediately. This is set to true by default and sends Welcome To ...
1
vote
1answer
314 views

How to use 'q' parameter for google drive api

I want to pass q parameter in setEndPoint url to get list of all files in the root folder(at the home page). I tried it using the google API(https://developers.google.com/drive/api/v3/reference/files/...