Create Cost Sheet Snapshot

POST /ws/rest/service/v2/costsheet/snapshot

Purpose

Creates a project cost sheet snapshot of a specified shell. Only one snapshot can be created per request.

Note:

It is recommended to avoid creating more than 100 snapshots at a time, as the cost sheet will get locked whenever update_prior_forecast is selected.

Prerequisite

You must have Create, or Full Access permissions for CBS services.

Request Format

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

{

"options":{

"project_number": "<value>",

},

"data":["snapshotname":"<value>",

"update_prior_forecast": "<value>"

]

}

Request Parameters

In the options map, the following parameter must be included:

Parameter Required? Data Type Description
project_number Yes String A valid project/shell number.

Request Parameters - Data []

In the Data [], the following parameters can be included:

Parameter Required? Data Type Description
snapshotname Yes String The name of the new snapshot to be created
update_prior_forecast No Boolean Indicates whether a prior forecast needs to be checked when the snapshot is created in the cost sheet. Valid values include: "true", and "false".

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

To create a July snapshot of the Project, PRJ-004, send a request in the following format:

{

"options" :{ "project_number" :"PRJ-004"}

"data":[{

"snapshotname":"July snapshot"

}]

}

Sample Success Response

A successful response with status code 200 displays in the following format:

{

"data": [{"snapshotname": "July Snapshot"}],

"message": ["success"],

"rest_audit_id": 1117,

"status": 200

}

Sample Failed Response

A failed response displays with the corresponding status code in the following format:

{

"data": [],

"message": ["Cost sheet does not exist."],

"status": 707,

"rest_audit_id": 1278

}

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 The project number is invalid. 602 Project/Shell Number is not correct.
project_number Project is not active. 1245 Create/Update/Delete cannot be performed when project/shell status is Inactive or View-Only or On-Hold.
project_number Cost sheet does not exist in the project/shell. 707 Cost sheet does not exist.
snapshotname snapshotname exceeds 100 characters. 19002 Snapshot name cannot exceed 100 characters.
snapshotname snapshotname is not provided. 13004 Provide a snapshot name.
update_prior_forecast The update_prior_forecast value is invalid. 19003 The update prior forecast field can have a true or false value.