Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [rest]

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

172 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
81 views

Message sent through Marketing Cloud isn't delivered and doesn't show up on the deliveries endpoint, what can it be?

I'm making a call to Marketing Cloud's endpoint to send SMS messages like this: -- request to /sms/v1/messageContact/{messageId}/send { "mobileNumbers": [ "55009999999999" ], "...
4
votes
0answers
38 views

When does 'If-Unmodified-Since' header prevent DML operations for custom Apex Rest?

I have a custom Apex REST class that accepts a POST request and updates a custom object associated with the request. The inbound POST request contains an 'If-Unmodified-Since' header with the time it ...
4
votes
2answers
153 views

Does IOT Cloud have REST APIs? Or does it uses third party platforms to connect devices to cloud?

I am working on integration services for salesforce. Salesforce has APIs e.g. for creating Account, Contact, Lead etc., making it easy to develop integration services. Now I have been asked to ...
4
votes
0answers
308 views

Deploy Apex Class to another Salesforce ORG via Metadata API?

So I've been looking around to see if there is a way to push Apex Classes via the Metadata API, and I'm a little confused at the documentation. I've used the Eclipse plugin before, so I know that you ...
4
votes
0answers
829 views

REST API Query Timeout Expected

Having recently completed an integration with salesforce using the REST API we've come across an interesting feature. All the documentation I could find suggests that we should get a QUERY_TIMEOUT ...
3
votes
0answers
225 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 ...
3
votes
0answers
98 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 ...
3
votes
0answers
676 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 ...
3
votes
0answers
246 views

Another STRING_TOO_LONG problem, HTML text into a rich text area

I have a custom object with a rich text field, max size 131,072. Using the force.com REST API, attempting to add an entry with text size larger than about 63,700 characters (I have not pinpointed the ...
3
votes
0answers
140 views

why extra string append with the REST request?

I am trying to send this data to another salesforce org REST endpoint. map<string,Set<string>> mp = new map<string,Set<string>>() ; mp.put('Data1',new set<String>{'...
3
votes
1answer
778 views

Live Agent REST and CORS

I am trying to create a chat client using the SalesForce Live Agent REST API but I am running into an issue with CORS. Does the REST API support JSONP, if so do you have some examples, if not then ...
3
votes
0answers
648 views

Send PDF from Salesforce to EchoSign through Apex REST and EchoSign REST API?

How to send PDF generated from VF page to EchoSign through Apex Code and REST API of EchoSign? I'm getting error as "Content Type not Supported/ UNSUPPORTED_MEDIA_TYPE". Any idea? String ...
3
votes
0answers
454 views

Login Service Cloud user through the REST API

I am building a web portal for the SalesForce Service Cloud using the REST API (PHP/WordPress Project). I need Service Cloud users to be able to login to the site through the API without being ...
2
votes
0answers
20 views

LWC - Retrieving WAVE Dataset information

I'm trying to make a callout to /services/data/v45.0/wave/datasets in a lightning web component. I can successfully make the callout for the running user in apex using UserInfo.getSessionId() but ...
2
votes
1answer
30 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'...
2
votes
0answers
88 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 ...
2
votes
0answers
37 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 ...
2
votes
0answers
272 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-...
2
votes
0answers
215 views

Bug? FieldDefinition is Createable via Tooling API

I found this question very interesting: Programmatically Determine Which Objects Allow Lookup References to Them? In my naiveté, I thought perhaps this question could be answered by using the Tooling ...
2
votes
1answer
265 views

Create a Report using Salesforce SOAP or REST API

I know about Salesforce Reports and Dashboards REST API. But Report REST API allows only to change (update) an existing report by sending PATCH request with appropriate json body and clone a report ...
2
votes
1answer
425 views

REST API: How do you clear a Picklist value?

Using the rest API, I want to be able to clear the value of a Picklist item. For example, I have the Account SObject which has an Industry Picklist. Using the Salesforce website, I can set the value ...
2
votes
1answer
351 views

SOQL over REST: “Truncated”, “Malformed query” depending on which record IDs I ask for

The following query, when run over the REST API, gives me an error: SELECT Id WhatId, WhoId , TaskWhoIds , Subject, ActivityDate, Status, Priority, Owner.Name, ...
2
votes
1answer
271 views

Salesforce Javascript CORS rules

Is there a good summary of where from Salesforce allow and does not allow calling out to 3rd party REST API's (assume header Access-Control-Allow-Origin: *). Possible scenarios I can imagine: ...
2
votes
0answers
57 views

Fetch Data of Different Organization?

I have 2 Orgs- Org A & Org B both are ap1 Instance In Org A I've created a Connected app In Org B I am trying to Query accounts of Org A From the Connected App Through Http Call, but I am ...
2
votes
0answers
30 views

Case Closed Layout REST API

Anyone our there know if there is any way of retrieving the Case Closed Layout details using REST APi at all?! My googling skills are not coming up with any trumps here
2
votes
1answer
190 views

Calling Chatter API with in salesforce“INVALID_SESSION_ID”

I am trying to call a chatter API with in salesforce and i am getting the below error message. Error Message: DEBUG|[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] Code: ...
2
votes
0answers
452 views

Connect to external HTTPS REST API

I'm looking for a solution how to connect to external API with Salesforce. The API I want to connect with is a HTTPS url, with some parameters. (https://www.url.com?param=...) Here is the code I ...
2
votes
0answers
138 views

Performance issue when offset used in SAQL

I am using the endpoint data/v35.0/wave/query to execute a SAQL query. When I execute the below SAQL which does not contain offset, I am getting the response approzimately in 1 secs load \"xxxx/xxxx\...
2
votes
1answer
935 views

How do you construct a REST API URI with multiple primary keys?

The documentation for upserting data extension rows by key uses this as an example URI: https://www.exacttargetapis.com/hub/v1/dataevents/key:SomeKey/rows/Email:someone@exacttarget.com. Let's say ...
2
votes
0answers
827 views

How to pass the parameters from one salesforce org to another salesforce org?

VF Page <apex:page controller="Apex_Rest_DemoController"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Create ...
2
votes
0answers
79 views

Using the REST API, how can I tell that a user has blocked OAuth access vs revoked OAuth access?

It seems that I get the same authentication error message the token is invalid. Is there a way I can tell the difference as the vendor? Note that I am not referring to an Apex app. My app is purely ...
1
vote
0answers
17 views

File content missing error while creating transient document on adobe sign using REST API

I am trying to create transient document in adobe sign using rest api. After lot of research I was able to make the correct multi form request in Salesforce Apex.But now I am getting the file content ...
1
vote
0answers
20 views

What API limits are imposed on Knowledge Base REST API?

I would like to know what limitations are there on the Knowledge Base REST API? Would this use the same API limits imposed in a Salesforce org? or does it also use the Site.com limits (number of page ...
1
vote
0answers
65 views

Tooling API not retrieving relationship name/label

Querying on Customfield using Tooling API in workbench is returning relationship label "null" even if object has the relationship field(lookup/master-detail). For Example: My Object has 3 relationship ...
1
vote
1answer
43 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 ...
1
vote
1answer
478 views

{“error”:“invalid_grant”,“error_description”:“authentication failure”}

Hi I am trying to connect one salesforce org to another but getting below error in response body while trying to get the access token using the username password flow in oauth. Please suggest what is ...
1
vote
1answer
125 views

First REST API Call for the day taking more than 40 seconds

We have exposed a custom rest webservice to perform dml operation on Case. We have a custom metadata where we fetch for a particular record based on the request parameter and populate the values for ...
1
vote
0answers
74 views

Python-driven Bulk API 2.0 hardDelete yields “errorMessage”: “InvalidBatch : InvalidBatch : The 'delete' batch must contain only ids”

I am trying to write a bit of python code to permanently delete some records using the Salesforce.com Bulk API v2. Using curl, I have success. I: create an Bulk API 2 hardDelete job PUT the file to ....
1
vote
0answers
65 views

How to use ampscript from Marketing Cloud to make a callout to salesforce rest api?

Anyone know how to use ampscript from Marketing Cloud to make a callout to salesforce rest api? The REST API I need to call from ampscript is listed below: /services/data/v45.0/query?q=SELECT ID , (...
1
vote
1answer
89 views

C# Get SessionId returns affinity token empty (“”)

When im doing the GET request to get the affinityToken, its come empty {"key":"b99d9a87-c7db-4f5a-a20d-9419bb2d0ad0!1549978665283!x6db6+hNaLzITCEq9EcjFLyKAjw=","id":"b99d9a87-c7db-4f5a-a20d-...
1
vote
0answers
312 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 ...
1
vote
0answers
244 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 ...
1
vote
1answer
75 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 ...
1
vote
1answer
39 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
0answers
147 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
0answers
202 views

Using REST API to Upsert a Child record onto a Parent record using the Parent's external ID

Error Lead: id value of incorrect type: EMAIL_HERE Code $body = [ 'Name' => 'Survey', 'Lead__r:MySQL_Email__c' => 'EMAIL_HERE' ]; $result = Forrest::sobjects('...
1
vote
1answer
277 views

FATAL_ERROR|System.TypeException: That operation is only allowed from within an active site. Class.System.Site.createPortalUser

This is my code.But am getting an error i.e FATAL_ERROR|System.TypeException: That operation is only allowed from within an active site. Class.System.Site.createPortalUser. Please correct my ...
1
vote
0answers
215 views

SFMC Custom Activity - Save, Publish, Validate, and Execute not firing

I'm currently having some issues getting the Publish, Save, Validate, and Execute event to come back to my Custom Activity. I've tried looking at a few different answers for similar issues, but they ...
1
vote
0answers
421 views

Problems with deserializing JSON to class

I have created a parser class to parse some JSON into an object. This is accessible as a REST based service. This is the class I parse to: global class statParser { global class Request { ...
1
vote
0answers
416 views

REST API Keep Alive

The first time the rest api, is hit it takes between 15 to 20 seconds to get a reply. Is there any way to keep the api alive, because if I hit it a second time it takes between 2 - 4 seconds.This is ...