I’ve implemented several asset lifecycle integrations. Here’s the complete solution:
1. JSON Payload Validation - Correct Structure:
The JSON payload must include all required fields with proper formatting:
{
"state": "IN_MAINTENANCE",
"effectiveDate": "2025-07-19T14:00:00Z",
"comments": "Scheduled maintenance",
"initiatedBy": "integration_user",
"bypassWorkflow": true
}
Key fields:
state: Internal lifecycle state name (not display name)
effectiveDate: ISO 8601 timestamp
comments: Optional but recommended for audit trail
initiatedBy: User context for the change
bypassWorkflow: Set to true for system integrations to skip approval steps
2. REST API Requirements:
The endpoint and method vary based on Windchill version. For 11.1:
PUT /Windchill/servlet/odata/AssetMgmt/Assets('OR:wt.asset.Asset:12345')
Content-Type: application/json
CSRF_NONCE: <token>
Use PUT (not POST) for status updates. Include CSRF token in headers for security.
3. Field Mapping - Custom Attributes:
If your asset lifecycle has custom required fields for state transitions, include them in the payload:
{
"state": "IN_MAINTENANCE",
"effectiveDate": "2025-07-19T14:00:00Z",
"customAttributes": {
"maintenanceType": "Preventive",
"expectedDuration": "72",
"assignedTechnician": "TECH001"
}
}
4. Lifecycle State Validation:
Before making the API call, validate that:
- The target state is valid for the current asset state (check allowed transitions)
- The user context has permissions to perform the state change
- All required fields for the transition are included in the payload
You can query valid transitions with:
GET /Windchill/servlet/odata/AssetMgmt/Assets('OR:wt.asset.Asset:12345')/AvailableStates
5. Error Handling:
The 400 Bad Request error typically indicates:
- Missing required field in JSON payload
- Invalid state name (use internal name, not display name)
- Invalid state transition (current state doesn’t allow transition to target state)
- Missing CSRF token in request headers
- Custom required fields not included
Enable detailed API logging to see the specific validation error:
log4j.logger.com.ptc.windchill.odata=DEBUG
Testing Steps:
- Query current asset state and available transitions
- Verify internal state names match your lifecycle definition
- Test with minimal payload first (state and effectiveDate only)
- Add additional fields incrementally
- Validate custom required fields are included
By addressing all three focus areas (JSON payload structure validation, REST API method and endpoint requirements, and proper field mapping including custom attributes), your asset status integration should work reliably. The key is using PUT instead of POST and including the bypassWorkflow flag for system integrations.
This draft is based on general Windchill knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.