Question

Error trying to upload document via RESTful API

  • 17 June 2021
  • 1 reply
  • 1184 views

Userlevel 6
Badge +12

Hello,

I found a great document (by researching this Community) that summarizes the process for uploading a document via the RESTful API here:

https://community.ifs.com/technology-infrastructure-cloud-integration-dev-tools-50/upload-document-via-createandimportdocument-svc-edmfileset-6284.

Great stuff! I got started with Postman to test things out. Our IFS environment is APPS10, Update 9.

I used Basic Authentication (App Owner credentials) and that stopped the authentication errors I was getting. Then I provided the following JSON as POST data to the CreateDocument entry point (<host>:<port>/int/ifsapplications/projection/v1/CreateAndImportDocument.svc/CreateDocument):

{
  "DocClass": "MAINT",
  "DocNo": null,
  "DocSheet": null,
  "DocRev": null,
  "Title": "Test Document",
  "BookingList": null,
  "Id1": null,
  "Id2": null,
  "CreateFileRef": "YES"
}

The above is straight from the example document linked at the top of this post, with DocClass changed to a valid class for our environment. That got me further along, but an error response came through:

{
    "error": {
        "code": "DATABASE_ERROR",
        "message": "Database error occurred. Contact administrator.",
        "details": [
            {
                "code": 20110,
                "message": "ORA-20110: DocIssue.DOCMANDXTOWNERMAN: The logged in User should be connected to a Person registered in the system."
            }
        ]
    }
}

I figured it didn’t like me using the IFS App Owner, so I logged in as myself. Still got an error, that now looked like:

{
    "error": {
        "code": "DATABASE_ERROR",
        "message": "Database error occurred. Contact administrator.",
        "details": [
            {
                "code": 20124,
                "message": "ORA-20124: Error.NULLVALUE: Field [FILE_TYPE] is mandatory for EDM File and requires a value."
            }
        ]
    }
}

Looks like progress! OK, so I added FileType (of "PDF") to the POSTed JSON. Still errors out, now with a response that goes all the way back to:

{
    "error": {
        "code": "ODP_DESERIALIZATION_ERROR",
        "message": "Error while de-serializing contents."
    }
}

The document says I should have received a response indicating a successful document creation so I can proceed with the next steps. Can anyone tell me what I am doing wrong? I am very glad to have discovered such a straightforward way of adding a document (with basic authentication), but I can’t get it to work. Any help would be greatly appreciated!

 

Thanks,

JoeK


This topic has been closed for comments

1 reply

Userlevel 6
Badge +12

After more testing in Aurena, I can get the same error if I try to upload a document in the general Document management area:

 

 

If I do not try to attach a file (just create a blank document, it works. But when I try to check in a revision (upload the actual document) I get a Server Error.

Creating a document without an actual uploaded file is exactly what CreateDocument is supposed to do. And that works in Aurena while actually attaching a file at the same time results in the same error I see in Postman. Very weird!

Is uploading documents from the RESTful API supported at this time, or not?

 

Thanks,

JoeK