Commit file upload transaction
Copy
The vault.CommitTransaction method finalizes a file upload and submits the OData representation of the item using file(s) uploaded by the vault.UploadFile method. This includes the file ID, filename, file size, and the Located item that points to the current user’s vault. For example:
{
‘id': [id passed to the vault.UploadFile method],
‘filename': [the name of the file being uploaded],
‘file_size': [the size of the file in bytes],
‘located':
[
{
‘file_version': [the version of the file],
‘related_id': [the ID of the user’s vault]
}
]
}
Once Aras Innovator responds that the transaction is successful, the Vault server commits the transaction on its side.
POST http://vault/odata/vault.CommitTransaction
VAULTID: {{vault_id}}
Prefer: return=minimal
OData-Version: 4.0
transactionid: 8970e933322d1328537f645d3683214c
Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Length: ###
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http
POST /odata/Document HTTP/1.1
Host: host
Content-Type: application/json
{
"@odata.context":"http://host/server/odata/$metadata#Document/$entity”
"@odata.type":"#Document”,
“id":"FBCC…74FC”,
“item_number": “DOC-01",
“Document File": [{
“id":"40F1…6369",
“related_id":
{
“id":"2778F0A17FDF4095A497A9A27B594376",
“filename": “6d039e86857376a761b87c4d559953e2.jpg”
}
}]
}
--batch_36522ad7-fc75-4b56-8c71-56071383e77b--
Response:
HTTP/1.1 204 No Content
Location: http://host/server/odata/Document(‘FBCC…74FC’)
GET http://host/server/odata/User(‘{{current_user_id}}’)?$select=default_vault
Response:
{
"@odata.context": “http://host/server/odata/$metadata#User(default_vault)/$entity”,
"@odata.id": “User({{current_user_id}})”,
“default_vault@odata.associationLink": “User('{{current_user_id}}')/default_vault/$ref”,
“default_vault@odata.navigationLink": “User('{{current_user_id}}')/default_vault”,
“default_vault@aras.keyed_name": “Default”,
“default_vault@aras.id": "{{vault_id}}"
}