Previous JavaScript must be enabled to correctly display this content

## Initiates a task

post

/ArchiveService/api/v1/archives/tasks

This api will initiate a task on entity level activity data. The task name and action will reflect the nature of the task.

### Request

There are no request parameters for this operation.

Supported Media Types

- application/json

Request Body - application/json ()
Root Schema : schema
Type: `object`
Show Source

- action: string
  Example: `Pause/Resume/Abort/DeletePendingfromSource`
- activityLevels: array activityLevels
- archiveGUID: string
  Example: `5289446E-A8AB-4D7D-80F6-A81CE6335522`
- batchSize: integer
  Example: `100`
- clientGuids: array clientGuids
- effectiveTo: string
  Example: `YYYY-MM-DD`
- entityType: string
  Example: `ACTIVITY`
- policyGuids: array policyGuids
- policyNumbers: array policyNumbers
- statusCodes: array statusCodes
- taskName: string
  Example: `Archival/Retrieval`

    {
        "type":"object",
        "properties":{
            "taskName":{
                "type":"string",
                "example":"Archival/Retrieval"
            },
            "entityType":{
                "type":"string",
                "example":"ACTIVITY"
            },
            "statusCodes":{
                "type":"array",
                "items":{
                    "type":"string"
                }
            },
            "effectiveTo":{
                "type":"string",
                "example":"YYYY-MM-DD"
            },
            "batchSize":{
                "type":"integer",
                "example":100
            },
            "activityLevels":{
                "type":"array",
                "items":{
                    "type":"string"
                }
            },
            "action":{
                "type":"string",
                "example":"Pause/Resume/Abort/DeletePendingfromSource"
            },
            "archiveGUID":{
                "type":"string",
                "example":"5289446E-A8AB-4D7D-80F6-A81CE6335522"
            },
            "policyNumbers":{
                "type":"array",
                "items":{
                    "type":"string"
                }
            },
            "policyGuids":{
                "type":"array",
                "items":{
                    "type":"string"
                }
            },
            "clientGuids":{
                "type":"array",
                "items":{
                    "type":"string"
                }
            }
        }
    }

Nested Schema : activityLevels
Type: `array`
Show Source

- Array of: string

    {
        "type":"array",
        "items":{
            "type":"string"
        }
    }

Nested Schema : clientGuids
Type: `array`
Show Source

- Array of: string

    {
        "type":"array",
        "items":{
            "type":"string"
        }
    }

Nested Schema : policyGuids
Type: `array`
Show Source

- Array of: string

    {
        "type":"array",
        "items":{
            "type":"string"
        }
    }

Nested Schema : policyNumbers
Type: `array`
Show Source

- Array of: string

    {
        "type":"array",
        "items":{
            "type":"string"
        }
    }

Nested Schema : statusCodes
Type: `array`
Show Source

- Array of: string

    {
        "type":"array",
        "items":{
            "type":"string"
        }
    }

Back to Top

### Response

Supported Media Types

- application/json

#### 201 Response

Task submitted successfully and an entry got created in the system to complete the task.
Body ()
Root Schema : schema
Type: `object`
Show Source

- archiveGUID: string
  ArchiveGUID of the process created in system.
  Example: `5289446E-A8AB-4D7D-80F6-A81CE6335522`

    {
        "type":"object",
        "properties":{
            "archiveGUID":{
                "type":"string",
                "description":"ArchiveGUID of the process created in system.",
                "example":"5289446E-A8AB-4D7D-80F6-A81CE6335522"
            }
        }
    }

Back to Top

### Examples

Post a request for creating, pausing, resuming, aborting, retrieving, and deleting an archive.

Creating an Archive

Use the following cURL, Request Body for initiating a new archive request.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/ArchiveService/api/v1/archives/tasks"\
         -d {"taskName":"ARCHIVAL", "entityType":"ACTIVITY", "activityLevel":"POLICY", "statusCodes":["01"], "effectiveTo":"2010-02-01", "batchSize":"50"}

Example Request Body

