Activity › Forums › Salesforce® Discussions › How to use standard Salesforce REST API from Visualforce page ? Salesforce® Discussions How to use standard Salesforce REST API from Visualforce page ? Posted by Prachi on August 23, 2019 at 5:14 AM How to use standard Salesforce REST API from Visualforce page ? Hariom Chaudhary replied 6 years, 9 months ago 3 Members · 2 Replies 2 Replies Laveena Member August 23, 2019 at 5:17 AM Hi Prachi, $.ajax({ type: reqType, beforeSend: function (xhr) { xhr.setRequestHeader(“Authorization”, ‘Bearer {!$API.Session_ID}’); }, headers : {‘Content-Type’ : ‘application/json; charset=utf-8’}, url: postUrl, data: postData, dataType: ‘text’ }) .done(function( data ) { //Code if success }) .fail(function(xhr,textstatus,error){ //Code if fail }); Thanks [adinserter block='9'] Hariom Chaudhary Member August 23, 2019 at 5:18 AM Hi, Salesforce has introduced a concept called AJAX ToolKit, which help us to make REST API call from the JavaScript in Visualforce Page. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me