Delete Snapshots of a Cashflow Curve

PUT /ws/rest/service/v2/cashflow/delete/snapshot

Available: 23.10 and later

Purpose

Delete a snapshot for an existing cashflow detail curve in specific shell. Multiple snapshots can be deleted per request.

Prerequisite

You must have Full Access or Update permissions for this REST service.

Request Format

Send an API request as a JSON Map with the following structure:

{

"options":{

"project_number": "<value>",

"name": "<curve_name>"

},

"data":[{"snapshot_name":"<list of snapshot names to be deleted>"}]

}

Request Parameters

In the request, the following parameters can be included:

Parameter Required? Data Type Description
project_number Yes String A valid shell/project number with Active status.
name Yes String Cashflow curve name associated with the snapshot.
snapshot_name Yes String List of snapshot names to be deleted.

Response Format

A JSON object is returned in the following format:

{

"data": [],

"message": [<list of messages>],

"status": <REST status code value>,

"rest_audit_id": <id from the audit table>

}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Sample Request

This is a request to delete two snapshots:

{

"options" : {

"project_number" :P-002,

"name" : "New Curve 5"

},

"data":[ {"snapshot_name":["Snapshot 1", "Snapshot 2"] }

Sample Success Response

This is the response for a successful deletion of the above snapshots:

{

"data": [

{

"Name": [

"New curve 5"

],

"snapshot_name": [

"snapshot 1",

"snapshot 2"

]

}

],

"message": [

"success"

],

"status": 200,

"rest_audit_id": 2383

}

Sample Failed Response

The following failure message and status is displayed for a snapshot:

{

"data": [],

"message": [

"Snapshot name specified do not exist in the cashflow New curve 5"

],

"status": 13007,

"rest_audit_id": 2384

}

Supported Validation Messages and Status Codes

The following messages and status codes can display in the response:

Field Name Use-Case Status Message
project_number Project number is not provided. 13001 Project/Shell number is mandatory and is missing in the input request.
project_number Project number is invalid. 602 Project/Shell Number is not correct.
project_number Project is not active. 1245 ( create/update - existing code) Create/Update/Delete cannot be performed when project/shell status is Inactive or View-Only or On-Hold.
curve_name Curve name is not provided. 13002 Cashflow curve name is mandatory and is missing in the input request.
curve_name curve name no longer exists. 13003 Invalid curve name provided in input request.
curve_name Provided curve name is a summary type.   The selected curve name is a summary type, and summary snapshots are not supported through integration.
snapshot_name A few snapshot names do not exist in the selected cashflow curve. 13008 Snapshots <name1>, <name2> do not exist in the selected cash flow curve <curve name>. Snapshots <name3> ,<name4> deleted successfully.
snapshot_name None of the snapshot names exist in the selected cashflow curve. 13004 Snapshots <name1>, <name2>, <name3> do not exist in the selected cash flow curve <curve name>