SaveTechnicalAttributes
The SaveTechnicalAttributes allows you to update multiple entries of the same attribute and create multiple attributes for different IBs in a request payload.
The REST API allows connected systems to send IB attribute details to ServiceMax using REST APIs.
Using the API, for any IB, you can:
Update existing attributes with new values.
Create missing attributes and capture value for the same attribute in the same request.
Update/create multiple attributes for one IB.
Update/create multiple attributes for multiple IBs.
Send time of occurrence information for each attribute.
Send multiple entries for the same attribute with time of occurrence and value details.
Recognize the correct IB based on the Name, Salesforce ID, or External Identifier field.
The following table lists the various attributes of the OOTB event:
Attributes
Values
Web service Class Name
saveTechnicalAttributes
REST Endpoint URI*
/services/apexrest/SVMXC/technicalAttribute/v1/saveTechnicalAttributes/
Method
POST
* You must prefix the Salesforce instance URL or the custom URL in the request to access from an external system. For example, https://MyDomainName.my.salesforce.com/services/apexrest/SVMXC/technicalAttribute/v1/saveTechnicalAttributes/
Request JSON
The following is a sample JSON request.
{
"targetObject": null,
"source": "External System",
"objectName": "SVMXC__Installed_Product__c",
"assetIdentifierFieldAPIName": "SVMXC__Serial_Lot_Number__c",
"attributeList": [
{
"value": "10800",
"unit": "Watt",
"attributeKey": "EnergyConsumption",
"dataType": "Number",
"timeOfOccurence": "2022-06-16 02:30:00",
"recordName": null,
"recordId": null,
"assetIdentifiers": [
{
"identifierName": "ThingName",
"value": "TFS500-6391703713"
}
]
},
{
"value": "363.8",
"unit": "Watt",
"attributeKey": "SealingPressure",
"timeOfOccurence": "2023-09-04 17:32:00",
"assetIdentifiers": [
{
"identifierName": "Serial Number",
"value": "D-W789-0"
},
{
"identifierName": "Model",
"value": "MOMD"
}
],
"lastOccurrenceTimeList": [
{
"timeOfOccurence": "2023-09-04 05:45:00",
"value": "500"
},
{
"timeOfOccurence": "2023-09-03 17:00:00",
"value": "650"
}
]
}
]
}
The following table describes the parameters used in the JSON request.
Input Type
Field
Mandatory or Optional?
Description
Notes
targetObject
Optional
The target object.
The value must be set to null.
source
Mandatory
The source from where the technical attribute is being added.
The value must be set to External System.
objectName
Mandatory
The name of the object to which the technical attribute is associated.
The value must be set to SVMXC__Installed_Product__c.
assetIdentifier FieldAPIName
Mandatory
The API name of the field on the IB object that holds the unique value of the asset. For example, External Record ID
This is used to recognize the IB which needs to be updated.
If the key recordId is not populated in the request then the IB search will be on this key.
The value must match with the IB's field API name to recognize the IB field.
When IB data has been synchronized between
ServiceMax and the external system using a unique key, then it is recommended to use this key to recognize the matching IB.
This key can be blank, and will not be considered when 'Installed Product Lookup" configuration is added in the IoT setup.
attributeList
* 
Note: This is an array of attributes that you want to create or update. You can pass a maximum of 200 attributes in one request.
value
Mandatory
The most recent value of the technical attribute.
When you pass "" or a null value, the technical attribute is created, but without a value.
To clear the value, send “” or null.
The date value must be in the format yyyy-mm-dd.
The datetime must be in the format yyyy-mm-dd hh:mm:ss.
Boolean must be in the true/false format.
The value format must match the attribute datatype when updating the existing attribute.
unit
Optional
The unit of the technical attribute.
recordName
Optional
The name of the IB for which you are creating the technical attribute.
recordId
Optional
The record ID of the IB for which you are creating the technical attribute.
You can skip the assetIdentifiers() and update the attribute value by directly passing the IB recordId in the request. The sample request is as follows:
{ "targetObject": null, "source": "External System", "objectName": "SVMXC__Installed_Product__c", "assetIdentifierFieldAPIName": "", "attributeList": [ { "value": "16", "unit": "", "recordId": "18 digit saleforce id ", "dataType": "Number", "attributeKey": "Temperature", "timeOfOccurence": "yyyy-mm-dd hh:mm:ss" } ] }
dataType
Optional
The datatype of the technical attribute.
If you do not provide the datatype, the datatype is set as text when creating missing attributes.
The format must match: Text / Number / Picklist / Boolean / Date / Datetime.
The API will not perform datatype validation when updating an existing attribute value.
attributeKey
Mandatory
The unique attribute name.
If the technical attribute does not exist, a new technical attribute with the provided name is created.
If a technical attribute with the same name already exists, that technical attribute is updated.
timeOfOccurence
Optional
Timestamp when the attribute displayed a specific value or event occurred.
The format must be yyyy:mm:dd hh:mm:ss.
If the value is not sent then the date and time when the attribute value is captured on the server is set as the time of occurrence.
assetIdentifiers
Mandatory
Unique key and value of the IB from external system.
The assetIdentifier has two parameters: identifierName and value.
The "identifierName" holds the external identifier key. This is mandatory if the IB lookup configuration is present in the IoT Setup.
The "value" holds the value of the key.
Both these parameters are mandatory if the IB search is based on IB lookup configuration or the search is based on passing field API name.
You can send one or multiple idenfierName and values. The values sent in this list will be concatenated in the order it is sent to form the unique external asset Identifier for the IB, which will be matched against the ServiceMax unique identifier field value.
lastOccurrenceTimeList
Optional
Multiple entries for the same attributes.
Send the previous entries for the same attribute by passing the time of occurrence (in descending order) and the attribute value
The IB Search is performed in the following sequence:
1. If the Installed Product lookup configuration is available in the IoT Setup, then the IB search is performed for the assetIdentifier value against the Installed Product lookup configuration.
2. If the Installed Product lookup configuration is not available in the IoT SetupPayload, then the search is performed on the recordId in the request.
3. If the recordId value is not sent in the request, then the IB search is performed against the assetIdentifierFieldAPIName.
Response JSON
The following is a sample JSON response for record creation.
The following is a sample JSON response for record updation.
The following list represents the API Execution Status:
A successful response is displayed along with details sent in the request when the action is successful.
An error response is displayed when execution fails due to format or server issues.
An entry is created in the IoT Events object every time the API is executed. The entry has an Alert Event field value, which is "saveTechnicalAttributes". It holds operation status as Success or Failed, with message and timestamp details for each execution.
* 
Event execution status is maintained in the IoT Events object. For more information, see Event Traceability.
The Validate External ID flow validates the unique IB External ID for a Technical Attribute and if a duplicate IB External ID is found, an error message is displayed. For more information, see Validate External ID.
Was this helpful?