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
1answer
69 views

Permissions needed for calling REST API

I am working on an assignment where I need to expose Contact data to a webservice via REST API. I was able to get the REST API call working thru Postman/SoapUI only when the Profile has the View All ...
3
votes
1answer
44 views

How to save webhooks page data to Salesforce custom object?

In my requirement my webhook url having some data. when i am updating or inserting some data in my webhook page i want to save those data automatically in salesforce custom objects. Is there a way to ...
1
vote
0answers
36 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
17 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
2answers
71 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
28 views

Email Preview using REST API [duplicate]

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
27 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
134 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
278 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
38 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 ...
2
votes
0answers
75 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
2answers
106 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
49 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
49 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' : '...
1
vote
0answers
118 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
19 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
39 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
27 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
27 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
33 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
187 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....
1
vote
1answer
47 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 ...
2
votes
1answer
42 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
34 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
41 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
167 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
37 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
1answer
33 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
175 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
1answer
96 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.*; ...
1
vote
1answer
1k 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
42 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
47 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
222 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(...
1
vote
1answer
61 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
88 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
36 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 ...
1
vote
2answers
148 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
50 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
21 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 ...
2
votes
0answers
56 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
233 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
108 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. ...
1
vote
1answer
182 views

HTTPGET Request in AMP Script with Bearer Token

I was able to successfully perform HTTPPOST using AMPscript with a header, but when I attempted to perform HTTPGET with a header, it is throwing a error. I referred the HTTPGet documentation which ...
0
votes
1answer
281 views

HOW we Send apex REST Request IN XML Formate to an external URL and Parse XML Response?

i am in middle of a integration with external system in Salesforce. My requirement is to send an XML Request to an Endpoint and also Parse xml Response got from endpoint to create some Contact object ...
0
votes
2answers
34 views

How to handle multiple type of json in one parser class?

I am expecting two separate jsons in case of success and failure. In case of success I get a nested json whereas in failure I get a simple json mentioning status : failed so my class I used to ...
0
votes
1answer
30 views

Test Class for testing controller twice

I have a test class below that is successful and covers accessing my controller with a callout: @isTest static void testUpdateOfPack(){ MockPackageService mockRes = new MockPackageService(); ...
0
votes
2answers
96 views

GET API callout in test classes

I have a web service callout that checks if an order’s type is return and needs to see what the actual boughtPrice is: webservice static String updateBoughtPrice(Id ordId){ Decimal boughtPrice = ...
0
votes
1answer
48 views

Reusable rest wrapper

For remoting functions I use a reusable wrapper class to standardize responses and reduce code duplication. When trying to use the same principle for the rest classes, any external response class ...
0
votes
1answer
70 views

how to refresh pardot API key every hour automatically

I am making callout to PARDOT and displaying prospect data into VF page, the issue is every one hour api_key get expired and I have to manually make a authentication call to pardot to get the api_key. ...