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

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
0answers
20 views

Getting field names from QueryResult when child records are empty - How does Workbench do it?

I'm querying via the REST API (in Apex, because I'm calling another org, amongst other reasons) and using a wacky recursive algorithm on the first returned record to parse out the field names. And no, ...
0
votes
1answer
14 views

Do we need separate authentication grant to access different salesforce object?

We have a soql query which we run against the api that works on User object Select Id,Name from User; we are trying to enhance the query to retrieve the profile.name and role.name using the same ...
0
votes
0answers
17 views

Javascript to get Asset

I'm trying to retrieve an asset from MC but I'm finding a CORS limitation. I'm using the following code: function getAsset(token, aid){ var data = null; var xhr = new XMLHttpRequest(); xhr....
0
votes
2answers
14 views

Authenticate Docusign API using APEX

We have been working on org where there's a one-time manual setup page to authenticate with Docusign API using Oath flow and store the Access token and Refresh token in a custom setting. If any other ...
0
votes
0answers
22 views

Email Preview using REST API

I have written a SSJS code to preview the rendered email. <script runat="server"> Platform.Load("core", "1"); var url = 'https://auth.exacttargetapis.com/v1/requestToken'; ...
0
votes
1answer
23 views

I can not link Note to a contact

I am writing a very simple plugin which creates Contact and associate a note to it. I noticed that to add a note to a contact, I should first create the contact after that add the note here is my ...
0
votes
0answers
12 views

Issue in upload PDF through Document's REST api

For learning purpose, I am trying to upload a PDF through a REST api. I tried to write apex code for the same, I am able to insert/upload pdf but the PDF is corrupted. I am unable to open the ...
0
votes
1answer
14 views

MUTUAL_AUTHENTICATION_FAILED

