Question

OData endpoint returning 'An Error has occurred'

  • 5 January 2024
  • 7 replies
  • 81 views

Badge +4

We have an issue with a Smart Object Odata that has been setup the management SO functionality. Basically when we run the endpoint we get an error has occurred. In the past it was working but for some reason it is not longer working. What I am finding strange is the the OData SO name is different from the actual SO name it has a prefix of OData_{smartobject name} while the rest of the OData endpoints don't have that. Does anyone know how I can understand what is causing this error. Thanks  


7 replies

Userlevel 3
Badge +10

What version of K2 are you using?

 

Are you able to attach a screenshot of the error?

 

If you browse to https://yourk2url/api/odatav4/v4/, you should see the list of SmartObjects that was exposed as endpoint; it should have both the SmartObject name and what the  URL would be, for example:

{"name": "TestSMO","kind": "EntitySet","url": "TestSMO1"}

Then the direct URL to the odata endpoint for this SmartObject would be:

https://yourk2url/api/odatav4/v4/TestSMO1

 

The /odatav4/v4/ part of the URL may also be different depending on which version you choose to use.

 

I am not seeing the  OData_{smartobject name} behavior in my 5.7 environment.  Perhaps a user/developer cloned the SmartObject and renamed it OData_{smartobject name} so that it can be separate from the original SmartObject name.

 

Badge +4

We are using version 3 https://url/api/odata/v3/

The endpoint : 

The url for endpoint:

https://url/api/odata/v3/OData_02_ClientDetails_Data

 

The error :

 

Userlevel 3
Badge +10

I would like to recommend one more debugging step.

If you create a very simple SmartBox SmartObject, with one Text field for example.  Generate an editable list view, and add 1 or 2 records.  Then expose this SmartObject as an Odata endpoint and test if you are able to load it.

If it works with a very simple SmartBox SmartObject, and not this particular OData_02_ClientDetails_Data object, then there may be an issue specific to this object that we can focus on.

Badge +4

We have other OData objects and they work fine its particular to this exposed Object

Userlevel 3
Badge +10

Are you able to execute this SmartObject’s methods (list, create, read, update, delete) through K2 Management site?

Perhaps there is an error at the SmartObject level already, and as such exposing it as an odata endpoint will also just surface that error.

Badge +4

Yes the SO work normally when I run them through the management 

Userlevel 2
Badge +10

May I suggest looking at Odata API log, this will likely give more details on the issue then the front end.

https://help.nintex.com/en-US/k2five/icg/5.3/Content/Configure/RESTAPILogging.htm

Reply