Does any one know how to call conga composer from APEX?

Tried to follow [http://knowledge.congasphere.com/congakb/ext/kb69-how-to-call-conga-composer-from-apex?mode=searchresults]

but I get "Your Salesforce session has expired or the Salesforce API Servers are offline. INVALID SESSION ID or SERVER URL"

Any help is greatly appreciated.

Thank you, Manohar


1 Answer 1


Make sure you're passing the appropriate parameters:

Map<String, String> parameters = new Map<String, String> {
    'sessionid' => UserInfo.getSessionId(),
    'serverUrl' => Url.getSalesforceBaseUrl().toExternalForm()+'/services/Soap/u/13.0/'+UserInfo.getOrganizationId()

Include other parameters as appropriate.

  • I am using formula fields to pass those paramters as below.. appextremes.com/apps/Conga/PM.aspx?SessionId='; + quote[0].APIgetSessionId__c + '&ServerUrl=' + quote[0].APIServerUrl__c + '&Id=' + quote[0].id
    – Manohar
    Oct 11, 2013 at 17:16
  • I don't really see any problem with that, assuming the values are populated, etc. They also mention it may be a problem with locked IP sessions (Setup > Security Controls > Session Settings).
    – sfdcfox
    Oct 11, 2013 at 18:33
  • I tried your approach as well but that didnt help either. or may be I need to use a different approach for my requirement. thanks for your help Brian.
    – Manohar
    Oct 11, 2013 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.