Questions tagged [rest]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

How to retrieve folder location for an image name (i.e.12132019_sales_hero.jpg) using REST API or AMPScript or SSJS

Can anyone offer a suggestion of how to go about retrieving the actual folder location of where an image is located. I know using REST API Advanced Query Filter you can retrieve a list of the contents ...
0
votes
1answer
16 views

REST API GET Callout and test method

I have created a class Apex class to get info from and external database and insert the info to the account before save. The method is called by a trigger. Everything is working fine but I am getting ...
1
vote
0answers
28 views

SOSL using POST REST /parameterizedSearch API

I got the "/services/data/v46.0/parameterizedSearch" POST API working for a complex SOSL search I want to perform. I am referring to the Salesforce documentation here: https://developer.salesforce....
0
votes
0answers
35 views

REST API Create Multiple Records

Create multiple records with reference to the official documentation:Create multiple documentation url But I need to fill the lookup field value, I found the official document again:update ...
0
votes
1answer
23 views

Set Email Subject and Body From API [closed]

Looking at the Marketing Cloud API (specifically the REST Reference), I can't seem to find anything that allows you to set the subject and body of an email. Is there some work around or way to do this?...
-1
votes
0answers
19 views

How to call external rest api from apex with xml request [duplicate]

I am having a request to call external rest API which supports request & response body in XML format. Can anyone suggest me how can I prepare the request body in XML Format? I will pass that XML ...
2
votes
1answer
25 views

ApexREST Websrvice StatusCode with ResponseBody

