Asset API
REST API reference for asset.do - A physical or digital asset that is tracked, managed, or utilized in business operations. Assets can be identified using GS1 identifiers (GIAI for individual assets, GRAI for returnable assets) for global traceability.
Asset API
A physical or digital asset that is tracked, managed, or utilized in business operations. Assets can be identified using GS1 identifiers (GIAI for individual assets, GRAI for returnable assets) for global traceability.
Endpoint
POST https://api.do/assetAuthentication
All API requests require authentication:
curl https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Request
Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
X-Request-ID: unique-request-id (optional)Request Body
{
"operation": "asset",
"parameters": {
// Operation-specific parameters
},
"options": {
"timeout": 30000,
"retries": 3
}
}Response
Success Response
{
"success": true,
"data": {
// Response data
},
"meta": {
"requestId": "req_123",
"timestamp": "2025-01-01T12:00:00Z",
"duration": 145
}
}Error Response
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid parameters",
"details": {
// Error details
}
},
"meta": {
"requestId": "req_123",
"timestamp": "2025-01-01T12:00:00Z"
}
}Operations
create
Register a new asset with optional GS1 identifier.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "create",
"parameters": {}
}'update
Update asset information or status.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "update",
"parameters": {}
}'delete
Remove an asset from tracking (decommissioning).
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "delete",
"parameters": {}
}'assign
Assign the asset to a person, location, or entity.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "assign",
"parameters": {}
}'transfer
Transfer ownership or custody of the asset.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "transfer",
"parameters": {}
}'locate
Update the current location of the asset.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "locate",
"parameters": {}
}'maintain
Record maintenance performed on the asset.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "maintain",
"parameters": {}
}'inspect
Record inspection results for the asset.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "inspect",
"parameters": {}
}'depreciate
Calculate and record depreciation.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "depreciate",
"parameters": {}
}'retire
Mark the asset as retired or disposed.
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "retire",
"parameters": {}
}'Examples
cURL
curl -X POST https://api.do/asset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "asset",
"parameters": {}
}'JavaScript/TypeScript
const response = await fetch('https://api.do/asset', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
operation: 'asset',
parameters: {},
}),
})
const data = await response.json()Python
import requests
response = requests.post(
'https://api.do/asset',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'operation': 'asset',
'parameters': {}
}
)
data = response.json()Rate Limiting
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200Status Codes
200 OK- Success400 Bad Request- Invalid request401 Unauthorized- Missing/invalid API key403 Forbidden- Insufficient permissions404 Not Found- Resource not found429 Too Many Requests- Rate limit exceeded500 Internal Server Error- Server error503 Service Unavailable- Service temporarily unavailable
Error Codes
VALIDATION_ERROR- Invalid parametersAUTHENTICATION_ERROR- Invalid API keyAUTHORIZATION_ERROR- Insufficient permissionsNOT_FOUND- Resource not foundRATE_LIMIT_EXCEEDED- Too many requestsTIMEOUT- Operation timeoutINTERNAL_ERROR- Server error
Webhooks
Subscribe to events:
curl -X POST https://api.do/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhook",
"events": ["asset.created", "asset.updated", "asset.deleted", "asset.assigned", "asset.transferred", "asset.located", "asset.maintained", "asset.inspected", "asset.depreciated", "asset.retired", "asset.lost", "asset.found", "asset.damaged"]
}'Best Practices
- API Keys - Store securely, never commit to git
- Error Handling - Handle all error codes gracefully
- Retries - Implement exponential backoff
- Rate Limiting - Respect rate limits
- Idempotency - Use
X-Idempotency-Keyheader - Logging - Log requests for debugging