logo
logo

Create a fetch job object

You use a create fetch job object to request the creation of a new fetch job. The following properties are required:

ParameterTypeDescription
state_descriptionStringDescription of the current state of the job. This parameter needs to be set but can be empty ("").
assetLinkLink to the asset entity that receives the files.
filesArray.<file>Array of file objects that describe where to retrieve the files to add to the asset.

Each of the file objects should have the following properties:

NameTypeDescription
typeStringThe type of source to retrieve the file from, such as Web for an HTTP resource.
hrefStringThe URL of the resource.
delete_when_doneBooleanOptional parameter that determines whether to delete the file when the fetch job is done. For an HTTP resource, a DELETE request is sent to the resource URL.

Fetch source

You can use the Web fetch source to retrieve resources that are accessible from a URL (optionally pre-signed). The file name is retrieved from the Content-Disposition header if available or made up from the path. The href member specifies the URL to the resource.

The following example is a fetch job object that fetches two files and links them to an asset:

{
    "asset":{
        "href":"http://server/api/entities/23"
    },
    "files":[
        {
            "type":"Web",
            "href":"http://server/path/file1.jpg"
        },
        {
            "type":"Web",
            "href":"http://server/path/file2.jpg",
            "delete_when_done":true
        }
    ]
}

Can we improve this article ? Provide feedback