Stack Exchange Network

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

0
votes
0answers
29 views

How can I use pre-request script in salesforce?

I have a pre-request script and an endpoint which I can use to fetch access token in postman. How can I use the same script in Salesforce to get the access token?
0
votes
1answer
24 views

getting recursion for Salesforce 2 Salesforce Integration using REST API in Case object

I am doing salesforce to salesforce integration between two orgs using REST API. I created REST API classes in two different org that update/insert/delete records. Insert and Delete works fine. But in ...
0
votes
0answers
105 views

Retrieving Automation using SOAP API from SFMC

I want to retrieve Automation, together with its activities, from Marketing Cloud using SOAP API. So far, here is what i've done: POST request: https://mccjt21lv-4lgq9nyyffr29q3v31.soap....
0
votes
0answers
48 views

How to Create a List (via APIs) from a Large CSV in Marketing Cloud

I wrote some code to interact with Marketing Cloud's SOAP API to create a List and populate Subscribers by importing a CSV file. The code works fine for CSVs up to a couple of thousand records. I ...
0
votes
2answers
34 views

Bulk match contacts based on email

I've a list of email ids and I want to match it against contacts in Salesforce. I'm planning to do use SOQL like - Select Id, Name from Contact where email IN ('a@xyz.com, b@xyz.com') I will be ...
1
vote
2answers
107 views

Deserialize JSON Body into two different Lists of own classes

I'm writing an REST PUT request that takes in an array of Careers and Degrees from the body and converts them to inner classes within the RestResource class. However, when I am attempting to ...
1
vote
0answers
34 views

Rest Api deprecation

When a salesforce rest api version will be deprecated? Is there any validity period for api version? Is there any deprecation process salesforce follows?
1
vote
1answer
195 views

Rest api version v45.0 not working

Rest apis below version v45.0 working fine. But new version v45.0 is not working. Getting error as [ { "errorCode": "NOT_FOUND", "message": "The requested resource does not exist" ...
1
vote
1answer
288 views

Method PATCH is not defined in RFC 2068 and is not supported by the Servlet API

I'm using PATCH /composite/sobjects URI as stated in the REST API Developer Guide. But I'm receiving this error: Method PATCH is not defined in RFC 2068 and is not supported by the Servlet API ...
0
votes
1answer
55 views

Reading in XML from webserivce request using HttpRequest

I have seen multiple posts online talking about how to read in XML data from a web request using HttpRequest, but I cannot seem to make it work or find any documentation on it. The closest I have ...
0
votes
0answers
75 views

Getting Bad request for Connected App

I am using Connected app to authorize the access token but I am getting bad request. here is my code. public static void test(){ String clientId = 'REDACTED'; String clientsecret = '...
0
votes
2answers
58 views

Check API REST Salesforce

I have a test class of REST API and I want check this. In workbench it is OK, but now I want check and use with other application. Can I check this class? I have tried with cURL, but I do not get it; ...
1
vote
1answer
212 views

Salesforce Rest API create account

We are using the Salesforce Rest API to integrate our external website with Salesforce Sales Cloud. When a user registers on our website, we create a contact record in Salesforce. The response to ...
0
votes
2answers
261 views

Redirect following POST method

I have a scenario : A user needs to fill a form and after submitting, it should send the data of the form using POST API to some URL - the user will need to be redirected to this page after the ...
0
votes
1answer
33 views

External Website integration with Salesforce

We have an external website that is integrated with Salesforce via REST API. On the website, when a user registers, a contact record is created and also a welcome email is sent right away. Users ...
0
votes
1answer
126 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 ...
1
vote
1answer
168 views

REST API call via Postman to read Journey [closed]

I am new to API call. I'm attempting to retrieve a journey together with its data from SFMC. Should i use POST or GET request? What URL goes to the request? For header, i have specified the ...
0
votes
1answer
49 views

getting Unexpected parameter encountered during deserialization using REST service

why below REST web service does not properly deserialize the input argument?Please help me out? @RestResource(urlMapping='/HH_Survey/*') global class HH_SurveyController { public ...
0
votes
0answers
28 views

How to retrieve files from an external server

I'm not at all that familiar with web service, but we do have this requirement in which, once a month, we need to retrieve some pdf files from a folder in an external server, and then attach them to ...
1
vote
1answer
58 views

Migration to Content Builder from Classic Content

I mainly use an AMPScript email to create&send emails using Triggered Send. The AMPScript email (script) loads the required information from content html files and values from the Data Extensions ...
2
votes
1answer
86 views

Using queryLocator in the REST API /services/data/v44.0/jobs/ingest

I am doing a report for my Jobs and I need to return a specific Job information using the REST API /services/data/v44.0/jobs/ingest. When I am using the REST API, it is limited to 1000 records. I ...
1
vote
0answers
12 views

Updating Standard Report Type via Rest API on Cases returning error: 'value \“\” is not one of the picklist choices.'

I am looking to update the report type of an existing report via REST API. First I get the report metadata via a GET/describe, then I string-replace just the report type (assuming there is just one ...
0
votes
0answers
32 views

How to create a new report programmatically and set audit fields?

I am looking to create a new report programmatically and set its audit fields (CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate). I followed this REST API Documentation to create a report ...
1
vote
1answer
89 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
151 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
149 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
44 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
117 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
27 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
52 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
33 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
133 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
163 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
25 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
194 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
61 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
268 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
59 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
332 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
142 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
80 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
158 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
213 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
2answers
894 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
23 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
111 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
4answers
733 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
25 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
24 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
32 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 ...