Filter datA fields with an API ?

Options

HI, i am searching for a way to shrink the result of the sort field!

It could be similar to this topic. But i am not sure because we are using different API`s.


My target: I am searching for an easy way to filter the JSON response via adding a field which

As example, i am searching only for the name. But i got all the information containing data as result.

This would be perfect:

{
   "name": "This is my filename (100022)"
}


My call:

https://my.content.server/OTCS/cs.exe/api/v1/nodes/17543158/nodes?fields=data

Part of the response:

{
   "data": [{
       "volume_id": -2000,
       "id": 17543159,
       "parent_id": 17543158,
       "user_id": 1000,
       "name": "This is my filename (100022)",
       "type": 144,
       "description": "",
       "create_date": "2020-12-04T08:35:00Z",
       "create_user_id": 1000,
       "modify_date": "2020-12-04T08:35:00Z",
       "modify_user_id": 1000,
       "reserved": false,
       "reserved_user_id": 0,
       "reserved_date": null
   }]
}

Any idea how i can achieve the a result like this with an additional parameter with a REST call?

I tried it with different combinations but nothing is really what i am looking for.

Some tests:

https://my.server.name/OTCS/cs.exe/api/v2/nodes/17543158/nodes?fields=data{id,name}
https://my.server.name/OTCS/cs.exe/api/v2/nodes/17543158/nodes?fields=data{id,name}

Or return more or less empty values. Doest anybody have an idea?

All the best and have a wonderful evening.

Christian

Comments

  • Karen Weir
    Options

    Hi @Mchoeti , have you figured this out or is it still open for discussion?

  • @Karen Weir thanks for the reminder. Here is the solution which was working for me.


    GET Call:

    /api/v2/nodes/13604312/nodes?where_name=100022&fields=properties{container,create_date,id,name}

    Result:

     results: [
       {
          "data":{
             "amcsproxy":{
                "commands":[
                   
                ]
             },
             "properties":{
                "container":true,
                "create_date":"2020-12-04T08:35:00Z",
                "id":17543158,
                "name":"100022"
             }
          }
       }
    ]
    

    Thanks for asking. I hope it helps other people. Have a wonderful start in the morning

    Cheer Christian