Discussions
How to delete attribute in asset?
8 months ago by Ahmed Elganady
Request:
curl --location --request DELETE 'https://am-ce913a.corrigo.com/api/v1/base/AssetAttribute?ID=53128' \
--header 'CompanyName: Sandbox Whole Foods' \
--header 'Authorization: Bearer eyJBdXRoZW....' \
--header 'Cookie: nav_track=d-c7bqoDvKh23*6uusMHgHPjyCDVqt9CSidnHkPjr*AptXHUx6aMmEfDYNpsQqCPi-d'
Response:
{
"ErrorMessage": "Asset Attribute modifications must be performed in parent's context; parent ID #91297",
"ErrorCode": "BUSINESS_LOGIC_ERROR",
"TimeStamp": "2024-04-02T23:14:53.0116448Z"
}
and using PUT request
curl --location --request PUT 'https://am-ce913a.corrigo.com/api/v1/base/Location' \
--header 'CompanyName: Sandbox Whole Foods' \
--header 'Authorization: Bearer eyJBdX...' \
--header 'Content-Type: application/json' \
--header 'Cookie: nav_track=d-c7bqoDvKh23*6uusMHgHPjyCDVqt9CSidnHkPjr*AptXHUx6aMmEfDYNpsQqCPi-d' \
--data '{
"Properties": [
"Attributes.*"
],
"Entity": {
"Attribute": [],
"Id": 91297
}
}'
Response:
{
"EntitySpecifier": {
"EntityType": "Location",
"Id": 91297
}
}
But when retrieving the asset details I found nothing changes!
{
"Entities": [
{
"Data": {
"Name": "Unit",
"ModelId": 4243,
"Orphan": false,
"TypeId": "Equipment",
"ParentId": 0,
"RootId": 0,
"IsTemplate": false,
"IsOffline": false,
"IsLocked": false,
"IsRestricted": false,
"Attributes": [
{
"Descriptor": {
"Type": "Phone",
"Name": "Test #",
"IsHistory": false,
"DisplayInWorkOrder": false,
"IsRemoved": false,
"ConcurrencyId": 2,
"Id": 10303
},
"AssetId": 91297,
"TopAssetId": 91297,
"CurrencyTypeId": "Unknown",
"Value": "9721234567",
"ConcurrencyId": 3,
"Id": 53128
}
],
"IsDirectParts": false,
"IncludeNonControllableExpenses": true,
"CriticalFacilities": "Inherit",
"Id": 91297
}
}
]
}