The following shows an example of the request body in JSON format:

    {
    "taskName":"ARCHIVAL",
    "entityType":"ACTIVITY",
    "activityLevels":["POLICY", "CLIENT"],
    "statusCodes":["01","12","34"],
    "effectiveTo":"2016-07-18",
    "batchSize":"100"
    }

Example Response Body

The following shows an example of the response body in JSON format:

    {
        "archiveGUID": "1019F931-4461-5A92-E063-05914C64D5DB"
    }

Pausing an Archive

Use the following cURL, and Request Body example to pause a running archive service.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/ArchiveService/api/v1/archives/tasks" \
         -d {"taskName": "ARCHIVAL","action": "PAUSE","archiveGUID": "4CB70824-F15F-4FD9-8A10-5E5D28F4E903"}

Example Request Body

The following shows an example of the request body in JSON format.

    {
      "taskName": "ARCHIVAL",
      "action": "PAUSE",
      "archiveGUID": "0E0AF7AC-8543-913C-E063-05914C6479EE"
    }

Example Response Body

The response would be a success message: 201 Created. There would be no message in the response window.

Resuming an Archive

Use the following cURL, and Request Body example to resume a paused archive service.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/ArchiveService/api/v1/archives/tasks" \
         -d {"taskName": "ARCHIVAL","action": "RESUME","archiveGUID": "4CB70824-F15F-4FD9-8A10-5E5D28F4E903"}

Example Request Body

The following shows an example of the request body in JSON format.

    {
      "taskName": "ARCHIVAL",
      "action": "RESUME",
      "archiveGUID": "0F0E2F08-520D-F3AD-E063-05914C64853A"
    }

Example Response Body

The response would be a success message: 201 Created. There would be no message in the respone window.

Aborting an Archive

Use the following cURL, and Request Body example to abort/stop a running archive service.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/ArchiveService/api/v1/archives/tasks" \
         -d {"taskName": "ARCHIVAL","action": "ABORT","archiveGUID": "4CB70824-F15F-4FD9-8A10-5E5D28F4E903"}

Example Request Body

The following shows an example of the request body in JSON format.

    {
      "taskName": "ARCHIVAL",
      "action": "ABORT",
      "archiveGUID": "A819B26C-F6C8-4CB6-8363-BD193AE150C4"
    }

Example Response Body

The response would be a success message: 201 Created. There would be no message in the respone window.

Deleting Pending Entities

Use the following cURL, and Request Body example to delete all the entities marked as DeletePending from the source database.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/ArchiveService/api/v1/archives/tasks" \
         -d {"taskName": "ARCHIVAL", "action": "DELETEPENDINGFROMSOURCE", "archiveGUID": "A7A49999-92C2-45AB-AB9D-8179D8B770D6"}

Example Request Body

The following shows an example of the request body in JSON format.

    {
        "taskName": "ARCHIVAL",
        "action": "DELETEPENDINGFROMSOURCE",
        "archiveGUID": "A214D98E-04C4-4945-BC59-6E81B2422FFC"
    }

Example Response Body

The response would be a success message: 201 Created. There would be no message in the respone window.

Retrieving an Archived Activity

Use the following cURL, and Request Body example to retrieve the arachived data from the database.

Example cURL Command

Use the following cURL command to submit a request on the REST resource:

    curl -X POST \
         -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -u 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
         -L "http://server:port/ArchiveService/api/v1/archives/tasks" \
         -d {"taskName":"RETRIEVAL","policyNumbers"}

Example Request Body

The following shows an example of the request body in JSON format:

    {
    "taskName": "RETRIEVAL",
    "entityType": "ACTIVITY",
    "policyNumbers": ["VDA20055406"],
    "policyGuids":["9D42AF83-743C-4772-885C-1B77C6F-B6B0A"],
    "clientGuids":["B03DA23B-0236-467C-B46D-B4A2C77-CB57A"],
    "effectiveTo": "2016-07-18"
    }

Example Response Body

The following shows an example of the response body in JSON format:

    {
        "retrievalGUID": "0E976827-57F5-9B87-E063-05914C64401A"
    }

Back to Top