We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Creating Document using REST WEB API returning Error

We have a custom integration that adds documents to Superoffice Online using the REST API which worked previously but has started returning errors since Monday 9th December.

Our workflow is fairly simple in that we :

  1. Create a document record with a POST to the /api/v1/Document endpoint
  2. Upload the actual document content with a PUT to /api/v1/Document/documentId/Content where documentId is the id of the document created in 1)

Previously this has worked perfectly and many 1000's of documents have been processed this way, however now the initial POST request in 1) fails and returns a 500 status code and the following error message :

{'Error': True, 'Message': 'Object reference not set to an instance of an object.', 'ErrorType': 'NullReferenceException', 'ErrorSource': 'SuperOffice.Services.Implementation'}

My assumption is that something has changed in the underlying API or data  (possibly due to an update, as for example I am aware that our customer had to update their WEB Tools on Monday 9th) however,  the error message is not particularly helpful and the support desk say nothing has changed that should impact on this, so I'm a little stuck.

Just wondering if anyone is experiencing any similar issues or even could confirm that Document creation via the REST API is working OK for them, as it might help us in trying to work out what happening.

Steve

 


RE: Creating Document using REST WEB API returning Error

Hi Steven,

we can not find any 500 error, but we do see a lot of these and with None as the documentId.

Av: Margrethe Romnes 12. dec 2019

RE: Creating Document using REST WEB API returning Error

Hi,

Thanks for your response yes, the "None" for the documentId  in the PUT as highlighted below is because the initial step 1) when we try to create the document with the POST is failing and we dont get an ID , hence the None , the debug version of the workflow that I have currently enabled while we look into this does not check for a valid ID and proceeds with the PUT regardless.

The 500 error is being returned from the POST to /api/v1/Document  in step 1) , can you see these POSTs in the logs ?

Thanks

 

Steve

Av: Steven Brown 12. dec 2019

RE: Creating Document using REST WEB API returning Error

Hi,

Thanks for your response yes, the "None" for the documentId  in the PUT as highlighted below is because the initial step 1) when we try to create the document with the POST is failing and we dont get an ID , hence the None , the debug version of the workflow that I have currently enabled while we look into this does not check for a valid ID and proceeds with the PUT regardless.

The 500 error is being returned from the POST to /api/v1/Document  in step 1) , can you see these POSTs in the logs ?

Thanks

 

Steve

Av: Steven Brown 12. dec 2019

RE: Creating Document using REST WEB API returning Error

Hi Steven, found those too, but not more logging without enabling it on the customer. Could you email me on appdev@superoffice.com and we'll continue there.

Av: Margrethe Romnes 12. dec 2019

RE: Creating Document using REST WEB API returning Error

Just to sum up. There is a bug in the current release if documents OurRef is null.  Workaround is to set it as an empty string. Next release (January 2020) will have a fix. 

Av: Margrethe Romnes 17. dec 2019