Create or Update Activity Spreads
POST /ws/rest/service/v2/activity/sheets/activities/spread
Purpose
Creates or updates activity spreads in a specific shell from the source system.
Notes:
- The POST method captures both create and update actions. Therefore, selecting or clearing Update permissions has no impact on this REST service.
- Validations are not implemented for System Activity Sheet data. The data from the source system is assumed to be sent correctly.
Prerequisites
Ensure the following:
- You must have Create permissions enabled.
- This REST service is specific to updating externally-synced activity spread data information from other applications. Therefore, sourceProjectID should be configured or added in the applicable project/shell Details tab).
Request Format
Send an API request as a JSON map with the following structure:
{
"options":{"Source": "<value>", "project_number": "<value>", "sourceProjectId": "<value>"}
"data":[]
}
In "data", value is accepted in form-data
key : file
value : {filename}.zip
Request Parameters - Form Data Fields
Specify the following parameters in the form data:
Request Parameter | Required? | Data Type | Description |
---|---|---|---|
_attachment | Yes | A JSON object in the following format:
| The file name uploaded by the REST service. |
options | Yes | An Options JSON object in the following format:
| JSON input containing source and project-related information. |
Request Parameters
Specify the following parameters in the Options object:
Request Parameter | Required? | Data Type | Description |
---|---|---|---|
source | Yes | String | External application or data from which Activity Spread data are pulled. Valid value includes: "Primavera Cloud". |
project_number | Yes | String | A valid 'Active' shell number where the spread data will be pushed. |
sourceProjectId | Yes | String | The Primavera Cloud project code. |
projectType | Yes | String | The type of project in Unifier for which the Assignments have to be created. Valid values include: "Current" and "Baseline". |
Request Parameters - _attachment fields
Specify the following parameters in the Options JSON map:
Request Parameter | Required? | Data Type | Description |
---|---|---|---|
zipped_file_name | Yes | String | The file name uploaded by the REST service. |
zipped_file_content | Yes | String | A Base64 encoded zip file. |
zipped_file_size | No | Integer | The file size of the zipped file uploaded by the REST service. |
Mandatory Fields for Current Project Type
For a "Current" project type, specify the following mandatory fields In the zipped_file_content
parameter:
"activityCode","timescale","spread","actualTotalCost","actualTotalCostProject","atCompletionTotalCost","atCompletionTotalCostProject","earnedValueCost","estimateAtCompletionCost","estimateAtCompletionCostProject","estimateToCompleteCost,"estimateToCompleteCostProject","estimateToCompleteLaborUnits","plannedTotalCost","plannedTotalCostProject","plannedValueCost","plannedValueCostProject","remainingTotalCost","remainingTotalCostProject","spreadDates"
Mandatory fields for Baseline Project Type
For a "Baseline" project type, specify the following mandatory fields In the zipped_file_content
parameter:
"activityCode","timescale","spread","actualTotalCost","actualTotalCostProject","atCompletionTotalCost","atCompletionTotalCostProject","plannedTotalCost","plannedTotalCostProject","remainingTotalCost","remainingTotalCostProject","spreadDates"
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.
CurrentActivitySpread JSON Sample
Send the following data to create a current activity spread:
{
"activities": [
{
"activityCode": "A1000",
"activityId": 502202,
"activityName": "act1",
"actualTotalCost": 0,
"actualTotalCostProject": 0,
"atCompletionTotalCost": 0,
"atCompletionTotalCostProject": 0,
"earnedValueCost": 0,
"earnedValueCostProject": 0,
"estimateAtCompletionCost": 0,
"estimateAtCompletionCostProject": 0,
"estimateToCompleteCost": 0,
"estimateToCompleteCostProject": 0,
"estimateToCompleteLaborUnits": 40,
"plannedTotalCost": 0,
"plannedTotalCostProject": 0,
"plannedValueCost": 0,
"plannedValueCostProject": 0,
"remainingTotalCost": 0,
"remainingTotalCostProject": 0,
"spread": {
"actualTotalCost": [0,0,0,0,0,0,0],
"actualTotalCostProject": [0,0,0,0,0,0,0],
"atCompletionTotalCost": [0,0,0,0,0,0,0],
"atCompletionTotalCostProject": [0,0,0,0,0,0,0],
"earnedValueCost": [0,0,0,0,0,0,0],
"earnedValueCostProject": [0,0,0,0,0,0,0],
"estimateAtCompletionCost": [0,0,0,0,0,0,0],
"estimateAtCompletionCostProject": [0,0,0,0,0,0,0],
"estimateToCompleteCost": [0,0,0,0,0,0,0],
"estimateToCompleteCostProject": [0,0,0,0,0,0,0],
"estimateToCompleteLaborUnits": [0,0,0,0,0,0,0],
"plannedTotalCost": [0,0,0,0,0,0,0],
"plannedTotalCostProject": [0,0,0,0,0,0,0],
"plannedValueCost": [0,0,0,0,0,0,0],
"plannedValueCostProject": [0,0,0,0,0,0,0],
"remainingTotalCost": [0,0,0,0,0,0,0],
"remainingTotalCostProject": [0,0,0,0,0,0,0],
"spreadDates": [
"2023-05-02T00:00:00",
"2023-05-03T00:00:00",
"2023-05-04T00:00:00",
"2023-05-05T00:00:00",
"2023-05-06T00:00:00",
"2023-05-07T00:00:00",
"2023-05-08T00:00:00"
]
},
"wbsId": 298601
}
],
"project": {
"projectCode": "testSpread",
"projectId": 258401,
"projectName": "testSpread"
},
"timescale": "DAILY"
}
Sample Success Request
{hosturl}ws/rest/service/v2/activity/sheets/activities/spread
Inputs in Raw JSON-data
{
"options": {
"project_number": "P-0056",
"sourceProjectId": "P-0056",
"source": "Primavera Cloud",
"projectType": "Current"
},
"_attachment": {
"zipped_file_name": "557118_activitySpreads.zip",
"zipped_file_size": 812,
"zipped_file_content": "UEsDBBQAAAAIABxu3FYgih2MigIAADgqAAAOAAAAb3Bjc3ByZWFkLmpzb27tV8tq4zAU3QfyD8ZrF+RHEqe7kG4KZRiYzMBQZqEmYvDg2MFW
p5SSf6/iR/1QIl0lLVZAIZAc32Pp+Fi+1nkbjyzLxmsa/Y9oRHL71npkh9jnrfxpqq/LdENY3V64ru1w1fsNq7lBEKBgxle/4W15bu/UZxyvUorjZZpTVkcni9+z9B9Z9zl0mW53
MaFRmtRMCOXoYARnCdn8wvEzYZzTxdMD5DTaYkoWrSkZGcgSDrlKK/JhdhAHONwDfkqzn0lED3c+aFF3MU7YFfOu8tVmNp7UNo2vSi3NyBZHSZT8rWeS1o8Ok+8ygtn6bBY1v8Cqlf/x
CZ0vQA34UxREa72viF3QF6C+IsFjwwmaO6eRi7rQ7UJPCH0VVRq4xbeOx871TBwRnHbhTAjDLpzDFOng0ZG+p4tZ0pY8uGud5q6hIi2tal5un9Xce0pAzb3/riy1DLneK0U6ddDWbmDwFX7
Qolnz7O5zhmublgWUp4Fn5abvjnUE7vG3PeT5N2hyg7wVQrfF13aOM3wpI5AyJlLGVMqYSRlhw2hZUv/dN9vhl6e8SGvePJwilx0uytLY53ni2BcKYp9nYh81se8KYp9C34Gj8eiC2AffnSig
8QgesAa16DoTn8IEcASTooM5wKinMBMcKWrSyC6T8c4QdhUZT+XK4QioRYPbZtLdhelOYQ44AqvRwCIT5kBhzgOHOd8Xh7m5IMz5JsxRE+ZMmDsjzCnMA0fjETw7aSdIA6NMmANsuU2YU5JmwtwZ
wkyYs0yYu0SLBvaYMCcVZcIcKMz5VZhjP5V/9q68efUuuDlS5zpmKf1R7pSdLqMcdxIGyO1VWK7rn3sg7MspWY8m+RrHBeVucf/wm1X371BLAQI/ABQAAAAIABxu3FYgih2MigIAADgqAAAOACQAA
AAAAAAAIAAAAAAAAABvcGNzcHJlYWQuanNvbgoAIAAAAAAAAQAYAJmTLy6ZqdkBAAAAAAAAAAAAAAAAAAAAAFBLBQYAAAAAAQABAGAAAAC2AgAAAAA="
}
}
Sample Success Response
A successful response displays a status code in the following format:
{
"data": {
"jobId": 1688383768969
},
"message": ["Job for spread data created successfully."],
"status": 202,
"rest_audit_id": 12676
}
Sample Failed Request
{hosturl}/ws/rest/service/v2/activity/sheets/activities/spread
Inputs in Raw JSON-data:
{
"options": {
"project_number": "P-0056",
"sourceProjectId": "P-0056",
"source": "Primavera Cloud",
"projectType": ""
},
"_attachment": {
"zipped_file_name": "557118_activitySpreads.zip",
"zipped_file_size": 812,
"zipped_file_content": "UEsDBBQAAAAIABxu3FYgih2MigIAADgqAAAOAAAAb3Bjc3ByZWFkLmpzb27tV8tq4zAU3QfyD8ZrF+RHEqe7kG4KZRiYzMBQZqEmYvDg2MFWp5SSf6/iR/1QIl0lLVZAIZAc32Pp+Fi+1nkbjyzLxmsa/Y9oRHL71npkh9jnrfxpqq/LdENY3V64ru1w1fsNq7lBEKBgxle/4W15bu/UZxyvUorjZZpTVkcni9+z9B9Z9zl0mW53MaFRmtRMCOXoYARnCdn8wvEzYZzTxdMD5DTaYkoWrSkZGcgSDrlKK/JhdhAHONwDfkqzn0lED3c+aFF3MU7YFfOu8tVmNp7UNo2vSi3NyBZHSZT8rWeS1o8Ok+8ygtn6bBY1v8Cqlf/xCZ0vQA34UxREa72viF3QF6C+IsFjwwmaO6eRi7rQ7UJPCH0VVRq4xbeOx871TBwRnHbhTAjDLpzDFOng0ZG+p4tZ0pY8uGud5q6hIi2tal5un9Xce0pAzb3/riy1DLneK0U6ddDWbmDwFX7Qolnz7O5zhmublgWUp4Fn5abvjnUE7vG3PeT5N2hyg7wVQrfF13aOM3wpI5AyJlLGVMqYSRlhw2hZUv/dN9vhl6e8SGvePJwilx0uytLY53ni2BcKYp9nYh81se8KYp9C34Gj8eiC2AffnSig8QgesAa16DoTn8IEcASTooM5wKinMBMcKWrSyC6T8c4QdhUZT+XK4QioRYPbZtLdhelOYQ44AqvRwCIT5kBhzgOHOd8Xh7m5IMz5JsxRE+ZMmDsjzCnMA0fjETw7aSdIA6NMmANsuU2YU5JmwtwZwkyYs0yYu0SLBvaYMCcVZcIcKMz5VZhjP5V/9q68efUuuDlS5zpmKf1R7pSdLqMcdxIGyO1VWK7rn3sg7MspWY8m+RrHBeVucf/wm1X371BLAQI/ABQAAAAIABxu3FYgih2MigIAADgqAAAOACQAAAAAAAAAIAAAAAAAAABvcGNzcHJlYWQuanNvbgoAIAAAAAAAAQAYAJmTLy6ZqdkBAAAAAAAAAAAAAAAAAAAAAFBLBQYAAAAAAQABAGAAAAC2AgAAAAA="
}
}
Sample Failed Response
For the above request, a failed response displays with a status code in the following format:
{
"data": [],
"message": [ {
"message": "The API request contains empty value for: [projectType].",
"status": 12144
} ],
"status": 3000,
"rest_audit_id": 14302
}
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 |
---|---|---|---|
_attachment | _attachment is not specified in the request. | 12524 | The API request is missing the required information: [_attachment]. |
_attachment | _attachment is empty/blank. | 12525 | The API request contains empty value for: [_attachment]. |
options | options is empty/blank or not specified in the request. | 3002 | Invalid input. |
source | Source is not specified in the request | 12007 | The API request is missing the required information: [source] |
source | Wrong source value is specified in the request. | 12703 | Invalid value was found in a field: [source]. Allowed value: [Primavera Cloud]. |
source | Source is empty | 12702 | The API request contains empty value for: [source]. Allowed value: [Primavera Cloud] |
source | Source is boolean or integer data type | 12703 | Invalid value was found in a field: [source]. Allowed value: [Primavera Cloud]. |
project_number | project_number is not specified. | 12018 | The API request is missing the required information: [project_number]. |
project_number | project_number is invalid. | 602 | Project/Shell Number is not correct. |
project_number | Project/Shell is not an active shell. | 1245 | Create/Update/Delete cannot be performed when project/shell status is Inactive or View-Only or On-Hold. |
project_number | project_number is empty/blank. | 12128 | The API request contains empty value for: [project_number]. |
sourceProjectId | sourceProjectId is not configured in the source Unifier shell. | 12021 | The API request contains an invalid value: [sourceProjectId]. Please check if this sourceProjectId has been configured in Unifier. |
sourceProjectId | sourceProjectId value is a blank. | 12032 | The API request contains empty value for: [sourceProjectId]. |
sourceProjectId | sourceProjectId is not specified in the request. | 12005 | The API request is missing the required information: [sourceProjectId] |
projectType | projectType is not specified in the request. | 12143 | The API request is missing the required information: [projectType]. |
projectType | projectType is empty/blank for system sheet. | 12144 | The API request contains empty value for: [projectType]. Allowed values: [Current, Baseline] |
projectType | projectType is of incorrect data type. | 12142 | Invalid value was found in a field: [projectType]. Allowed only alphanumeric value. |
projectType | An invalid value is passed in projectType for system sheet. | 12145 | Invalid value was found in a field: 'projectType'. Allowed values: [Current, Baseline] |
zipped_file_name | zipped_file_name is empty/blank. | 12527 | The API request contains empty value for: [zipped_file_name]. |
zipped_file_name | zipped_file_name is missing in the request. | 12518 | The API request is missing the required information: [zipped_file_name]. |
zipped_file_name | zipped_file_name is not a .zip file format. | 12503 | Invalid value was found in a field :[zipped_file_name]. Allowed only .zip files. |
zipped_file_name | zipped_file_name is an invalid value. | 12521 | Invalid value was found in a field: [zipped_file_name]. Allowed only alphanumeric characters in file name. |
zipped_file_content | zipped_file_content is not specified in the request. | 12520 | The API request is missing the required information: [zipped_file_content]. |
zipped_file_content | zipped_file_content is empty/blank. | 12529 | The API request contains empty value for: [zipped_file_content]. |
zipped_file_content | zipped_file_content is an invalid value. | 12523 | Invalid value was found in a field: [zipped_file_content]. Allowed only base64 encoded value. |
zipped_file_size | zipped_file_size is not specified in the request. | 12528 | The API request contains empty value for: [zipped_file_size]. |
zipped_file_size | zipped_file_size is empty/blank. | 12519 | The API request is missing the required information: [zipped_file_size]. |
zipped_file_size | zipped_file_size is an invalid value. | 12522 | Invalid value was found in a field: [zipped_file_size]. Allowed only integer value. |
zipped_file_size | Size mismatch with base encode file. | 12526 | Invalid value was found in a field: [zipped_file_size]. Actual file size does not match with [zipped_file_size]. |
Additional Validation Messages
Upon processing the uploaded zip file or processing the attached JSON file, the following messages may display in the Get Job Status Details section:
Use-case Scenario | Error Message |
---|---|
Zip file is an invalid file format. | The attached zip file contains an invalid file format. Only JSON file is allowed. |
[activities] is missing in the uploaded JSON. | The JSON file is missing the required information: [activities]. |
Mandatory field is missing in the uploaded JSON. | The attached JSON file is missing the required information: [{property name}] for [activityCode] : {activityCode} |
Mandatory field is empty in the uploaded JSON. | The attached JSON file contains empty value for: [{propety name}] for [activityCode] : {activityCode} |
Missing field in [spread] object. | The JSON file is missing the required information: [propetyName] in [spread] object. [activityCode]:{activityCode} |
Mandatory field is an invalid data type in the uploaded JSON. | The attached JSON file contains value with invalid data type for: [{propety name}] for [activityCode]: {activityCode} |
Spread dates are in an invalid format. | The API request contains an invalid value: [spreadDates]. Correct date format: [yyyy-MM-ddTHH:mm:ss]. [activityCode] :{activityCode} |
JSON file contains property/data in an incorrect JSON template. | Issue in parsing the JSON file. Invalid JSON file provided in the zip file. |
System Activity Sheet is not configured while inserting System-type Activity Spread Date. | System Activity Sheet is not configured for the shell. |
System Activity Sheet is configured through Gateway while inserting System-type Activity Spread Data. | System Activity Sheet is configured with Gateway and is not supported with this API. |
System Activity Sheet is configured for Oracle Primavera Cloud but source is given as P6 while inserting System-type Activity Spread Data. | System Activity Sheet is configured with source as Oracle Primavera Cloud. |
Timescale is not set as Daily. | The API request contains invalid value for: [timescale]. Allowed values {daily}. |
Activity Code is not configured in Unifier for the project_number and sourceProject Id. | The JSON file containing [activityCode] not configured in the system. [activityCode]: {activityCode} |
Related Topics
Create, Update, and Remove Assignments
Create or Update Assignment Spreads
Create, Update, and Remove Activities from the System Activity Sheet of a Specific Shell
Get Activities from the System Activity Sheet of a Specific Shell
Create, Update, and Delete Activities in the Manual Activity Sheet of a Specific Shell
Create or Update Baseline Schedule for Manual Activity Sheet
Get Activities in the Manual Activity Sheet of a Specific Shell
Schedule Project for Manual Activity Sheet
Recost Project for Manual Activity Sheet
Last Published Wednesday, April 9, 2025