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

Internal Server Error When POST to Marketing Cloud create contact REST API

I am getting an internal server error when trying to save a contact in Marketing Cloud with Rest API. The body of my request is: { "contactKey": "acruz@example.com", "attributeSets": [ ...
-1
votes
2answers
43 views

Empty request body when when using curl

I have a rest service in salesforce which it has to receive different requests. When I test the service sending requests, if I use a REST Client I am able to get the requestbody properly but if I use ...
0
votes
0answers
23 views

Setting up Named Credential for External Rest API with OAuth2.0

I am trying to understand how to set up the Named Credentials & OAuth Provider in Salesforce for calling the External REST API. Before setting this up I tested the call to the REST API through ...
0
votes
0answers
25 views

Getting unauthorize status as response when trying to call a rest service from a force.com site

I am trying to create an app rating system using public rest services. I've made a rest service, a site and associated a VF Page with the site from where we need to take the input from user and insert ...
1
vote
0answers
65 views

REST services getting empty result for User object

We set up a REST service to retrieve data from our org. Everything works great, except for the queries to the User object. When the query returns we get an empty list. This used to work (it was ...
0
votes
0answers
17 views

Converting a cURL to Apex Request [duplicate]

curl -X POST https://api.voilanorbert.com/2018-01-08/search/name \ -u any_string:{secure_token} \ -d domain="example.com" \ -d name="Fake User" I am strugging to convert the following into an Apex ...
1
vote
1answer
19 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
19 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 ...
-4
votes
0answers
67 views

CPU time out error in batch. Records processes 12746

`` ErrorTempSSP1Data ins = new ErrorTempSSP1Data(); for(EQ_TempSSP1Data__c record : tempSsp1Data) { distinctTempSsp1DataSourceSystems.Add(record....
0
votes
1answer
48 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
26 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
37 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
31 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
70 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
45 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
31 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
33 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
72 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
25 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
37 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
30 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
45 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
40 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?...
2
votes
1answer
27 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
45 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
88 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
35 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
36 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
34 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
41 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
92 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
18 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
16 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
20 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
30 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
136 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
40 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
25 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
32 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
43 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
38 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
20 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
54 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
57 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
54 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 2 3 4 5 15