With this API, you can approve bulk approval requests. This API accepts the object type and the object ID of the context object as input parameters. You can also add comments to your approval requests. You cannot approve approval requests with attachments. 

If you submit previously submitted or approved approvals as part of bulk approval request, the approval request is submitted again. 

This API is useful when you need to approve a large number of approval requests for various context objects. For example, you are the approvals admin for a data service organization and you need to approve 5 agreements. Using submiForApprovalsBulk API, you can submit all the approval records in one go by calling this API and providing the type and IDs of the five agreements as request parameters. 

APISignature
approveRequestsBulk

webService static Id approveRequestsBulk(List actionRequests)

Request Parameters
NameTypeRequired?Description
actionRequestsListYesList of requests to bulk approve



Response Parameter
NameTypeDescription
IdID
// multiple context object type and ids
String agmtType = 'Apttus__APTS_Agreement__c';
ID agmtId1 = 'a07R000000APxGG';
ID agmtId2 = 'a07R000000AS9nJ';
ID agmtId3 = 'a07R000000AS9nO';

// submission comments
Apttus_Approval.SubmissionComments submitComments1 = new Apttus_Approval.SubmissionComments();
submitComments1.commentsLevel = Apttus_Approval.SubmissionComments.PROCESS_LEVEL_COMMENTS;
submitComments1.commentsCount = 1;
submitComments1.processName = 'ProcessName';
submitComments1.processCommentLabel = 'ProcessLabel';
submitComments1.processCommentMandatory = false;
submitComments1.processComment = 'Test Comment 1';

Apttus_Approval.SubmissionComments submitComments2 = new Apttus_Approval.SubmissionComments();
submitComments2.commentsLevel = Apttus_Approval.SubmissionComments.PROCESS_LEVEL_COMMENTS;
submitComments2.commentsCount = 1;
submitComments2.processName = 'ProcessName';
submitComments2.processCommentLabel = 'ProcessLabel';
submitComments2.processCommentMandatory = false;
submitComments2.processComment = 'Test Comment 2';

Apttus_Approval.SubmissionComments submitComments3 = null;


// create list of context objects
List<Apttus_Approval.BulkCtxObjectParam> ctxParams = new List<Apttus_Approval.BulkCtxObjectParam>();

Apttus_Approval.BulkCtxObjectParam ctxParam1 = new Apttus_Approval.BulkCtxObjectParam();
ctxParam1.ctxSObjectType = agmtType;
ctxParam1.ctxSObjectId = agmtId1;
ctxParam1.comments = submitComments1;
ctxParams.add(ctxParam1);

Apttus_Approval.BulkCtxObjectParam ctxParam2 = new Apttus_Approval.BulkCtxObjectParam();
ctxParam2.ctxSObjectType = agmtType;
ctxParam2.ctxSObjectId = agmtId2;
ctxParam2.comments = submitComments2;
ctxParams.add(ctxParam2);

Apttus_Approval.BulkCtxObjectParam ctxParam3 = new Apttus_Approval.BulkCtxObjectParam();
ctxParam3.ctxSObjectType = agmtType;
ctxParam3.ctxSObjectId = agmtId3;
ctxParam3.comments = submitComments3;
ctxParams.add(ctxParam3);

// bulk submit
Id approvalrequestID = Apttus_Approval.ApprovalsWebService.approveRequestsBulk(ctxParams);
CODE

Integration Details

Use the following information in your integrations with Conga Approvals API. Refer to Integrating Conga with External Systems for information on how to get started.

API Prerequisites

None.

Response/Request XML

Example Request

<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:app="http://soap.sforce.com/schemas/class/Apttus_Approval/ApprovalsWebService" 
xmlns:bul="http://soap.sforce.com/schemas/class/Apttus_Approval/BulkCtxObjectParam" 
xmlns:sub="http://soap.sforce.com/schemas/class/Apttus_Approval/SubmissionComments">
   <soapenv:Header>
      <app:SessionHeader>
         <app:sessionId>00DR0000001nyVR!ARYAQOruA8X3nIS2hgZgZxEZkUDHDMlzIfBNGDey8s_.AcTbbEghNGUnMEh5oGcG5mkmrVuHp1F9gHzfIfYAvzuRDU6zg7kO</app:sessionId>
      </app:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <app:submitForApprovalsBulk>
         <!--Zero or more repetitions:-->
         <app:ctxObjParams>
            <bul:comments>
               <sub:commentsCount>1</sub:commentsCount>
               <sub:commentsLevel>Process</sub:commentsLevel>
               <sub:processComment>?</sub:processComment>
               <sub:processCommentLabel>ProcessLabel</sub:processCommentLabel>
               <sub:processCommentMandatory>false</sub:processCommentMandatory>
               <sub:processName>ProcessName</sub:processName>
               <!--Zero or more repetitions:-->
               <sub:stepCommentList>
               </sub:stepCommentList>
            </bul:comments>
            <bul:ctxSObjectId>a07R000000AiYQX</bul:ctxSObjectId>
            <bul:ctxSObjectType>Apttus__APTS_Agreement__c</bul:ctxSObjectType>
         </app:ctxObjParams>
         <app:ctxObjParams>
            <bul:comments />
            <bul:ctxSObjectId>a07R000000Aj68Y</bul:ctxSObjectId>
            <bul:ctxSObjectType>Apttus__APTS_Agreement__c</bul:ctxSObjectType>
         </app:ctxObjParams>
      </app:submitForApprovalsBulk>
   </soapenv:Body>
</soapenv:Envelope>
XML

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus_Approval/ApprovalsWebService">
   <soapenv:Body>
      <submitForApprovalsBulkResponse>
         <result>true</result>
      </submitForApprovalsBulkResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML