• #61505
    Salesforce | Prachi Prachi #8
    Forcetalks

    How to use standard Salesforce REST API from Visualforce page ?

    How to use standard Salesforce REST API from Visualforce page ?

    #61507
    Salesforce | Laveena Laveena #3
    Forcetalks

    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

    #61510
    Forcetalks

    Hi,

    Salesforce has introduced a concept called AJAX ToolKit, which help us to make REST API call from the JavaScript in Visualforce Page.

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?