Forum Discussion

mmoales's avatar
mmoales
Ideator II
7 years ago

Conversion task not triggered after REST upload

I am uploading files using the REST API. However, after a successful upload, the conversion task that is associated with the specified file type is not being triggered. If I upload the same file using the client, the task is triggered. Has anyone done this before? Is there something I should be setting in the commit request to trigger the conversion task? I tried including '@aras.serverEvents':'1' in the request body, but it did not make any difference. Thanks, Mark

2 Replies

  • Hi Mark, Could you share the REST call that you're using to create the File? From my experience, it hasn't been possible to upload a file directly through AML outside of a Server Method or the Batchloader. You can try creating a Server Method that creates a File within it, and then use the REST API to call that Server Method. You can find an example of the REST call to do this below. url: localhost/.../method.CreateFile body: { "@odata.type": "">localhost/.../$metadata, "file_path": "C:\\Temp\\MY_FILE_NAME.MY_FILE_EXTENSION" } Chris
    Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, The following are the request bodies I have used when invoking the vault.CommitTransaction method. Both succeed in creating the file in the vault, but neither triggers the conversion task. The first request associates the newly uploaded file with a Document. The second simply creates the File in the vault. # JSON data for vault.CommitTransaction request body # Creates Document with Document File pointing to uploaded file data = { '@odata.context': host + '/Server/odata/$metadata#Document/$entity', '@odata.type': '#Document', 'id': docId, 'item_number': 'DOC-02', 'Document File': [{ 'id': docFileId, 'related_id': { 'id': fileId, 'filename': filename } }] } # JSON data for vault.CommitTransaction request body # Creates a File in the vault info = { 'file_version': '1', 'related_id': VAULT_ID } located = [info] data = { '@odata.context': host + '/Server/odata/$metadata#File/$entity', '@odata.type': '#File', 'id': fileId, 'filename': filename, 'file_size': str(size), 'Located': located } If I upload the same file using "Administration > File Handling > Files > New File...", the conversion task is triggered. Thanks, Mark