AsyncOperations

AsyncOperations represent long-lived operations that are started by users, but are not completed immediately. Certain operations take a long time to complete. In these cases, the caller may receive an AsyncOperation object instead of the typical syncrhonous result. For example, a Copy operation in the same zone returns the newly created Item; but if the Copy is performed accross zones, the returned object is an Asynchronous operation instead.

Get AsyncOperation by ID

GET https://account.sf-api.com/sf/v3/AsyncOperations(id) 

Retrieve a single Async Op record by ID

idString Async Operation Identifier

Returns: A single Async Operation record

Get List of AsyncOperations by Operation Batch ID

GET https://account.sf-api.com/sf/v3/AsyncOperations/GetByBatch(id) 

Retrieves all AsyncOperations on the specified batch

idString Operation Batch identifier

Returns: A Feed of AsyncOperation objects, containing all items in the specified batch

Get progress of AsyncOperations by Operation Batch ID

GET https://account.sf-api.com/sf/v3/AsyncOperations/GetBatch(id) 

Retrieves an AsyncOperation containing batch progress by Operation Batch ID

idString Operation Batch identifier

Returns: An Async Operation object containing batch progress

Get List of AsyncOperations by Folder

GET https://account.sf-api.com/sf/v3/AsyncOperations/GetByFolder(id) 

Retrieves all AsyncOperations associated with the calling user and the Item ID

idString Source Item ID
activeOnlyBoolean Specifies whether or not completed operations should be shown.

Returns: A Feed of AsyncOperation objects, containing all pending operations in the specific folder, for the authenticated SDK user

Cancel AsyncOperation

POST https://account.sf-api.com/sf/v3/AsyncOperations(id)/Cancel 

Cancels a single Async operation record

idString Async Operation ID

Returns: The modified Async Operation record

Delete AsyncOperation

DELETE https://account.sf-api.com/sf/v3/AsyncOperations(id) 

Cancels a single Async operation record (same as /Cancel)

idString Async Operation ID

Cancel an Operation Batch

POST https://account.sf-api.com/sf/v3/AsyncOperations/CancelBatch(id) 

Cancel an Async Operation batch - all unfinished Async Operation records in that batch will be moved to Cancelled state.

idString Batch ID

Returns: A list of the modified Async Operations in the batch

Changes the state of an AsyncOperation

PATCH https://account.sf-api.com/sf/v3/AsyncOperations(id) 
            { "State": "..." } 

Only the State parameter is updated, other fields are ignored

idString
newAsyncOpAsyncOperation Async Operation

Returns: The modified Async Operation