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
2answers
13 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 ...
1
vote
0answers
13 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
34 views

Sending status code with response using apex [on hold]

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 ...
2
votes
1answer
341 views

SOQL over REST: “Truncated”, “Malformed query” depending on which record IDs I ask for

The following query, when run over the REST API, gives me an error: SELECT Id WhatId, WhoId , TaskWhoIds , Subject, ActivityDate, Status, Priority, Owner.Name, ...
-1
votes
1answer
45 views

Send a pdf file from Salesforce to 3rd Party through REST API

Can someone help me in sending a pdf file from Salesforce to 3rd party(s3 bucket). I am currently working on Lightning experience and on Account record, I upload pdf file in Files section which stores ...
0
votes
0answers
14 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 ...
0
votes
0answers
23 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 ...
1
vote
1answer
724 views

ExactTarget - How to post a record to a data extension that has no primary key?

I have a data extension with the following fields: recordId - number recordKey - text - length: 50 recordValue - text - length: 50 None of the above fields are primary key, because they can occur ...
1
vote
1answer
385 views

{“error”:“invalid_grant”,“error_description”:“authentication failure”}

Hi I am trying to connect one salesforce org to another but getting below error in response body while trying to get the access token using the username password flow in oauth. Please suggest what is ...
0
votes
2answers
41 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 ...
1
vote
1answer
43 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
1answer
902 views

Calling salesforce REST API from sharepoint

I have a sharepoint app in which I call salesforce REST API. I have obtained access_token successfully from the app, (using username-password flow) but when I try to access some resources such as ...
0
votes
1answer
685 views

Making REST API calls from Salesforce to Marketo

I am new to both making API calls and coding in Apex and feel way over my head. How can I make a call to the Marketo REST API through Salesforce? Is this possible through Apex? For example, ...
2
votes
1answer
913 views

How do you construct a REST API URI with multiple primary keys?

The documentation for upserting data extension rows by key uses this as an example URI: https://www.exacttargetapis.com/hub/v1/dataevents/key:SomeKey/rows/Email:someone@exacttarget.com. Let's say ...
0
votes
0answers
49 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
43 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....
1
vote
2answers
369 views

Any replacement of chatter API for Download URL e.g. “/services/data/v32.0/chatter/files/06917000000XXXXAAA/content?versionNumber=1”

I want to download the file or ContentDocument using non-chatter REST API. I have explored that we can download any ContentDocument or file by using following kind of chatter REST API (which is ...
2
votes
2answers
57 views

Calling REST APIs based on a session established via a community login

I'm currently dealing with an authentication issue with two different Salesforce REST API endpoints. We are trying to consume the API from inside a Visualforce page in a Salesforce community. To do ...
-1
votes
0answers
33 views

Getting “No data received at gateway from client error” while hitting the end system URL with POST method

enter code herewe are using the post method to hit the webservices. We checked everything like key value pair and certificates, everything is right from our side. still we are getting them error as" ...
1
vote
1answer
105 views

First REST API Call for the day taking more than 40 seconds

We have exposed a custom rest webservice to perform dml operation on Case. We have a custom metadata where we fetch for a particular record based on the request parameter and populate the values for ...
0
votes
0answers
50 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
1answer
24 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
29 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
729 views

Uploading multiple files using REST API of Chatter.

I am trying to upload multiple files using Chatter REST API. I was previously able to upload a file. Now I have to upload multiple files. I got these file names and parameter names in array, as stated ...
0
votes
1answer
37 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: ...
6
votes
4answers
810 views

Lightning: Getting a 401 when calling @AuraEnabled Apex method to do a REST call

Trying to write an Apex method that accesses Chatter REST api using this technique: https://chintanblog.blogspot.com/2017/02/call-salesforce-rest-api-from-apex.html This method is @AuraEnabled - so ...
0
votes
0answers
46 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
32 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
52 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. ...
3
votes
1answer
3k views

REST error handling design

I have created a very simple REST service to convert a lead: @RestResource(urlMapping='/ConvertLeadFromApp/*') global with sharing class RESTLeadConvertController { @HttpGet global static ...
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
57 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
60 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 = ...
1
vote
2answers
3k views

ErrorCode 180008 - Unable to queue Triggered Send request. There are no valid subscribers

I'm trying to send an email by ET rest api in Java. I already successfully sent a SMS and got a token in response, but an error is triggered with emails. Here is the JSON I send : { "To": {"...
0
votes
1answer
33 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 ...
2
votes
1answer
413 views

REST API: How do you clear a Picklist value?

Using the rest API, I want to be able to clear the value of a Picklist item. For example, I have the Account SObject which has an Industry Picklist. Using the Salesforce website, I can set the value ...
1
vote
1answer
72 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();...
4
votes
3answers
2k views

REST OAuth connection for Bulk API queries

Is it possible to authenticate an OAuth app for the user and then make Bulk API queries on their behalf? The results are easily going to be more than 20k records each authenticated user. When I have ...
1
vote
1answer
41 views

How can I disable my existing Apex REST Webservice in production?

I have an existing Apex REST Webservice configured in production for consumption by a partner for Lead creation. However, we are not working with that partner anymore and hence want to disable this ...
0
votes
0answers
35 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
1answer
455 views

How to create JSON string for REST callout from Wrapper class

I have found a lot of different examples of this, but I'm still having troubles accomplishing this. Here is the webservice which is working: //WORKING Webservice in target org @RestResource(...
0
votes
0answers
8 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
32 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
vote
1answer
398 views

User and profile for REST API only

I am developing integration in Salesforce with external application. This app uses my api by OAuth password flow. For this I have created user and profile, restricted access to all tabs etc. Are there ...
-1
votes
1answer
37 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 ...
3
votes
1answer
43 views

REST API 12MB Limit

I'm receiving a PDF in Base64 from an external web service, the PDF is received in JSON along with some other details. Is there anything I can do to avoid the Heap size being blown when converting the ...
1
vote
2answers
8k views

OAuth2 token request failing

My access token request is failing with the following error response in HTTP Response. { error: "invalid_client_id" error_description: "client identifier invalid" } I am trying with the Username-...
1
vote
1answer
424 views

Unable to add photoURL through REST API

I am trying to create an contact through REST API and gave PhotoURL with value as twitter photo url. Now, I got the below response. I am unable to find settings to enable this option. Can anyone ...
0
votes
2answers
69 views

Marketing Cloud API CORS problem

I would highly appreciate if anyone could help me in handling CORS policy for Salesforce Marketing Cloud API requests… The situation is following: I need to make direct API calls to Marketing Cloud ...