Rest API - Pass parameters

I wanted to make this as broad a title as possible. I'm shocked I can't find anything on this. I don't want to use the ID. Seems everything is bound to ID.

I just want to simply know, without use of ID, how a method can consume arguments? How to pass/use arguments?

My particular use case is one to squash annoyance. I think many, if not all, Item Types should have Auto-Search set to true. I find it silly UX to go to, "Search 'Some Item Type'" and then need to click search. So, I'm finding I need to navigate to the IT definition and check the box and save the edit.

I just want to use PostMan to pass an ItemType by name. I don't know how to do that or extrract that from the call.

I want to pass the IT name. So, something like this for the IT "Method":

{{base_url}}{{version}}/server/odata/method._Set_Auto_Search_True('method')

But, how? Hmmm. Maybe a where clause somehow?

.../odata/ItemType?$filter=name eq 'method'

Anyway, any help passing other-than-id params to a function would be great!

Parents Reply Children
  • 0 オフライン in reply to AngelaIp

    I want to use REST because it is so much faster, even on localhost. I don't know why and have posted about this before; well, I commented on a post where somebody has the same problem. It takes a minimum of 30 seconds to login. It takes the same to save a function. The post you pointed me to gave me what I needed. It all boils down to using POST with JSON and `this.getProperty("prop_name", "default_value")` to get the property. I've only done a proof of concept using strings. It would be so nice if this supported server side JS. But, yeah: this.getProperty("prop") was the key to moving forward. I just wanted to know how for future ops as well - especially setup for automation testing.


    /* 1st form
    var inn = this.getInnovator();
    return inn.newResult("Hello World");
    */
    // 2nd form - this.getProperty can get from a JSON property passed into call.
    Innovator inn = this.getInnovator();
    string to = this.getProperty("hello_to", "World"); // default to "World"
    return inn.newResult("Hello " + to + "!");
    
  • 0 オフライン in reply to AngelaIp

    I would like to make ItemType autosearch, but cannot - even as admin. I guess I need to go directly to the DB?