I am writing a REST Webservice and have the following piece of Code. @RestResource(urlMapping='/UpdateTransaction') global with sharing class OpportunityTransaction { @HttpPost global static ...
0
votes
1answer
30 views

How can i use Marketing cloud Rest API in client side?

Im trying call one endpoint from marketing cloud rest api with AJAX, but im having problems with CORS. This is the error: No 'Access-Control-Allow-Origin' header is present on the requested resource. ...
0
votes
1answer
60 views

API call to external system to pull data to marketing cloud

Is it possible to make an API call from the marketing cloud to pull data from external system? One way to do it create a script activity and schedule it or calling the activity through API. Real ...
0
votes
1answer
26 views

Salesforce cURL Example with Session ID is not working

I'm trying to use the Salesforce Rest API with the session ID I received via a SAML Response from the same Salesforce Instance (as IDP) but I get the message: [{"message":"This session is not ...
0
votes
1answer
20 views

Custom exception on Service Response with Standard API

Using standard API, when i receive a POST, if things go wrong i must return an error response. Since i'm not using a custom web service but a TriggerHandler, when one of the required parameters isn't ...
0
votes
1answer
34 views

Authenticate Calls made to Salesforce webservice [duplicate]

I am using this exact example from trailhead https://trailhead.salesforce.com/en/content/learn/modules/apex_integration_services/apex_integration_webservices @RestResource(urlMapping='/Cases/*') ...
1
vote
2answers
32 views

JSON Date field Error

I have the JSON string below that is being sent to a Salesforce Webservice: {"Opportunity": {"Id":"006g000000IiM5z", "Appraisal_Date__c":"2019-11-22"} I serialize the request into a Map and am ...
0
votes
1answer
25 views

Not able to view attachment in salesforce, when uploaded through Multipart Rest API

Below is the code which I'm trying to insert attachment through API not sure what is wrong, when I try to open 'Failed to load pdf' error comes or if I send image type file then that also doesn't open ...
1
vote
1answer
37 views

Can using the BULK API to perform SOQL queries save on total number of queries?

This is a pretty hypothetical question. So I apologize if this isn't sufficient information. Let's say I want to query for about 50000 accounts. And I have a very simple select statement that tries ...
0
votes
1answer
49 views

how to get more than 2000 records rest api

I am trying to get more than 2,000 records from salesforce using Rest Api. /services/data/v47.0/queryAll/?q=Select+Id,XXXX__c,CompletedDateTime,XXX__c+from+task+WHERE+CreatedDate+>+2019-10-20T00:...
0
votes
1answer
15 views

Different QuoteDocument using Connected APP REST API and Workbench / Interaction

I've set up a autolaunched Flow, which creates a PDF based on a Quote Template. My connected APP use this Flow through the REST-API. The output is an empty PDF with a Size of 2 KB. The same Flow, ...
1
vote
0answers
15 views

Metadata Translation API: REST Request URL [duplicate]

I am trying to retrieve the translation for a custom picklist values , using REST I think i need to retrieve CustomObjectTranslation : https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/...
0
votes
0answers
16 views

Status=Unauthorized, Code=401 using Named Credential from Apex

I have a REST Integration between two Salesforce Orgs and have set up a Connected Application in Org A and an auth provider and named credential in Org B. The named credential shows as authenticated -...
0
votes
0answers
14 views

Set header and add header in rest Class

I have below class which i need to test it from workbench/postman. I am not sure how should i test it . @RestResource(urlMapping='/CheckAuth/*') global with sharing class example1 { @HttpPost ...
0
votes
0answers
27 views

How to access the REST API with the user with Permission 'Is Single Sign-On Enabled' is enabled

I have created one RestResourc to give the ability to the external system to attach the Report to Asset in Salesforce. Now the problem I am facing is the user which I am using for Authentication ...
1
vote
2answers
95 views

File content missing error while creating transient document on adobe sign using REST API

I am trying to create transient document in adobe sign using rest api. After lot of research I was able to make the correct multi form request in Salesforce Apex.But now I am getting the file content ...
-2
votes
1answer
38 views

how to write a test class for web service HttpPost

I'm new to development here I'm developing a webservice in rest and I have no idea about how to write a test class for that. Please find the below code of apex class: @RestResource(urlMapping='/...
0
votes
0answers
22 views

Rest Composite Resource

I try to insert a parent record with own child records using an external id (Serial__c field), but I receive this error: "statusCode": "INVALID_FIELD", "message": "Cannot reference a foreign key ...
-1
votes
2answers
29 views

Deserialize JSON Response from Rest Query, ERROR: System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set

Trying to convert some JSON to an Account List, I suspect my error is because the query next stuff coming into the response. How can I convert these results to an account list? HttpRequest ...
2
votes
0answers
28 views

LWC - Retrieving WAVE Dataset information

I'm trying to make a callout to /services/data/v45.0/wave/datasets in a lightning web component. I can successfully make the callout for the running user in apex using UserInfo.getSessionId() but ...
-3
votes
1answer
37 views

Sending status code with response using apex [closed]

I am working on a rest API using http post to get the params and create a record. After creating the record I need to send a response with the details of created record along with a status code and ...
0
votes
0answers
25 views

Updating Metadata of Standard Objects

Good day! I bumped into a question from here. I was wondering if there is a counterpart for this when it comes to Salesforce Standard Objects? Upon reading the answer, it suggests a library which ...
0
votes
0answers
15 views

How to delete all rows with certain condition using Marketing Cloud Rest API

I'd like to hit a rest API and delete all rows in a data extension. The data extension doesn't have a primary key, but it has a "condition = x". For instance: condition, value x, 11 x, 22 x, 33 y, 44 ...
1
vote
1answer
51 views

Calling a REST API with a preset token

We have a need for equipment to post status updates to salesforce. Unfortunately the equipment lives on a secure network that will not allow return communication The methods I see all require a ...
0
votes
2answers
50 views

Salesforce Rest API, Issue in getting Params from Rest API

In the below code, If I print the String variable report, I am able to get only half of the string that is 123 characters, while the external person is actually passing me a string that contains ...
0
votes
0answers
53 views

Apex callout yields “Ending position out of bounds: -1” error

This is my vf page <apex:page controller="AccountRest"> <apex:sectionHeader title="Accounts" subtitle="List View"/> <apex:pageBlock> <apex:pageBlockTable value=...
1
vote
1answer
72 views

Apex callout with a client certificate

I have written one Rest service which is returning a access token to resend it to endsystem to get the final response but we are getting "Request processing failed; nested exception is java.lang....
0
votes
1answer
27 views

Help debug MobilePush send

I am trying to use Triggered API to send a Push notification. Can anyone help me debug what could be wrong with this simple code? I have the right Client Secret and ID as well as mobilepushlistid. %%[...
1
vote
1answer
34 views

nforce org.getUrl(url,cb) - value of url

I have a Node app running on heroku where I am using the nforce lib. I received { Error: Could not find a match for URL error.} while using org.getUrl from nforce library. For the url string, I have ...
0
votes
1answer
49 views

What's the problem with this backslash in SOQL query?

I'm receiving a String query with query params (via URL), and one is mandatory and seven are optional. So if i don't receive a param, shouldn't be included in the query. For instance: My code is: ...
0
votes
0answers
56 views

Create a StandardValueSet via Tooling API

I am currently working on StandardValueSet and I would like to try to insert an entry in the said resource. I looked at the documentation and it sort of lacks the necessary information for me to be ...
0
votes
0answers
80 views

Escaping HTML in JSON in rest callout

I am sending some html content inside json in the body of a REST callout from Salesforce to Dotdigital per their specs which is working well overall. string.escapeHTML4 is handling most of the ...
0
votes
0answers
17 views

how to add Loop conditions in apex test classes? [duplicate]

Could anyone help me how to write a test class for this logic.I'm little confusing here. public with sharing class XMLparserForIds { public String XMLString1 = '<?xml version="1.0" encoding="...
0
votes
1answer
38 views

not able to access the variable values after using the continuation class

private class StateInfo { Account acc {get; set;} StateInfo(Account acc){ this.acc = acc; } Contact cont {get; set;} StateInfo(Account acc, ...
0
votes
1answer
53 views

CLoudingo: SFDC Rest API JSON callout. 400 error returned

The code below is running, i had to pass on the login credentials to Cloudingo because it is/was a stateless REST API call from SFDC to CLoudingo. Have to hardcode the key/password into the SFDC Code. ...
1
vote
0answers
20 views

What API limits are imposed on Knowledge Base REST API?

I would like to know what limitations are there on the Knowledge Base REST API? Would this use the same API limits imposed in a Salesforce org? or does it also use the Site.com limits (number of page ...
0
votes
1answer
89 views

Rest API request on behalf of specific user

I have to retrieve data from Salesforce (using default endpoint for Rest Api SOQL queries) for a specific user. Now for getting Access_token I'm using "grant_type: password" with "System User" who has ...
1
vote
2answers
67 views

HttpResponse[Status=BAD_REQUEST, StatusCode=400]

I'm trying to sending a field value to third part but here the issue is Suppose the filed is Name = "Test Account" here in this case call will be failed but for suppose Field Name is like Name = ...
0
votes
1answer
38 views

Auto Refresh Access Token

I have written this method to get accesstoken when I send Id & password given(Which I havent Hardcoded Below). I am saving my access token in custom setting and want it to expire, call this method ...
1
vote
1answer
98 views

Get the Info of a REST API Sender

Is there a way to get the Sender info in a Rest WebService? for example : Part A - Sender sends this JSON Via POST Request : Http httpProtocol = new Http(); HttpRequest request = new HttpRequest();...
0
votes
0answers
36 views

How to call REST API from Javascript

I have REST end point (like http://18.xx.11.212:8010/KKT/getteledetails) and parameters are in JSON format like { "teledetails" : "AHG45", "StartDate" : "" }. Now I want to call the above REST ...
0
votes
0answers
9 views

Outbound messages removes TextArea Long, for bulk data upload

I built a Outbound Message endpoint, which works like a middleware, and calls other endpoint, which is REST based. When I create/update a single record, it sends all the info specified in the ...
0
votes
2answers
65 views

Can we send Rich text Field's HTML from Service Cloud to any other system Via API

We have a use case where the Users will make text entries in a Rich Text Salesforce Field and will do customization on the input text field with the salesforce provided rich field's capability. We ...
-1
votes
1answer
75 views

How can I use OAUTH on Salesforce Live Agent REST API

We want to use OAUTH - userid/password flow to access salesforce live agent rest API. We have implemented this for other rest api provided by salesforce. However the live agent rest api are wide open ...