When I am trying to insert records to Salesforce using ARC(OAuth2) getting below error Error: This session could not be mutually authenticated for use with the REST API { "message": "This session ...
2
votes
2answers
18 views

REST: Why does the response have a status of 200 but a statusCode of 406?

I have a simple api on Salesforce that returns some basic User data when called. It works fine however I noticed that the http status and statusCode are different. Is there something specific I have ...
1
vote
0answers
29 views

Getting Error while try to trigger API event in Journey From Landing pages using ssjs?

I'm working on to trigger API event in journey/Journey builder from landing pages. For now, I can able to get accessToken using clientId & clientSecret and then I tried to pass subscriberkey & ...
0
votes
1answer
26 views

Save multiple records on one API call

There's an image of investment declaration form. This module is in web application project, where an employee can declare his yearly investment and finally save it. After saving the document page my ...
1
vote
1answer
42 views

What are the design patterns how to do a batch callout

I know some basics on callouts but would like some advice on doing multiple callouts. Requirements: I have an external system where guests are registered this could be large amounts. I have to get ...
0
votes
1answer
17 views

Is it possible to create a complex filter with additional operands in Python FUEL SDK?

I am able to create a somewhat complex filter in Python using FuelSDK from_filter = {'Property' : 'EventDate', 'SimpleOperator' : 'greaterThan', 'DateValue' : fromDate} to_filter = {'Property' : '...
0
votes
0answers
16 views

Send multipart/form-data to apex @HttpPost service

How I am currently doing this is, sending a raw JSON through Postman. This JSON is used to create a Case record in Salesforce. In order to attach a file to that case, the JSON contains a base64 ...
0
votes
1answer
8 views

how can aggregate the response returned by multiple calls in the list

I am making callout and getting the response. I am fetching the records in the batch of 200 so if there is 400 records there would be 2 callouts and getting data but the issue is second callout ...
0
votes
1answer
15 views

Returning a PageReference from @HttpGet

How can I render a Visualforce page from an @HttpGet method? HttpGet methods do not support return type of System.PageReference My controller method looks like this: @RestResource(urlMapping='/...
1
vote
0answers
23 views

Please provide an example of creating a recurring event using new Lightning model [closed]

Winter'19 release has made the new recurring event model available which is very different from the original model for series. Could someone please provide a REST API (v44) or APEX example of creating ...
0
votes
2answers
15 views

How to do or store a 1 time callout to a custom setting

I have an integration where I need to get the agency of my endpoint. Once I have the agency this wil be used for all the rest of the callouts. I would like some advice for the following: Is there a ...
0
votes
1answer
25 views

How do I filter support knowledge articles by type using REST API?

I can get a list of all articles types using https://xx.my.salesforce.com/services/data/v44.0/support/knowledgeArticles/ I want to get a list of articles of type Problem_Error__kav, How_To__kav only. ...
1
vote
2answers
30 views

How to create & update email using REST API - Salesforce Marketing Cloud?

I want to create as well as update an email using REST API. I am using following documentation links: POST /asset/v1/content/assets PUT /asset/v1/content/assets/{id} (https://developer.salesforce....
0
votes
0answers
12 views

Updating an AccountContactRelation object via REST API

I was able to create an AccountContactRelation junction object via the Salesforce REST API using the following syntax (which happens to reference the Account and Contact by external id values -- ...
1
vote
1answer
25 views

Update a relationship via REST API

I've got an Account object on which I've created a multiple relationship Online_quotes1__r that accepts OnlineQuote__c objects. Now I'd like to relate my OnlineQuote__c objects with Account via REST ...
0
votes
0answers
24 views

Invalid session error while accessing rest resource: {“message”:“Session expired or invalid”,“errorCode”:“INVALID_SESSION_ID”}]

Though I am able to fetch code and access token successfully, I am not able to access resource and I am getting this error: [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}...
2
votes
1answer
22 views

Unable to get Knowledge Articles for pageNumber=2 using REST API

I am able to get first page Knowledge Articles using REST API. https://XXXX.my.salesforce.com/services/data/v44.0/support/knowledgeArticles The result has articles for page 1 "currentPageUrl": "/...
0
votes
1answer
24 views

How to make Test Coverage 100%? HttpGet method

How can I test this for 100% coverage? @HttpGet global static List<Box__c> getBox(){ RestRequest req = RestContext.request; String boxId = req.params.get('Id'); if(boxId == null) ...
0
votes
2answers
38 views

How to return null for list if we have too many records?

How to return an error msg, if boxes are more than 1000 and we can't return this list (return null + msg)? We need to do that with if or with try catch? Or we can try both variants? @HttpGet global ...
0
votes
2answers
33 views

DELETE a record by REST API without @HttpDelete

I need to make integration between Org1 and Org2. We created a callout POST. When we create an object in Org1, we also create an object in Org2. POST work. All is Ok. Now I need also delete an object ...
1
vote
1answer
28 views

API Header authorization for Bright Pattern

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an error: Execute Anonymous Error on line 6 column:...
0
votes
0answers
15 views

Einstein Analytics - Rest API start job from API

I'm trying to run a dataflowjob from API using Patch Method /services/data/v43.0/wave/dataflowjobs/03Cf4000001pShyEAE { "dataflowId": "02Kf40000005wyAEAQ" "command": "start" } I'm receiving ...
0
votes
1answer
44 views

Update DE using REST API

How do I update only some columns of my DE leaving other columns as they are using primary key with the help of REST API call?
0
votes
0answers
9 views

Cant get live agent availability with REST API in lightning experience

I am using sandbox to log in as an user who belongs to an user group which belongs to a queue. This queue is set to a chat button using omni routing type. When I set myself online using the little "...
0
votes
1answer
23 views

java program with Unirest is giving error

I have a client id and client sercet , i want to invoke marketing cloud rest api to get access token package TestingMC; import org.apache.http.HttpResponse; import com.mashape.unirest.http.*; ...
0
votes
0answers
6 views

How to schedule import data into Pardot Using API's

I have a scenario like schedule import data into Pardot Using API's. Please let me know the information for the below querires. 1) Is there any option for writing/adding API's inside Pardot? if yes ...
0
votes
0answers
25 views

Rest API error Java

I am calling an marketing cloud rest api to insert data async . This is my code , which is error with Exception in thread "main" java.lang.RuntimeException: Failed : HTTP error code : 400 at ...
1
vote
1answer
157 views

“message”:“INVALID_HEADER_TYPE”,“errorCode”:“INVALID_AUTH_HEADER” received

I am trying to call a rest resource within the same org (Because I am inserting records of an object developed by 3rd party and they strongly advised us to not do any DML directly rather they have ...
1
vote
2answers
33 views

Issue getting Salesforce Data Using REST API

Well, first am all new into the REST API's. I am not getting what I am doing wrong. Below are the steps I am following: Created a Lightning Connected App and got CONSUMER_KEY and SECRET_KEY. Hitting ...
1
vote
2answers
39 views

Prevent duplicate record to get created

I am creating the object records which stored the pardot prospect data into custom object. Everytime I run the API it insert the record in SF and which become duplicate. So I want to put some logic ...
1
vote
2answers
105 views

How to write composite query in salesforce

I have used Rest Api Code , i want to query from two different objects in single Http request,For that I am using composite Query in rest Api code HttpRequest req = new HttpRequest(); req.setEndpoint(...
0
votes
0answers
18 views

Can community users using custom REST api to upload big files (more than 25MB)

I found some articles mentioned that REST api could only upload file with 25mb size at most. However, our customers might upload a few hundreds mb for the upload files. We don't want to use default ...
0
votes
0answers
9 views

API Only User Access Restrictions

I have an API-only user set up with a custom profile. The custom profile only has access to a couple of objects/fields that are referenced in an Apex class that is available only to be accessed via ...
1
vote
1answer
41 views

pdf is generating as invalid format

I have the following function which generated an email based on a template passed. The function is triggered from a rest api. public static Messaging.SingleEmailMessage singleMessageHelper( ...
0
votes
1answer
16 views

Boomi to SFDC REST API with OAuth 2.0: 400 Bad Request

Use case: Boomi configured to use HTTP Client connector as per Boomi configuration doc Connected App setup in SFDC as per instructions above OAuth Token successfully generated Boomi POST to SFDC /...
0
votes
1answer
25 views

Marketingcloud Rest api payload

Marketing Cloud Rest api developer guide says to keep the payload not greater than 4 megabytes. Do you know how to check it? Is it enough saving the rest api call i developed into a file of my ...
0
votes
2answers
72 views

Activate a Master Unsubscribe using the SOAP/REST API?

Is there a way to Activate a Master Unsubscribe using the SOAP/REST API? We are using the update method (UpdateAdd) with SOAP API. It works when a user is activated or subscribed to one or more ...
0
votes
3answers
36 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 ...
0
votes
1answer
15 views

Getting attachment thu REST AP

Kindly help me in resolving the issue. I am not able to parse the response from the json data. I need to get the Body part of the attachment. It's giving the error 'Required field missing' a.Body. I ...
1
vote
0answers
14 views

Silent authentication using Oauth2 for client app

I am developing a client app which will be authorized by SF accounts using USER AGENT FLOW. I want to achieve silent authentication wherein SF users of the account will automatically authorize ...
1
vote
1answer
46 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
1answer
27 views

How to bind the wrapper class data into custom objects fields and display it in pageblocktable

I have created REST which fetching the data from pardot and displaying it on the vf page. It is working fine. But I need to store this data in the custom object's corresponding fields on the vf page. ...
0
votes
0answers
31 views

update values from marketing cloud data extension to external data base using api in cloud pages

i want to retrive status from de to external data base . from cloud pages using api calls. please provide any reference links. Thanks in advance.