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]

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

0
votes
0answers
26 views

Performing multiple operations on same record in same transaction [duplicate]

I am trying to do three operation using same record. First Operation: Set ContentDocument isArchived field to false. Second Operation: Grab contentdocument by calling REST API Endpoint. Third ...
0
votes
1answer
44 views

Convert hierarchically structured JSON data into a list of sObjects Contact

My webservice contains hierarchical data so that I cannot transform it into an sObject when making the GET request. Here is an example for Contact, but the phone number is grouped so that I cannot ...
0
votes
1answer
26 views

Restructure hierarchical data in a REST callout

I found contact data as JSON on the web that is not organized as the Contact sObject as the phone number is being stored as hierarchical data: please see https://api.androidhive.info/contacts/ for the ...
0
votes
1answer
41 views

How to Retrieve large data from Salesforce using Rest API?

I have one new requirement where My client wants to retrieve large data set (~80K records) from Salesforce daily. I have created rest web service but it returns only 2k records. for 80k records, do ...
1
vote
1answer
67 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 ...
0
votes
0answers
41 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
34 views

HTTP GET Response with 204 Status Code and blank Body [closed]

I send Callout request to ActiveMq messages queue service to get messages form there and handle it in Salesforce. In the Queue there are 3000 messages. When I send the request from salesforce sometime ...
0
votes
1answer
24 views

How to create Knowledge Article in Salesforce using REST API

