2

There are some older posts about REST API access from Lightning components that do a great job at explaining why Salesforce no longer generates an API-enabled session Id in apex invoked from Lightning Components. However, it has been quite some time since any updates have been posted on those questions and the need still exists to get access to APIs like the new User Interface API from a Lightning Component and I cannot find any follow-up details from Salesforce on how developers should proceed.

Is there any officially supported way to access a Salesforce API from a Lightning Component today?

2

Last I checked, you can’t make calls to Salesforce APIs from client-side Lightning component code.

Lightning Components Developer Guide

Sometimes, you have to make API calls from server-side controllers rather than client-side code. In particular, you can’t make calls to Salesforce APIs from client-side Lightning component code. For information about making API calls from server-side controllers, see Making API Calls from Apex.

re-iterating the above quote: you can only do API calls from server-side controllers -> Making API Calls from Apex.

  • 1
    Thanks for the info, I have previously tried to set up a named credential for the Rest Api but was unsuccessful. I'll post a separate question about that though. – dsharrison Aug 15 '17 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.