Skip to main content
Nintex Community Menu Bar

OData - Filter List method

  • January 8, 2020
  • 5 replies
  • 364 views
  • Translate

Forum|alt.badge.img+6
  • Rookie
  • 38 replies

I am exploring the OData API to query system Smartobjects. 

 

For example /api/odata/v3/com_K2_System_Workflow_SmartObject_ProcSetPermissions needs a query parameter to indicate the ProcessSetID. 

 

What is the syntax to construct the URL for this? I tried a few things from the OData documentation but they all throw a HTTP 404 in the browser indicating that the URL is malformed.

 

Help? Thanks

Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+7

Forum|alt.badge.img+6
  • Author
  • Rookie
  • 38 replies
  • January 8, 2020

Yes, I reviewed all that. The configuration is not my question, the syntax/usage is. I am unable to find any examples of using OData to execute List methods on K2 system smartobjects. Thanks

Translate

Forum|alt.badge.img+6

Hello  @VA1 ,


 


For a simple XML response from the list method of a particular SmartObject that is exposed through the OData API, you can just append the <atom:title> value for that SmartObject (e.g., I have a SmO named 'required' that is exposed through the OData API, with an <atom:title> value of 'requireds'. If I navigate to https://k2.denallix.com/api/odata/v3/requireds it will return XML of all values as if I were executing the 'Get List' method of the SmO).


 


Can you provide more information on how you are trying to consume data from the API?


 


Cheers,


qT


 


 


K2 will not accept any liability for any issues arising from actions taken in respect of information provided by any forum member.
Translate

Forum|alt.badge.img+6
  • Author
  • Rookie
  • 38 replies
  • January 8, 2020

I am not sure yet, I am just starting off by exploring the system data available in the com_k2_ set of smartobjects.

 

See attached. All I am trying to do is simulate what the Management site does in my screenshot i.e. run the List method for the SMO with a specific ProcSetID parameter


Translate

  • Rookie
  • 13 replies
  • February 20, 2020

Hi VA1,

 

Have a look at the Odata documentation site

http://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol

and see an example of using a filter (see section 10.2.3.1)

 

I tried this with one of my own SmartObjects (AMSA_EMP) and viola! could filter it to a single record:

http://k2dev.server.com/api/odata/v3/AMSA_EMP?$filter=EMPNO eq '10018993' 

Result:

{
  "odata.count""1",
  "value": [
    {
      "EMPNO""10018993",
      "REPORTTO""3783382", ...
 
Another operator syntax to remember - very simlar to PowerShell...
 

I also tried this one - and it returned the top 10 records:

http://k2dev.server.com/api/odata/v3/AMSA_EMP?$top=10

 

You can also have a look at https://www.odata.org/documentation/odata-version-3-0/url-conventions/

 

It opens another rabbit-hole...

Bennie

 

 

 

 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings