POST public-api/contracts/addAssets
This method is used to add assets to a contract that already exists. It provides the contract number and the assets that need to be added. This method takes in a Dictionary of string Lists where the Dictionary key is the Contract Number and the List contains the Asset Tags to add to the contract. Requires Edit Contract permission, enforces Role Site and Asset Type security on the assets being associated. Only active fixed assets can be linked to a contract; an asset tag that is not a fixed asset the caller is allowed to see is reported as not existing. An asset that is already linked to the contract is reported as a duplicate rather than being silently skipped, and any asset-level failure suppresses the success result for that contract. Accepts a maximum of 500 contracts at a time; the limit counts dictionary entries, not the asset tags they contain.
Request Information
URI Parameters
None.
Body Parameters
Dictionary of string [key] and Collection of string [value]Request Formats
application/json
{
"sample string 1": [
"sample string 1",
"sample string 2"
],
"sample string 2": [
"sample string 1",
"sample string 2"
]
}
Response Information
Resource Description
WaspResultOfResults| Name | Description | Type | Additional information |
|---|---|---|---|
| Data | Results |
None. |
|
| Messages | Collection of WtResult |
None. |
|
| BatchNumber | integer |
None. |
|
| HasError | boolean |
None. |
|
| HasHttpError | boolean |
None. |
|
| HasMessage | boolean |
None. |
|
| HasSuccessWithMoreDataRemaining | boolean |
None. |
|
| TotalRecordsLongCount | integer |
None. |
Response Formats
application/json
{
"Data": {
"ResultList": [
{
"ResultCode": 0,
"Message": "sample string 1",
"HttpStatusCode": 200,
"FieldName": "sample string 2"
},
{
"ResultCode": 0,
"Message": "sample string 1",
"HttpStatusCode": 200,
"FieldName": "sample string 2"
}
],
"SuccessfullResults": 1,
"TotalResults": 2,
"ErrorCount": 0
},
"Messages": [
{
"ResultCode": 0,
"Message": "sample string 1",
"HttpStatusCode": 200,
"FieldName": "sample string 2"
},
{
"ResultCode": 0,
"Message": "sample string 1",
"HttpStatusCode": 200,
"FieldName": "sample string 2"
}
],
"BatchNumber": 1,
"HasError": false,
"HasHttpError": false,
"HasMessage": true,
"HasSuccessWithMoreDataRemaining": false,
"TotalRecordsLongCount": 1
}