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
1
vote
1answer
36 views

Getting LastModifiedDate of a Component File?

There is a post from 2019 here that details obtaining a couple of fields about a Lightning Web Component. Is there a way to get that information programmatically? Could not tell if trying various ...
0
votes
0answers
21 views

How to render content on mobile app through salesforce rest api when the service is sending string value consisting of <div> tags

discriptionvalue += '<div style="font-size:18px !important;font-weight:bold !important;">'+ s.Title__c + '</div>' ; Note: Need to render the discriptionvalue in my app with the style ...
2
votes
1answer
107 views

Calling out via Named Credential - API vs Token endpoint

I created Named Credentials to authorize the api and got the token. Now i want to use the same end point to get the weatherdetail. when i tried to access same named credential then its showing error ...
0
votes
1answer
42 views

Parsing nested object

I am trying to parse the 'events' and 'consumer' details from this payload using Apex but am getting stuck getting to the eventData. Could explain how I would correctly retrieve those objects? ...
-1
votes
2answers
276 views

how to create and send the request/response body for the post method in test class [duplicate]

static testMethod void testPost(){ RestRequest req = new RestRequest(); RestResponse res = new RestResponse(); Profile testEditorProfile = [Select id from Profile where Name= :System....
0
votes
1answer
91 views

Problem with Rest Webservice Code coverage [duplicate]

I have the following set of lines in my code RestRequest req = RestContext.request; RestResponse res = RestContext.response; AreaRequestWrapper areaRequestRecord = (AreaRequestWrapper)...
1
vote
1answer
141 views

URL doesn't exist in REST api call

I'm trying to subscribing platform event channel through REST. I have executed below code I'm getting the error called "URL doesn't exist". Is there any changes needed in the url format. Please ...
1
vote
1answer
115 views

Getting content using force.com sites in salesforce

I have a requirement where i have to download archived content from external system. However, salesforce does not allow to get archived content from REST API. The way i can download the archived ...
4
votes
1answer
75 views

Post a JSON payload with illegal characters / binary in it [closed]

I recently worked on an issue where a json payload with binary content was posted to a rest service which resulted in Blob.toString() raising a 'BLOB is not a valid UTF-8 string' exception. We're ...
2
votes
2answers
44 views

RestResource extracting array from JSON packet

I am currently receving a JSON packet from an external server and placing the values in variables for further use. The JSON packet has an array that can and will grow depending on the amount of assets ...
0
votes
1answer
88 views

REST Method to update the a contacts status in the All Subscribers list

So far I have succeeded at updating a contact's email address using the REST API and this method. The JSON body of my request looks like this: { "contactKey": "[MY_CONTACT_KEY]", "...
0
votes
0answers
28 views

Added my first package with API Integration Component. How to test an API call (SOAP or REST)? [duplicate]

I am a developer but I admit I am confused by going through the Marketing Cloud API documentation. Inside our Marketing Cloud's installed packages, I created a new package and added an API ...
1
vote
1answer
43 views

Receive and handle POST from external server outside of Salesforce [closed]

I am trying to accept a JSON payload that is supposed to create new assets in the Asset sObject. I'm trying to wrap my head around how to expose the API to the server that is sending the POST request. ...
0
votes
1answer
130 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
1answer
98 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
58 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
35 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?...
2
votes
1answer
30 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
194 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
146 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
122 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
21 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
42 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
77 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
31 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
59 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
636 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
33 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
19 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
47 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
58 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
318 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
44 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
33 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
51 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
115 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
214 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 ...
1
vote
1answer
69 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
88 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
58 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
279 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
42 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
54 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
113 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
84 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
116 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
1answer
86 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
73 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
24 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
252 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
2
3 4 5
16