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
3 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. %%[...
0
votes
1answer
21 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
714 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
29 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
32 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 ...
6
votes
4answers
746 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
40 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
0answers
27 views

Apex API Callout [closed]

Whenever a Account is created, the records details need to be sent to an external system using Apex. I searched many articles and got details about HTTPRequest and HTTPResponse which will help to ...
0
votes
1answer
26 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
50 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
18 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
47 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
50 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
25 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
401 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
58 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
39 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
30 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
408 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(...
2
votes
1answer
330 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, ...
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
31 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
389 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
30 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 ...
1
vote
2answers
54 views

SF Bearer Token behaves differently for different REST API Methods

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 ...
3
votes
1answer
42 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
413 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
52 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 ...
0
votes
1answer
29 views

How can I add “set-cookie” to a RestResponse?

A few years ago, Salesforce disabled debug logs for REST guest calls. The only way to enable generating the logs is to add a cookie to the incoming call. Docs here. The incoming call in my case is ...
1
vote
1answer
35 views

REST API for metadata components / types?

I have been doing some research and I am unable to find the correct endpoint for fetching Metadata Types & Components. Somehow, in workbench they are able to fetch this information and it can be ...
2
votes
1answer
47 views

Difference between Authorization Code and Access Token [closed]

Can you please explain the difference between authorization code, access token and bearer token? I've been looking for this on Google but didn't clear things for me. From REST API dev guide all I ...
2
votes
2answers
43 views

Which endpoints are supported for OAuth2 token authorization?

Documentation says that for OAuth2 token authorization URL like login.salesforce.com should be used For authorization: https://login.salesforce.com/services/oauth2/authorize For token requests: https:...
7
votes
1answer
3k views

What is the longest URI that Salesforce will accept through the REST API?

The Background I was handed a task to populate a developer sandbox with a limited set of data from our production org to allow another dev team to be able to test integration with a third party (with ...
0
votes
1answer
451 views

Having Trouble with Force.com REST API oAuth2 Authentication

I am experimenting with Pat_Patterson's "Interact with the Force.com REST API from PHP". I am using PHP Version 5.6.3 , and I already registered my app via Setup->Create->Apps->Connected Apps. I setup ...
0
votes
0answers
30 views

401 Unauthorized Invalid_session_id error while using refresh token

3rd Party app needs to access Salesforce resources without user interaction. I am trying to use OAuth refresh token - Refresh token . I generated an access token and a refresh token using postman and ...
1
vote
1answer
92 views

Apex Rest - Api error handling HTTP status codes

I am trying to handle multiple error codes in my REST service. Can anyone guide me if I am doing this correctly. try { if(Limits.getDmlRows() < Limits.getLimitDmlRows()){ ...
0
votes
1answer
34 views

Rest API Salesforce with Certificate

I have a Rest API Service: @HttpPost global static String actualizarAveriaIngenico(String numorden_stu, String numproceso_mant, String estado_averia, String nombre_tecnico, String ...
0
votes
0answers
20 views

Fire event using oauth

Switching from the generic endpoint to tenant endpoint is giving me issues injecting a contact into a journey. If I test the setup in postman everything works fine. Converting the 'old' method to the '...
14
votes
1answer
707 views

Apex Framework / library for consuming REST services

To consume REST services there is a lot of boilerplate code needed: Build Apex Objects to model the responses Code to deserialize REST responses to those classes Handling of HTTP requests, responses ...
5
votes
1answer
73 views

Message sent through Marketing Cloud isn't delivered and doesn't show up on the deliveries endpoint, what can it be?

I'm making a call to Marketing Cloud's endpoint to send SMS messages like this: -- request to /sms/v1/messageContact/{messageId}/send { "mobileNumbers": [ "55009999999999" ], "...
1
vote
0answers
55 views

Tooling API not retrieving relationship name/label

Querying on Customfield using Tooling API in workbench is returning relationship label "null" even if object has the relationship field(lookup/master-detail). For Example: My Object has 3 relationship ...
1
vote
1answer
526 views

Getting Attachment Id with subquery using rest api in c#

Hey guys i am trying to get attachment Id in a subquery via the rest api in c# here is my query: SELECT Id, Name, First_Name__c, Middle_Name__c, Last_Name__c, (SELECT Id FROM Attachments WHERE Name = ...
2
votes
4answers
1k views

Calling a rest API from one Org to another Org?

I have created Connected App & Auth Provider. This is the Code i am currently running. Getting error. What I am doing wrong? Can anyone please help me with this? 1st Org - (Class ...
0
votes
1answer
548 views

display image in json response in Apex

RestResource(Urlmapping='/v1/test/*') global with sharing class DD_Rest_Test{ @HttpGet global static Response getData() { Response resp; RestRequest req = RestContext....
0
votes
0answers
8 views

OBJ: Product2 - Scheduling is not enabled for this type: Revenue Schedule Type Via OData

We just enabled revenue scheduling for client as soon as we enable revenue schedule, we no longger able to edit or create product via REST API, and receiving "OBJ: Product2 - Scheduling is not enabled ...