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#.

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.