In response to the question : Create Salesforce KB article using API I used the curl call that is provided and I run into the below error : [ { "message": "entity type cannot be ...
0
votes
1answer
29 views

Metadata Rest API for custom objects

Is it possible to create and update custom objects using rest? I seen different questions that suggest it isn't yet available without using a client or SOAP but I need to be able to access it through ...
1
vote
0answers
26 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 ....
0
votes
0answers
37 views

Successful REST API POST returns error

I am working with the SF Commerce Cloud Connector package. We've been struggling to get this set up right. At first, when we made our calls we were getting this error: [ { "errorCode": "...
10
votes
1answer
591 views

Apex Framework / library for consuming REST services

To consume REST services there is a lot of boilerplate code needed: Build Apex Objects to model the responses Code to deserialize REST responses to those classes Handling of HTTP requests, responses ...
0
votes
0answers
12 views

REST call for ApprovaProcess and ApprovalEntryCriteria not working

I posted a question about this some days ago. I'm trying to retrieve ApprovalEntryCriteria for an specific ApprovalProcess via metadata REST call: /services/data/v44.0/metadata/salesforce/types/...
1
vote
1answer
12 views

oauth2 password flow bahaving different between my personal dev site and our corporate sandbox dev site

I'm learning the REST Api in order to write some integration code with our Salesforce implementation. As a first step, I signed up as a Salesforce developer, and did several of the tutorials. I then ...
0
votes
0answers
11 views

Retrieve approval process entry criteria via REST Api

I'm trying to retrieve an Approval Process entry criteria by its API Name. I know you can get the Id querying ProcessDefinition but I need to retrieve entry criteria via REST. I've seen that ...
1
vote
2answers
146 views

How to be able to process a large JSON response?

We're calling an external REST service from Salesforce and are receiving a JSON response of more than 45 MB. Has anyone attempted anything like this?
1
vote
0answers
53 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 , (...
0
votes
1answer
20 views

Generate JWToken from salesforce using Consumer Secret

I am trying to connect to an API and based on their requirement, JWToken is required to make a call and the JWToken must be signed using the provided consumer secret. Now, they have a sample code in ...
0
votes
0answers
30 views

Create dynamic rest api url in apex

I have a requirement where I have 4 fields in which a user will fill phone numbers. On clicking save it will make a Rest API call. The 4 phone numbers have to go in an array in the URL as shown below. ...
0
votes
0answers
75 views

Could not get any response using Postman

I have been making a post call to Account from postman but I am unable to create a Account. But I am successfully create a push Topic.
0
votes
2answers
60 views

Call Salesforce API Rest with python

I'm try to call a REST web-service I made on Salesforce from a Python script @RestResource(urlMapping='/test_rest_api') global with sharing class Test_RestAPI { @HttpPost global static void ...
0
votes
1answer
37 views

Salesforce JSON not passing as UTF8 to external REST API

I'm trying to send a JSON to an external API in UTF-8 but the vendor tells me it's coming through as garbage. I've set the following headers: for(JSONObj.workflowRequestTableFields wfField: wr....
0
votes
1answer
82 views

Which API to use for DataExtension update in SFMC

What is the best way to update SFMC (dataextension) by external system in automated fashion? We would like to push customer data and order history on daily basis from ERP to SFMC.
0
votes
1answer
26 views

Rest reponse for empty field

If I am querying RestResponse using below query: List<Account> accList = [SELECT Name, AccountNumber FROM Account WHERE LastName = :req.params.get('name')]; For any account with an empty ...
0
votes
1answer
25 views

Which grant type to use when Third party is accessing salesforce [closed]

We have written the code in Salesforce and third party is accessing the data using REST. Currently they are using grant type=password to access Salesforce resources. Since it requires username and ...
1
vote
1answer
32 views

Third party wants to call Salesforce.Can we use named credentials in this case

i have a use case where Some code has been written in salesforce and Third party wants to call it.They are calling using rest like this. https://xxx.com/services/oauth2/token?grant_type=password&...
0
votes
1answer
84 views

REST Integration - JSON Serialization/Deserialization alternative to wrapper class

I am building a REST integration between two Salesforce Environments. One environment will be used to setup and stage Data and when ready the Integration will be able to push data from the src to the ...
0
votes
1answer
20 views

Execute SOQL using REST API and possible security implications

I am trying to use REST API Query resource to execute SOQL query. From the documentation I see that query is passed as query parameter in the GET call. This will be used from the external system to ...
1
vote
1answer
24 views

How to build an integration with rest API in apex using XML

Situation I need to build a connection from Salesforce to "post" to a rest api. The recipient has given me XDS schema files of the data to be sent over. My Current Plan Build a sObject to be the ...
1
vote
1answer
46 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
1answer
31 views

JWT authentication without a username?

I'm working on a managed package that needs to allow an external web service to call an Apex REST endpoint within the package. As far as I'm able to gather, the best route is to use OAuth2 JWT ...
0
votes
1answer
95 views

Deserialize json request error - unexpected character

I am getting this error when trying to deserialize an HTTP response - hope you can help: FATAL_ERROR System.JSONException: Unexpected character ('<' (code 60)): expected a valid value (...
0
votes
1answer
43 views

Get Object id using rest api

Is ther any unique id available for object. If yes, How to get a object's unique id ie.object_id using rest api.
0
votes
1answer
40 views

Salesforce Unauthenticated REST - HTTP 301

I followed this tutorial, http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/ , to create a public rest service in a developer sandbox. If I run any of the following: ...
0
votes
0answers
20 views

consuming curl command in HttpRequest [duplicate]

Can you help me recreating this curl command into Rest callout...? curl -i -k -X POST -H "Content-Type: multipart/form-data" -F "file=@{full file path with name and extension}" {https://upload-dev....
0
votes
1answer
69 views

How to get Data Extension ID using Journey ID

In Salesforce marketing cloud, I need to get the Data Extension ID of a journey using REST or SOAP API Call. Then this Data Extension ID will be used in further set of API calls. The challenge was to ...
0
votes
1answer
54 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
1answer
85 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 ...
0
votes
3answers
91 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
84 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
157 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
182 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
28 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
529 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
40 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
732 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
76 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
126 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
130 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
28 views

Rest API in Postman Error Message

Can anyone help me to understand about my Error message in postman?