![]() ![]() bug('# Response Status Code '+resp.getStatusCOde()) īut if you will call the same block from the Lightning Component then you will get “ INVALID_SESSION_ID:This session is not valid for use with the API.“ Error. bug('# Response Status '+resp.getStatus()) Req.setEndpoint(URL.getSalesforceBaseUrl().toExternalForm() + '/services/data/v41.0/query?q=Select+Id,+Name+From+Account') Req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()) INVALID_SESSION_ID:This session is not valid for use with the API.įor Example when you will execute the below code from the Developer Console then you will get the Valid Response ![]() If you do make the callout from the lightning component then you will get the below error ![]() You may have heard about that we can not make the Salesforce API Call directly from the lightning component. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |