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-api]

REpresentational State Transfer (REST), or RESTful, web services provide interoperability between computer systems on the Internet. The Salesforce REST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

1
vote
1answer
53 views

Get Method Syntax to move Data Extension from SFMC via Postman

I am new to API Calls, and Postman API Scripts. I have a Data Extension in Sandbox SFMC, which i want to move to Postman via Postman API call. I already have a script to get the access token from ...
1
vote
3answers
43 views

Increase the callout time limit from 120 seconds to more

I am calling a REST API from my Salesforce instance which generally takes 100-150 seconds to process and return the result. The cumulative apex callout time limit is 120 seconds. Is there any way ...
1
vote
1answer
21 views

Dashboard refresh - 403 Forbidden - Documentation of errors

I have a periodic scheduled job that refreshes a dashboard using this HTTP PUT request: /services/data/v44.0/analytics/dashboards/somedashboardId Mostly, this works reliably but every so often I get ...
5
votes
1answer
33 views

sObject describe metadata showing duplicate picklist value entries

I'm doing some code generation based on the standard org sObject metadata. As part of that process I'm using the DescribeSObjectResult.fields.picklistValues PicklistEntry records to determine which ...
0
votes
3answers
45 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/...
0
votes
0answers
23 views

Accessing salesforce data using JAVA program - facing an issue

This is my JAVA code: package SFtest; import java.io.IOException; import java.net.*; import org.apache.http.client.methods.HttpPost; import org.apache.http.client....
0
votes
1answer
23 views

'Text ' is not a valid value for the enum 'FieldType'

I am trying to create fields dynamically on a custom object. Field's metadata info taking from csv file. When I am uploading the file then I am getting callout exception from MetadataService. ...
0
votes
1answer
19 views

How to associate a contact with an opportunity using Restforce or REST API?

I tried submitting a ContactId with the Opportunity, but received ERROR: INVALID_FIELD: No such column 'ContactId' on sobject of type Opportunity Is there any documentation?
1
vote
1answer
26 views

Unable to authenticate through REST API when using scratch org

I'm having some trouble getting the REST API to work on a scratch org. When I call the login endpoint I get the error "invalid grant". (This happens when I try test.salesforce.com as well as login....
0
votes
1answer
38 views

Customer Community User login using Partner WSDL

Requirement :- Login Customer community user into Salesforce using Partner WSDL. I tried solution provided here and it works for customer community users for me using SOAP UI. But when I used ...
0
votes
1answer
21 views

Error in Json for Rest Api

I have a trigger that sends a certain opportunity to an unspecified stage, so I have a json with the objects, but I intend to send everything in a single string, so I joined json, when I run the code ...
0
votes
1answer
37 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
34 views

SOQL Lookup failing to retrieve values

