US
Apprentice

How can SmartObjects be published so that Create, Update, Read, List methods can be used?

This is necessary in order for a third-party service to be able to connect to K2 and manipulate data in K2 (Create \ Edit \ Read \ List methods)

 

 

 
Tags (2)
0 Kudos
7 Replies
Prineel
Scout

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

Hi,

 

Please have a look at this document:
Using SmartObjects to integrate with other systems and technologies

 

Kind Regards

Prineel

0 Kudos
US
Apprentice

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

This is a little different.
I don't need to work with a third party service in K2.
I need to open access to some kind of SmartObject in K2.
And a third-party service connected to the published K2 SmartObject and worked with them.

There is a “SmartObject OData API”, but only List.
And I still need to create, update, read

0 Kudos
Prineel
Scout

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

Hi, 

Please have a look at this:
 

SmartObject OData API

The SmartObject OData API lets you retrieve and interact with SmartObject data through the K2 OData feed in JSON format. The SmartObject OData v3 API supports a single List method. The SmartObject OData v4 API supports all SmartObject methods.

 Before you can use this API, enable it in the K2 Management site. See the following topics in the User Guide for more information:

 

Pay attention to the considerations for using the SmartObject OData API.

For sample code that illustrates how to interact with the OData v3 API, see the topics Using the SmartObject OData v3 API in C# and Using the SmartObject OData v3 API in JavaScript. These samples use Basic authorization, but you can also use OAuth by setting the header up correctly and confirming that AAD Consent has been granted.

For examples of OData v4 endpoints see the topic SmartObject OData API v4 endpoints and for sample code that illustrates how to interact with the OData v4 API, see the topic Using the SmartObject OData API v4 in C#.

ClosedUsing OAuth instead of Basic Authentication

Tips

  • Use the K2 Management interface to refresh the OData service. You can also refresh the K2 OData service in code by calling the following endpoint: https://[k2_site_name]/api/odata/op/refresh
  • To see which SmartObjects are exposed via the OData API, just pass in the base URL to your OData feed in your code, for example https://[K2site]/api/odata/v3.
  • The endpoint is based the SmartObject System Name, not the SmartObject's Display Name.

 

Kind Regards
Prineel

0 Kudos
US
Apprentice

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

Hi, Prineel
OData v4 API is only for K2 Cloud version or also for K2 Five 5.4?

0 Kudos
Prineel
Scout

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

Hi @US,

 

Apologies fot the late reply. It is also for K2 Five 5.4. Please find the attached PDF documents which contain information on the OData API found in K2 Five 5.4 Developer Referece document.

 

Kind Regards

Prineel

0 Kudos
US
Apprentice

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

Hi, Prineel
I tryed refresh the K2 OData service

4f5b4b63-fb59-4145-a008-f2594d352579.png

I have no way to select V4 version in the settings.
Maybe you still need to do something?
 

b8af6fe9-d7dc-47b2-8c70-172b5e5fd17e.png

 

0 Kudos
Prineel
Scout

Re: How can SmartObjects be published so that Create, Update, Read, List methods can be used?

Hi @US ,

 

That seems to be the case when I also tired. Im not sure if something needs to be done first, or if it is not supported. If it is not supported then im not sure why it is in the 5.4 documentation. I recommend opening a support ticket to enquire about this.

 

Kind Regards

Prineel

0 Kudos