Open this page in the API Guide

DELETE /Job/{id}/

Cancels a job.
 

Request

Method Request URI
delete /API/Job/{id}/?sessionId=value

URI Parameters

URI Parameter Description
sessionId Current session ID. Specifying via an Authorization request header instead is recommended.

Path Parameters

Path Parameter Description
id The ID of the job to cancel.

Request Headers

Authorization: Bearer <Current session ID>

Request Body

There is no Request Body for this function.

Response

Response Body

The operation completed successfully. The payload contains a System.Boolean object.

Response Codes

Response Code Description
200 The operation completed successfully.
400 The request contained one or more invalid parameters.
403 The caller does not have the necessary privileges for the attempted operation and/or the specified item.
404 An item with the specified ID was not found.
440 The caller is not associated with a valid session.

Examples

This example will login and cancel the job with the ID = 04a5fae7-e77e-437c-95b8-316068137c55.

C# Java JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System.Net;
using System.Net.Http;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Web.Script.Serialization;
 
   ...
 
using (HttpClient httpClient = new HttpClient())
{
    // Get Session Id
    string logonUri = "http://localhost:8004/Api/LogOn/";
    var logonOptions = new
    {
        accountName = "admin",
        password = "1234",
        cultureName = string.Empty,
        deleteOtherSessions = true,
        isWindowsLogOn = false
    };
 
    JavaScriptSerializer serializer = new JavaScriptSerializer();
    var requestBodyAsString = serializer.Serialize(logonOptions);
    StringContent content =
        new StringContent(
            requestBodyAsString,
            Encoding.UTF8,
            "application/json"
        );
 
    string jsonString = string.Empty;
 
    using (var response = httpClient.PostAsync(logonUri, content).Result)
    {
        jsonString =
            response.Content.ReadAsStringAsync().Result;
    }
 
    var obj = (Dictionary<string,object>) serializer.DeserializeObject(jsonString);
    string sessionId = obj["sessionId"].ToString();
 
    // Add an Authorization header
    httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", sessionId);
 
    using (var response = httpClient.DeleteAsync(url).Result)
    {
        if(response.StatusCode == HttpStatusCode.OK)
        {
            Console.WriteLine("Item Deleted");
        }
    }
}