Working with the Approvals System

Submitting Booking, Timesheets, Envelopes, and Invoices

Submit open or rejected bookings, timesheets, envelopes, and invoices which you have rights to in OpenAir by creating an approval object, preparing the record for submission, defining an array of submit requests, and passing the requests to the NSOA.wsapi.submit(submitRequest) function.

submitRequest

The NSOA.wsapi.submit(submitRequest) function takes an array of up to 1000 submitRequest objects. Each submitRequest object contains an oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object to submit and additional approval process information passed to an oaApproval object.

          // Define the submit requests
var requests = [{
     submit: objectToProcess,
     attributes [], // attributes only apply when submitting timesheets
     approval: approvalObj
}]; 

        

Property

Allowed Values

submit

oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object

attributes

Only accepts “submit_warning” for oaTimesheet

approval

oaApproval

Approving Bookings, Timesheets, Envelopes, and Invoices

Approve submitted bookings, timesheets, envelopes, and invoices to which you have rights to in OpenAir by creating an approval object, preparing the record for approval, defining an array of approve requests, and passing the requests to the NSOA.wsapi.approve(approveRequest) function.

approveRequest

The NSOA.wsapi.approve(approveRequest) function takes an array of up to 1000 approveRequest objects. Each approveRequest object contains an oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object to approve and additional approval process information passed to an oaApproval object.

          // Define the approve requests
var requests = [{
     approve: objectToProcess,
     attributes [], // pass an empty array for attributes when using approveRequest
     approval: approvalObj
}]; 

        

Property

Allowed Values

approve

oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object

attributes

Pass an empty array

approval

oaApproval

Rejecting Bookings, Timesheets, Envelopes, and Invoices

rejectRequest

The NSOA.wsapi.reject(rejectRequest) function takes an array of up to 1,000 rejectRequest objects. Each rejectRequest object contains an oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object to submit and additional approval process information passed to an oaApproval object. The rejectRequest object is used to specify the required data to return in the NSOA.wsapi.reject(rejectRequest) function.

          // Define the reject requests
var requests = [{
     reject: objectToProcess,
     attributes [], // pass an empty array for attributes when using rejectRequest
     approval: approvalObj
}]; 

        

Property

Allowed Values

reject

oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object

attributes

Pass an empty array

approval

oaApproval

Unapproving Bookings, Timesheets, Envelopes, and Invoices

The NSOA.wsapi.unapprove(unapproveRequest) function takes an array of up to 1,000 unapproveRequest objects. Each unapproveRequest object contains an oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object to unapprove and additional approval process information passed to an oaApproval object. The unapproveRequest object is used to specify the required data to return in the NSOA.wsapi.unapprove(unapproveRequest) function.

unapproveRequest

The unapproveRequest object is used to specify the required data to return in the NSOA.wsapi.unapprove(unapproveRequest) function.

          // Define the unapprove requests
var requests = [{
     unapprove: objectToProcess,
     attributes [], // pass an empty array for attributes when using unapproveRequest
     approval: approvalObj
}]; 

        

Property

Allowed Values

unapprove

oaBooking, oaTimesheet, oaEnvelope, or oaInvoice object

attributes

Pass an empty array

approval

oaApproval