Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest]

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

1
vote
1answer
19 views

C# Get SessionId returns affinity token empty (“”)

When im doing the GET request to get the affinityToken, its come empty {"key":"b99d9a87-c7db-4f5a-a20d-9419bb2d0ad0!1549978665283!x6db6+hNaLzITCEq9EcjFLyKAjw=","id":"b99d9a87-c7db-4f5a-a20d-...
1
vote
1answer
23 views

JWT authentication without a username?

I'm working on a managed package that needs to allow an external web service to call an Apex REST endpoint within the package. As far as I'm able to gather, the best route is to use OAuth2 JWT ...
0
votes
1answer
43 views

Deserialize json request error - unexpected character

I am getting this error when trying to deserialize an HTTP response - hope you can help: FATAL_ERROR System.JSONException: Unexpected character ('<' (code 60)): expected a valid value (...
0
votes
1answer
28 views

Get Object id using rest api

Is ther any unique id available for object. If yes, How to get a object's unique id ie.object_id using rest api.
0
votes
1answer
437 views

How to download reports from Salesforce using Java Bulk API or Rest

How I can download reports from Salesforce about completed tasks using Java Bulk API or Java REST API? I implemented this code https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/...
1
vote
1answer
435 views

Query Validation Rules associated with an Object using REST API

I need to retrieve all the validation rules associated with a given object, using the REST API. Looking in doc/forums, I've found that I could retrieve validation rules associated with an object ...
1
vote
1answer
464 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 = ...
0
votes
1answer
35 views

Salesforce Unauthenticated REST - HTTP 301

I followed this tutorial, http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/ , to create a public rest service in a developer sandbox. If I run any of the following: ...
0
votes
1answer
451 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
1answer
50 views

Reading in XML from webserivce request using HttpRequest

I have seen multiple posts online talking about how to read in XML data from a web request using HttpRequest, but I cannot seem to make it work or find any documentation on it. The closest I have ...
0
votes
0answers
20 views

consuming curl command in HttpRequest [duplicate]

Can you help me recreating this curl command into Rest callout...? curl -i -k -X POST -H "Content-Type: multipart/form-data" -F "file=@{full file path with name and extension}" {https://upload-dev....
0
votes
1answer
29 views

How to get Data Extension ID using Journey ID

In Salesforce marketing cloud, I need to get the Data Extension ID of a journey using REST or SOAP API Call. Then this Data Extension ID will be used in further set of API calls. The challenge was to ...
0
votes
1answer
557 views

Achieving Cookie Dependent REST API session

I am working on a application where hitting a button in Salesforce user interface must redirect you to some third party web application session. Below is some sample code that I use to connect: ...
0
votes
0answers
13 views

Upload PDF from Files (Content Document) to External Server using REST API

I have a requirement where every new PDF uploaded under Files for Accounts should be automatically posted to an External Server using REST API. Any resources on how this can be done?
1
vote
1answer
536 views

How to do programmatic OAuth flow between RestResource and Server Application

I have an external application that has a bunch of information to create new Lead objects. As well I've created a RestResource Apex class that is mapped to URLs on the salesforce instance for my ...
0
votes
1answer
25 views

How to Insert or Update Blob Data using Workbench

Bascially I'm trying to execute the example given here for the upload of Blob Data from Workbench. but on executing I'm getting below error: message: Unexpected character ('C' (code 67)): expected a ...
1
vote
1answer
494 views

Issue inserting Recordtype for object

I am writing a JAVA-application that mainly functions as a CRUD-platform for my employees. On this application, users can manage data from a specific objects. I am using REST-API. Now, here is my ...
4
votes
1answer
594 views

Live Agent REST and CORS

I am trying to create a chat client using the SalesForce Live Agent REST API but I am running into an issue with CORS. Does the REST API support JSONP, if so do you have some examples, if not then ...
2
votes
1answer
2k 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 ...
0
votes
1answer
546 views

Special Characters in REST API

I'm using ArcGIS Online to Store some info and then later show it up on a Map. But, I'm having trouble sending data when it has special characters(in this case single quotes). Apex Code that makes ...
2
votes
0answers
229 views

Is there a way to create an OpenAPI / Swagger spec for my Salesforce Account?

I've been using the Saleforce REST API for a while and I'm interested in using an OpenAPI / Swagger spec to auto-generate a SDK using OpenAPI Generator and Swagger Codegen. Is there a way to get an ...
0
votes
3answers
45 views

What's the difference between an HTTP Request Message and a Salesforce Rest Resource and the HttpRequest class?

I am new to HTTP and Salesforce's APIs What is the difference between the salesforce rest resource they talk about in this trailhead module - https://trailhead.salesforce.com/content/learn/modules/...
5
votes
3answers
396 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
1answer
32 views

How do I specify profile mappings on a PackageInstallRequest?

I have created an unmanaged package containing a Salesforce Platform Profile named "Foo". In the org where I am attempting to install the package, I have also created a Salesforce Platform Profile ...
2
votes
3answers
100 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 ...
1
vote
2answers
63 views

Dynamic JSON Body in HTTPPost Ampscript

I am trying to set dynamic JSON parameters in an ampscript HTTPPost. When attempting to insert those parameters it only returns the actual ampscript function and not the data that was supposed to be ...
1
vote
1answer
690 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 ...
0
votes
1answer
37 views

How to serialize REST Request from Wrapper class for existing Salesforce data?

I am trying to format my SObject data within a wrapper class to POST data to another Salesforce org from a custom Work__c object, but I am having a hard time understanding how to add an instance of "...
0
votes
1answer
51 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
1answer
19 views

Rest API Response - Break Address into multiple fields

I am working on an assignment where we enabled an external system to search for contacts in Salesforce based on lastName, firstName, BirthDate. I have developed a webservice which queries the Contact ...
0
votes
1answer
616 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
787 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
2answers
928 views

Salesforce Case integration via REST API call

I have two sales-force org (org 1 and org 2).I am insert a new account in my org 1 now i want that every time a org 1 account created then org 2 will automatically update its account with org 1 data ...
0
votes
1answer
654 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 ...
4
votes
2answers
140 views

Does IOT Cloud have REST APIs? Or does it uses third party platforms to connect devices to cloud?

I am working on integration services for salesforce. Salesforce has APIs e.g. for creating Account, Contact, Lead etc., making it easy to develop integration services. Now I have been asked to ...
0
votes
2answers
34 views

Rest Call to locally installed machine

I am working on integration PRTG with salesforce. PRTG is locally installed (at http://127.0.0.1 ). I used following endpoint public String baseUrl = 'http://127.0.0.1/api/table.xml?content=sensors&...
2
votes
1answer
846 views

Username-Password OAuth Authentication for community users?

I have a native ios app and i want to login using the username password flow, From the POC i made i discovered that for community user, i dont get a security token which i was using while REST call to ...
0
votes
1answer
66 views

How to access the records associated with a custom view in REST API

I would like to access the records related to contact predefined list views (like birthdays this week, contacts added this week), and custom views created by the user, using REST API. The SOQL query ...
4
votes
1answer
627 views

REST API vs SOAP API?

One of the differences between REST and SOAP is that REST is lighter than SOAP. What does it mean when they say REST APIs are lighter than SOAP APIs? How is JSON lighter than XML?
1
vote
1answer
310 views

How to use 'q' parameter for google drive api

I want to pass q parameter in setEndPoint url to get list of all files in the root folder(at the home page). I tried it using the google API(https://developers.google.com/drive/api/v3/reference/files/...
3
votes
1answer
71 views

Custom OAuth Auth Provider

I have a Rest API Endpoint that I am looking to callout to. Something like this: https://myrestservice.com/service/logs When setting up the Named Credential, I set up the URL to: https://...
5
votes
1answer
3k views

REST API: “INVALID_SESSION_ID” with valid token

I'm having some trouble accessing API endpoints using a valid token that I just got from the OAuth process. I'm passing data as I think I should and am trying to access any endpoint at this point (...
1
vote
0answers
56 views

HTTP patch not supported as a method

I am trying to integrate with a third party service, while trying to make a http request , i want to send PATCH as a method,I have looked for two solutions mentioned here in this questionHow can I ...
1
vote
1answer
82 views

Salesforce limit of synchronous rest service

I have to implement in salesforce many inbound synchronous rest services. What are the salesforce limits that I have to consider? I found only the following: API Requests. A long-running API request ...
0
votes
1answer
20 views

Rest API in Postman Error Message

Can anyone help me to understand about my Error message in postman?
0
votes
1answer
31 views

Malformed JSON: Expected '[': how to deserialize JSON with REST API?

Error: Malformed JSON: Expected '[' at the beginning of List/Set I think I have incorrect JSON.deserialize for my object. How can I fix it? I don't use a wrapper. List<Account> accList = new ...
0
votes
1answer
45 views

How to deserialize and parse JSON data to get particular values from the response

my http response is as shown: {"controllerValues":{},"defaultValue":null,"eTag":"31935b5a76250197159c64a2a9ec8353","url":"/services/data/v43.0/ui-api/object-info/Opportunity/picklist-values/...
1
vote
1answer
24 views

HttpGet and Callout: is not a valid Salesforce ID for the type

I get Item's list from 1 organisation and want to insert them like Another Items in 2 organisation. But it try to insert it with Id. How can I fix that? Error: System.DmlException: Insert failed. ...
0
votes
1answer
38 views

How redirect to record detail page after record is created in REST API

I have implemented rest service for getting the response from external system (Repco) to salesforce. For this, i have implemented Lighting component for sending appropriate required parameters to ...
1
vote
1answer
93 views

How to use HttpGet service to get a list of objects and create them?

I have a callout method which helps to get an list of objects from another salesforce-organisation. But how can I convert this list into objects on callout's organisation side? And how can I do this ...