I'm trying to create my very first canvas connected app in salesforce and I need help how to call that in visualforce page and I have setup creating connected app and also i have external app sample here in the github, my question is how to call the external app from visualforce page?

followed this blog and end-up in github


1 Answer 1


You will use apex:canvasApp tag on your visualforce markup

<apex:page controller="JSONGeneratorSample">
    <apex:canvasApp developerName="mycanvas" parameters="{!generateJSON}" />

Note that you can either use Application Name or Developer Name .

Once your Visualforce page is rendered ,it will make a GET Request to the Canvas URL that you have in your connected application .

Unless you validate the Signed request sent ,Your page will display signed request failed .

The consumer Secret is the private key that can be used to validate the signed request .

Once the Signed request is validated ,you will get the Canvas Request Object .

enter image description here

The canvas Request Object will have the Parameters you have sent in parameters attribute in your visualforce page .

Also Canvas Request Object will have userinfo of salesforce and other details and Environment Variables .The sample Canvas Request will look like this

Once you have Environment variables and Signed Request token your page thats rendered from external server can make REST API calls to SFDC .

The Canvas Documentation provides examples of how you can execute these .

  • in the apex: tag you parameters="{!generateJSON}" what exactly are sending in as a parameters?
    – Nick
    Apr 27, 2016 at 14:10
  • @NickKahn It will be your custom parameters .Its a key and value combination the external system Apr 27, 2016 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .