What is equivalent to "SetAttribute" function in REST API?

We have several server methods which expects custom  attribute values using "getAttribute". While we can pass the property value in the API call, I am not sure how do we pass custom attribute values to the server method call??

Parents
  • Hello Sathish, If I understand your query properly, Passing the input value for your server method through API right, here is the sample

    I have a method called "addPart" with the below code

    Innovator inn=this.getInnovator();
    string itemnumber=this.getProperty("item_number");
    Item partItem=inn.newItem("Part","add");
    partItem.setProperty("item_number",itemnumber);
    Item result=partItem.apply();

    return this;

    and API call is 

    " your server url/ server/ odata/ method.addPart"

    body for the above call is

    {
    "@odata.type":"your server url/data/$metadata#Part",
    "item_number" : "EasePLM_Sunny_009"


    }

    Reading Itemnumber from the call and passing that to above method

     

Reply
  • Hello Sathish, If I understand your query properly, Passing the input value for your server method through API right, here is the sample

    I have a method called "addPart" with the below code

    Innovator inn=this.getInnovator();
    string itemnumber=this.getProperty("item_number");
    Item partItem=inn.newItem("Part","add");
    partItem.setProperty("item_number",itemnumber);
    Item result=partItem.apply();

    return this;

    and API call is 

    " your server url/ server/ odata/ method.addPart"

    body for the above call is

    {
    "@odata.type":"your server url/data/$metadata#Part",
    "item_number" : "EasePLM_Sunny_009"


    }

    Reading Itemnumber from the call and passing that to above method

     

Children