Activity Forums Salesforce® Discussions How to use standard Salesforce REST API from Visualforce page ?

  • Laveena

    August 23, 2019 at 5:17 am

    Hi Prachi,


    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



    //Code if fail



  • Hariom Chaudhary

    August 23, 2019 at 5:18 am


    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.

Popular Salesforce Blogs

Popular Salesforce Videos