/
CancelJob RESTified API

CancelJob RESTified API

5.4.0

A pass-through API to Scheduling (when configured) which allows the Scheduling's "Cancel Job" API to be called.

Description

Cancelling a job in ServiceOptimizer causes the the job to be completely removed from the system, although, if activated, an audit trail for the job will remain.

In this context, the Scheduling Cancel Job API is the sp:JobCancelRequest API.  

On this page:

Related pages:

Resource URL Summary

Pass Through Call to Scheduling's "Cancel Job" API

PUT /up/v5/rest/scheduling/CancelJob

HTTP Headers

This API uses the standard ServiceBroker HTTP Headers.


API Specifics


.

Pass Through Call to Scheduling's "Cancel Job" API

This RESTified API will perform a pass-through call to the Scheduling sub-system's "Cancel Job" API (when configured).

URL

PUT /up/v5/rest/scheduling/CancelJob

HTTP Request Body

This request requires a JSON object supplied in the HTTP request body, which defines the parameters that will be passed through to the Scheduling "Cancel Job" APi.

CancelJob Object Format

CancelJob JSON
{
	"Id": "Dep-1306",
	"CancelReason": {
		"cancelReasonId": 1,
    	"cancelReasonDesc": ""
	}
}

CancelJob Object Properties (Bold property names indicate the field is required)

PropertyTypeLengthDescriptionReq?Mapping Field: Service Scheduling
Id

string

SS: 50

Pass through parameter to the Scheduling Cancel Job API. 

Yes

jobID

CancelReasonobject

Pass through parameter to the Scheduling Cancel Dependency Group Jobs API. 


No

see cancelReason.objects

Cancellation reason details were added to the Scheduling "Cancel Job" API in version 11.3. When cancellation reason details are provided in a call to the ServiceBroker CancelJob RESTified API endpoint, and the Scheduling version in use is prior to 11.3, the cancellation details will not be passed through to the underlying Scheduling instance.


HTTP Response

Success

On success, a JSON-formatted version of the Scheduling "Cancel Job" API response will be returned.

{
	"Success": true,
	"Code": "0",
	"Message": "",
	"Payload": {
    	"result": {
      		"type": "OK",
      		"code": "0"
    	}
  	}
}

Error

On error, a JSON-formatted version of the Scheduling "Cancel Job" API response will be returned.

{
    "Success": false,
    "Code": 9,
    "Payload": {
        "returnCode": {
            "type": "Error",
            "code": "SCH Error Code"
        }
    }
}

Return Codes

In addition to the  Standard Return Codes, and the Scheduling Error codes, the possible Return Codes from this API are:

 Click here to expand...
  • SP_OK (0)
  • SP_JOBID_INVALID (1)

Related content

_API JobCancelRequest Definition
_API JobCancelRequest Definition
More like this
_API JobCancelRequest Definition
_API JobCancelRequest Definition
More like this
Cancel Job SOAP API
Cancel Job SOAP API
More like this