Create and Update Resources in the Master Rate Sheet
POST /ws/rest/service/v2/rate/sheet/resources
Purpose
Create or update Resources in the Master Rate Sheet.
This POST service includes the creation and updating of Resources. Resources cannot be removed once they are created under the Master Rate Sheet.
There is no PUT or delete API for this.
Prerequisites
- You must have the necessary permissions to run this service.
- rateType and costType are optional fields in the ratesBreakdown array. If they are not entered, Standard and Direct will be the default breakdown for Rates.
- The request must include unique combinations of Rate Type and Cost Type. If there is more than one entry with the same combination and different Rates, you will receive an error message.
Note: All allowed parameter values are case-sensitive.
Request Format
Send an API Request as a JSON map with the following structure:
{
"options":{
{"Source": "<value>"}
},
"data":[]
}
Request Parameters Supported in "options" JSON Map
The following request parameters can be included in the "options" JSON map:
Request Parameter | Mandatory? | Data Type | Description |
---|---|---|---|
source | Yes | String | The external application from which project data is populated. Valid values include: "Primavera Cloud", "P6", and "Others". |
Request Parameters Supported in "data" JSON Map
The following request parameters can be included in one or more "data" JSON maps:
Request Parameter | Mandatory? | Data Type | Description |
---|---|---|---|
parentWorkspaceCode | No | String | Specify this optional field if "Source" value is "Primavera Cloud". This parameter checks if the parent Resource Code exists in the system, and if the parent and child workspace codes are under different workspaces. |
ext_resc_id | No | Integer | Specify this optional field if "Source" value is "Primavera Cloud". his is an internal Resource ID in Primavera Cloud. It is used for ResourceCode update. |
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 ia a sample request to create Primavera Cloud resources:
{
"options": {
"source": "Primavera Cloud"
},
"data": [
{
"resourceCode": "Child1Rate4",
"resourceName": "Child1Rate4",
"workspaceCode": "NON_PROD3",
"parentResourceCode": "Parent",
"resourceType": "Labor",
"resourceCurrency": "USD",
"resourceStatus": "Active",
"unitsPerTime": 10,
"rates": [
{
"resourceEffectiveDate": "2020-02-03",
"ratesBreakdown": [
{
"resourceStandardRate": 100,
"costType": "Food",
"rateType": "Direct"
},
{
"resourceStandardRate": 100
}
]
},
{
"resourceEffectiveDate": "2020-02-05",
"ratesBreakdown" : [
{
"resourceStandardRate": 50,
"costType" : "Food",
"rateType" : "Direct"
},
{
"resourceStandardRate": 100,
"costType" : "Standard",
"rateType" : "Indirect"
}
]
}
]
}
]
}
Sample Success Response
A successful response with status code 200 displays in the following format:
{
"data": [
{
"resourceStatus": "Active",
"resourceCurrency": "USD",
"resourceCode": "Child1Rate4",
"workspaceCode": "NON_PROD3",
"unitsPerTime":10,
"rates": [
{
"ratesBreakdown": [
{
"rateType": "Direct",
"costType": "Food",
"id": 920,
"resourceStandardRate": 100.0
},
{
"rateType": "Direct",
"costType": "Standard",
"id": 921,
"resourceStandardRate": 100.0
}
],
"resourceEffectiveDate": "2020-02-03",
"id": 913
},
{
"ratesBreakdown": [
{
"rateType": "Direct",
"costType": "Food",
"id": 922,
"resourceStandardRate": 50.0
},
{
"rateType": "Indirect",
"costType": "Standard",
"id": 923,
"resourceStandardRate": 100.0
}
],
"resourceEffectiveDate": "2020-02-05",
"id": 914
}
],
"resourceName": "Child1Rate4",
"id": 118,
"parentResourceCode": "Parent",
"resourceType": "Labor"
}
],
"message": [
"success"
],
"status": 200,
"rest_audit_id": 1234
}
Sample Failed Response for Resources
A failed response to the above request displays the corresponding status code in the following format:
{
"data": [],
"message": ["The API request is missing the required information: [resourceCode]."],
"status": 12400,
"rest_audit_id": 1396
}
Sample Failed Request for Resources
A request with incorrect data is sent in the following format:
{
"options": {
"source": "Primavera Cloud"
},
"data": [
{
"resourceCode": "Child11Rate41",
"resourceName": "Child11Rate41",
"workspaceCode": "NON_PROD",
"resourceType": "Labor",
"resourceCurrency": "USD",
"parentResourceCode":"Rate4",
"parentWorkspaceCode":123,
"resourceStatus": "Active",
"ext_resc_id":100203,
"unitsPerTime": 10,
"rates": [
{
"resourceEffectiveDate": "2020-02-03",
"ratesBreakdown": [
{
"resourceStandardRate": 100,
"costType": "Food",
"rateType": "Direct"
},
{
"resourceStandardRate": 100
}
]
},
{
"resourceEffectiveDate": "2020-02-05",
"ratesBreakdown" : [
{
"resourceStandardRate": 50,
"costType" : "Food",
"rateType" : "Direct"
},
{
"resourceStandardRate": 100,
"costType" : "Standard",
"rateType" : "Indirect"
}
]
}
]
},
{
"resourceCode": "Rate42",
"resourceName": "Rate42",
"workspaceCode": "NON_PROD",
"resourceType": "Labor",
"resourceCurrency": "USD",
"resourceStatus": "Active",
"ext_resc_id":100204,
"unitsPerTime": 10,
"rates": [
{
"resourceEffectiveDate": "2020-02-03",
"ratesBreakdown": [
{
"resourceStandardRate": 100,
"costType": "Food",
"rateType": "Direct"
},
{
"resourceStandardRate": 100
}
]
},
{
"resourceEffectiveDate": "2020-02-05",
"ratesBreakdown" : [
{
"resourceStandardRate": 50,
"costType" : "Food",
"rateType" : "Direct"
},
{
"resourceStandardRate": 100,
"costType" : "Standard",
"rateType" : "Indirect"
}
]
}
]
},
{
"resourceCode": "Child11Rate43",
"resourceName": "Child11Rate43",
"workspaceCode": "NON_PROD",
"resourceType": "Labor",
"resourceCurrency": "USD",
"parentResourceCode":"Rate4",
"parentWorkspaceCode":"NON_PROD",
"resourceStatus": "Active",
"ext_resc_id":100206,
"unitsPerTime": 10
}
]
}
Sample Partial Success
The REST service returns a partially successful response in the following format:
{
"data": [
{
"resourceStatus": "Active",
"resourceCurrency": "USD",
"unitsPerTime": 10,
"resourceCode": "Rate42",
"ext_resc_id": 100204,
"workspaceCode": "NON_PROD",
"rates": [
{
"ratesBreakdown": [
{
"rateType": "Direct",
"costType": "Food",
"id": 122578,
"resourceStandardRate": 50.0
},
{
"rateType": "Direct",
"costType": "Standard",
"id": 122579,
"resourceStandardRate": 100.0
},
{
"rateType": "Indirect",
"costType": "Standard",
"id": 122605,
"resourceStandardRate": 100.0
}
],
"resourceEffectiveDate": "2020-02-03",
"id": 122216
},
{
"ratesBreakdown": [
{
"rateType": "Direct",
"costType": "Food",
"id": 122580,
"resourceStandardRate": 50.0
},
{
"rateType": "Indirect",
"costType": "Standard",
"id": 122581,
"resourceStandardRate": 100.0
}
],
"resourceEffectiveDate": "2020-02-05",
"id": 122217
}
],
"resourceName": "Rate42",
"id": 2,
"parentResourceCode": "",
"resourceType": "Labor"
}
],
"message": [
{
"ResourceCode": "Child11Rate41",
"WorkspaceCode": "NON_PROD",
"ErrorStatus": 12476,
"ErrorMessage": "Invalid value was found in a field: [parentWorkspaceCode]. Allowed only string value or use quotations. "
},
{
"ResourceCode": "Child11Rate43",
"workspaceCode": "NON_PROD",
"ErrorStatus": 12414,
"ErrorMessage": "Invalid value was found in a field: [parentResourceCode]. Incorrect [parentResourceCode] provided."
}
],
"rest_audit_id": 7926,
"status": 3000
}
Supported Validation Messages and Status Codes
The following validation messages and status codes display in the response when incorrect values are provided in the request.
Field Name | Use-case Scenario | Status Code | Error Message |
---|---|---|---|
source | Source is not specified in the request. | 3002 | Invalid input. |
source | Source value is incorrect. | 12008 | Invalid value was found in a field: [source]. Allowed values: [Primavera Cloud, P6, Others]. |
source | Source value is null or empty. | 12030 | The API request contains empty value for: [source]. Allowed values: [Primavera Cloud, P6, Others]. |
source | Source value is boolean or number data type. | 12008 | Invalid value was found in a field: [source]. Allowed values: [Primavera Cloud, P6, Others]. |
parentWorkspaceCode | parentWorkspaceCode is a non-string value. | 12476 | Invalid value was found in a field: [parentWorkspaceCode]. Allowed only string value or use quotations. Resource Code: <Resource Code>. |
parentWorkspaceCode | parentWorkspaceCode exceeds 60 characters. | 12477 | Invalid value was found in a field: [parentWorkspaceCode]. Allowed length: [60]. Resource Code: <Resource Code> |
ext_resc_id | ext_resc_id is a non-string value. | 12478 | Invalid value was found in a field: [ext_resc_id]. Allowed only positive integer value. |
Related Topics
Create and Update Roles in the Master Rate Sheet
Get Resources from the Master Rate Sheet
Get Roles from the Master Rate Sheet
Last Published Tuesday, July 1, 2025