I have following query that I am trying to run: select X__Region__r.Name, Operating_Unit__c from X__Worker__c where (X__Worker_Status_Current_WA__c = 'Active') Where X__Region__c is a lookup to ...
0
votes
1answer
51 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(...
2
votes
1answer
36 views

Cannot get salutation field from contact via REST API

I am using force toolkit for .net to get contact fields. I make a soql query like: SELECT Id, FirstName, LastName, Salutation FROM Contact One of my contact has a salutation field set to Mr. like ...
3
votes
1answer
83 views

Using SObject Tree REST resource to update record

I'd like to update an Account and create a child Contact in a single transaction using REST API. Tried to use SObject Tree endpoint, but when I simply pass the Id in object body, I get: Don’t ...
3
votes
1answer
105 views

Get all platform event definitions via REST API

Is it possible to retrieve the list of all platform event definitions using REST API? If I have an event name, I can get its definition using data/v40.0/sobjects/<EventName>/eventSchema but ...
1
vote
1answer
42 views

Bulk API 2.0 works in sandbox but broken in production

I'm trying to bulk import Task records using the Bulk API 2.0, which works perfectly fine in the sandbox, but fails with this error every time when I try to create the job in production: [{"errorCode"...
1
vote
1answer
53 views

How to Query for logged in username [Python:SimpleSalesforce]?

Tried to do user=sf.query("SELECT Id, Name FROM User WHERE Id = :UserInfo.getUserId()" but getting error: content = [{u'errorCode': u'MALFORMED_QUERY', u'message': u'\nSELECT Id, Name from User ...
0
votes
1answer
61 views

Read Time Out Exception

I am calling REST API method to update some data to another system from apex but getting "common.apex.runtime.impl.ExecutionException: Read timed out" exception. Here is my request code HttpRequest ...
2
votes
1answer
174 views

Using AWS Lambda to query SalesForce

I'm working on a AWS serverless app that will need to query SalesForce from AWS Lambdas to receive it's data and I'm struggling with how to authorize my Lambdas to talk to SalesForce. Most of my ...
0
votes
1answer
19 views

Getting the Salesforce ID in BigInt format

I'm storing the ID of the Salesforce records we have synced with our website. I am currently using an existing table to store the ID mappings for the records. The problem is that the existing field is ...
3
votes
1answer
58 views

Uncommitted Work Pending - Working around DML then WebService

I am working with Salesforce Connect and I am storing my token and expiration times in an encrypted custom setting. My connection is through the client credentials Oauth 2 flow. When a user queries ...
2
votes
3answers
100 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
0answers
21 views

POST service with Rest API callout method for HTTPS

I have a requirement for POST service. I am using the Rest API callout approach. The end point is in http. The client is asking for using https end point. My question is what is the procedure for ...
0
votes
1answer
22 views

alternative way to traverse through json lists of lists of lists in apex

I have the attached json structure and just wondering is there a better way to traverse through the items to obtain them ? whatever i am doing is working and is shown below , but just would like to ...
0
votes
1answer
24 views

Connected App running user

I've created a connected app for integration usage and I put a specific Sys Admin running user for this - But when data is sent via the Web Service that the integration created - Its still put me (my ...
0
votes
1answer
10 views

Composite Rest Salesforce

Can we use composite(tree or batch) rest to send multiple POST request to third party(non salesforce endpoint) in a single send call ?
1
vote
1answer
27 views

Does anyone know why TimeZonesSidKey field in Organization sObject is not available to be patched by Salesforce REST API?

I am trying to update the Timezone of the organization using the Salesforce REST API as DML operations on Organization is not permitted using apex. However, the TimeZoneSidKey field doesn't seem to be ...
0
votes
0answers
39 views

APEX REST Service permission in profiles and Permission Sets

I have code which makes Rest callouts to an external system for authorization and rest of the working. As per our design team APEX REST Service permission should be disabled. I tested out this is ...
0
votes
1answer
28 views

Salesforce Standard API - Composite Tree resource

In order to create record in bulk using REST API, we using Composite Tree resource. I'm trying to upload a bulk of content versions : {"records" :[ { "attributes" : {"type" : "ContentVersion", "...
0
votes
0answers
68 views

How can I alias a column in SOQL for an object that doesn't support field aggregates?

We want to alias the count() value in a SOQL query for FeedItem however it seems that column naming can only be done when a field is present in count(). Select count() from FeedItem works fine, but ...
0
votes
0answers
23 views

How can Customer community user login into Salesforce using REST API?

I have created one Rest webservice in SFDC (which I want to expose to other users) and set up one CUSTOMER community User. Login URL: https://test.salesforce.com/services/oauth2/token?grant_type=...
4
votes
1answer
628 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
2answers
27 views

API to Create and Delete a Relationship Object

In our sandbox, we have created Student, Role, and StudentRoleRelationship objects. Currently, we have a Drupal project that has its own Student and Role objects, therefore in Student and Role we have ...
1
vote
1answer
33 views

API Integration - Professional Edition

We are currently integrating with a payment provider wherein we send some request and get some response. The payment provider then does a callback and posts the status after some time for the ...
1
vote
2answers
69 views

Limits API callout in Apex

I want to receive daily limit from apex. There is my code public static HttpResponse getLimits() { HttpRequest req = new HttpRequest(); Http http = new Http(); req.setMethod('GET'); ...
1
vote
2answers
35 views

SOAP and REST API

What is the difference between SOAP and REST APIs. Can someone please explain with the scenarios which one I need to pick for which type of scenarios?
1
vote
1answer
26 views

How to use REST API (or preferably Restforce) to upsert and only update when field is blank?

I want to upsert Leads with the following rules: Match by Email If match is found, only update fields that are blank. Is it possible to do this by using API upsert? Is it possible to do it with ...
5
votes
1answer
73 views

Implement pagination on APEX REST Endpoints

I am working on a Apex REST framework that acts as an abstraction layer to make it easier for all our other systems to consume data from salesforce (i.e. consistent naming scheme for field names, ...
1
vote
0answers
54 views

How to send SFMC SMS via external API?

I'm trying to trigger SFMC REST API to send SMS from Postman. Below is the steps: Created a Outbound SMS content in Mobile Connect (with the following properties) Template type: Outbound - API ...
1
vote
1answer
40 views

How to specify the Lead owner when creating with REST API?

I searched through the documentation and it seems Lead creation is done by sending a hash of attributes. How do you specify the Lead owner? By email? User ID? Is there any documentation?
4
votes
2answers
77 views

Standard invocable actions API: How to detect whether an input expects an array?

I'm working on some functionality that calls some standard invocable actions via Salesforce's REST API (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/...
0
votes
1answer
33 views

Keep SFDC Session alive

We have developed a web portal outside salesforce while using Salesforce as an identity provider. For the time being, we have some VF pages exposed within iFrames. Many of you know how these .. '...
0
votes
1answer
132 views

REST API - To create/update a row in Data Extension not working

I am using following URL to create REST API request to create/update a record in the data extension: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/...
1
vote
3answers
122 views

REST API Call Journey through Postman

I'm trying to make an API call through POSTMAN to trigger a journey, but when I doing that I am getting Error: 596 Service Not Found PostMan Call: Host: https://************.rest....
-3
votes
4answers
163 views

Apex Callout, how to set body? [closed]

I am struggling to configure body for http request. This is what I have received from integration team. "body": { "mode": "formdata", "formdata": [ { "key": "sourceFile", ...
1
vote
2answers
143 views

How to resolve Webcallout error System.LimitException: Too many callouts: 101 when displaying data on Lightning component

I'm making a webservice callout to an external webservice and displaying data on a Lightning component. Data is returned in JSON format in multiple pages. Each page has 50 records. In my apex ...
2
votes
2answers
29 views

How to read REQUEST body

I have created a REST Endpoint (exposed on force.com site) to allow Webhook messages. The third party service will POST data to the webhook that looks like this: Body: { "channel": "server", "...
1
vote
1answer
68 views

Unsubscribe process on external page with update to _Unsubscribe dataview

What I would like to achieve is an email unsubscribe process that is secure, performant and on an external page with the ability to update the internal system table (dataview) _Unsubscribe. How I ...