Newer Version Available

This content describes an older version of this product. View Latest

Step Three: Close a Job

Close a job by sending a POST request to this URI. The request URI identifies the job to close. When a job is closed, no more batches can be added.
URI
/services/async/APIversion/job/jobId
Example XML request body
1<?xml version="1.0" encoding="UTF-8"?>
2<jobInfo
3   xmlns="http://www.force.com/2009/06/asyncapi/dataload">
4 <state>Closed</state>
5</jobInfo>
Example XML response body
1<?xml version="1.0" encoding="UTF-8"?>
2<jobInfo
3   xmlns="http://www.force.com/2009/06/asyncapi/dataload">
4 <id>750D0000000002lIAA</id>
5 <operation>insert</operation>
6 <object>Account</object>
7 <createdById>005D0000001ALVFIA4</createdById>
8 <createdDate>2009-04-14T18:15:59.000Z</createdDate>
9 <systemModstamp>2009-04-14T18:15:59.000Z</systemModstamp>
10 <state>Closed</state>
11 <concurrencyMode>Parallel</concurrencyMode>
12 <contentType>XML</contentType>
13 <numberBatchesQueued>0</numberBatchesQueued>
14 <numberBatchesInProgress>0</numberBatchesInProgress>
15 <numberBatchesCompleted>1</numberBatchesCompleted>
16 <numberBatchesFailed>0</numberBatchesFailed>
17 <numberBatchesTotal>1</numberBatchesTotal>
18 <numberRecordsProcessed>2</numberRecordsProcessed>
19 <numberRetries>0</numberRetries>
20 <apiVersion>36.0</apiVersion>
21 <numberRecordsFailed>0</numberRecordsFailed>
22 <totalProcessingTime>3647</totalProcessingTime>
23 <apiActiveProcessingTime>2136</apiActiveProcessingTime>
24 <apexProcessingTime>0</apexProcessingTime>
25</jobInfo>
Example JSON request body
1{
2   "state" : "Closed"
3}
Example JSON response body
1{
2   "apexProcessingTime" : 0,
3   "apiActiveProcessingTime" : 5059,
4   "apiVersion" : 36.0,
5   "concurrencyMode" : "Parallel",
6   "contentType" : "JSON",
7   "createdById" : "005xx000001SyhGAAS",
8   "createdDate" : "2015-11-19T01:45:03.000+0000",
9   "id" : "750xx000000000GAAQ",
10   "numberBatchesCompleted" : 10,
11   "numberBatchesFailed" : 0,
12   "numberBatchesInProgress" : 0,
13   "numberBatchesQueued" : 0,
14   "numberBatchesTotal" : 10,
15   "numberRecordsFailed" : 0,
16   "numberRecordsProcessed" : 100,
17   "numberRetries" : 0,
18   "object" : "Account",
19   "operation" : "insert",
20   "state" : "Closed",
21   "systemModstamp" : "2015-11-19T01:45:03.000+0000",
22   "totalProcessingTime" : 5759
23}