logo
logo

Mass Edit Job Collection Resource

The Collection of Mass Edit Jobs Resource contains all of the Mass Edit Jobs present in the system. This resource is also used to post a new Mass Edit Job.

Methods supported: GET, HEAD, POST

GET /api/massedits{?state,skip,take}

Returns a Mass Edit Job Collection Object that contains the collection of all Mass Edit Jobs in the system.

Optionally, a state filter can be supplied, in which case the collection will only return the jobs that match the specified state.

Chunking

If there are more jobs than can fit in a single chunk, a link is included to retrieve the next chunk.

Ranging

If the take parameter is specified, the number of jobs returned is limited to that parameter (up to 100). The skip parameter can also be included to further determine which range of jobs is returned.

Example Request:

GET http://<hostname>/api/massedits?state=Pending
Host: hostname
Accept: application/json

Example Response:

HTTP/1.1 200 OK
Content-Length: content lengtha
Content-Type: application/json; charset=utf-8
ETag: "hash string"

{
    "items": [
        ... Mass Edit Job Objects
    ],
    "next",{
        "href":"http://<hostname>/api/massedits?skip=25"
    },
    "returned_items":25,
    "self":{
        "href":"http://<hostname>/api/massedits"
    },
    "total_items":78
}

POST /api/massedits

Creates a new Mass Edit Job in the system. A complete Create Mass Edit Job Request Object is expected in the body. Success is indicated by returning a 201 Created response, where a Location header contains the URL of the newly created resource.

Example Request:

POST http://<hostname>/api/massedits
Host: hostname
Content-Type: application/json

{
    "state_description":"In progress",
    "collection":{
        "relation":{
            "href":"http://server/api/entities/23/CollectionToAsset"        
        },
        "role":"Parent"
    },
    "operations":[
        {
            "type":"SetProperty",
            "property":"AssetName",
            "culture":"en-US",
            "value":"New name for this asset."
        },
        {
            "type":"SetProperty",
            "property":"AssetTitle",
            "value":{
                "en-US":"New name for this asset.",
                "nl-BE":"De naam voor dit nieuwe asset."
            }
        },
        {
            "type":"ClearRelation",
            "relation":"AssetToAssetType",
            "role":"Child"
        },
        {
            "type":"AddRelation",
            "relation":"AssetToAssetType",
            "role":"Child",
            "value":[
                {
                    "href":"http://server/api/entities/14"
                },
                {
                    "href":"http://server/api/entities/14"
                }
            ]
        },
        {
            "type":"RemoveRelation",
            "relation":"AssetToAssetType",
            "role":"Child",
            "value":[
                {
                    "href":"http://server/api/entities/14"
                }
            ]
        }
    ]
}

Example Response:

HTTP/1.1 201 Created
Location: http://<hostname>/api/massedits/5549

Can we improve this article ? Provide feedback