With this API, you can cancel or recall previously submitted 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 cancel requests. 

If you submit previously submitted or approved approvals as part of bulk cancel requests, all the approvals are canceled. 

This API is useful when you need to recall 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 recall all the approval records for 5 agreements. Using cancelApprovalsBulk API, you can recall all the approval records in one go by calling this API and providing the type and IDs of the five agreements as request parameters. 

Note

The cancelApprovalsBulk API supports up to 50 context object records. Beyond this limit, Salesforce throws a SOQL error. 

APISignature
cancelApprovalsBulkwebService static Boolean cancelApprovalsBulk(List ctxObjParams)
Request Parameters
NameTypeRequired?Description
approvalParamsObjectYesObject containing all the approval parameters
approvalParams
NameTypeRequired?Description

approvalObjectId

IDYesID of the approval context object.

approvalObjectType

StringYesType of the approval context object.
approvalCommentsObjectObjectNoThe approval comment object
Response Parameter
NameTypeDescription
resultBooleanReturns true if the API is executed successfully.
// multiple context object type and ids
String agmtType = 'Apttus__APTS_Agreement__c';
ID agmtId1 = 'a07R000000APxGG';
ID agmtId2 = 'a07R000000AS9nJ';
ID agmtId3 = 'a07R000000AS9nO';


// 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
Boolean ok = Apttus_Approval.ApprovalsWebService.cancelApprovalsBulk(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:cancelApprovalsBulk>
         <!--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:cancelApprovalsBulk>
   </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>
      <cancelApprovalsBulkResponse>
         <result>true</result>
      </cancelApprovalsBulkResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML