Invalid request trying to PATCH Erp.BO.PartSvc

I’m using the API help/explorer and trying to test why my REST API call isn’t working.

https://$SERVER/$INSTANCE/api/help/v1/odata/Erp.BO.PartSvc/index#!/OData/updateExt_Part

No matter what I try (and I’ve tried including all fields, only field that changes, with and without RowMod=“U” and UD_SysRevID being absent or being the value returned by GetByID) I keep getting a 400 error:

{
  "odata.error": {
    "code": "",
    "message": {
      "lang": "en-US",
      "value": "The request is invalid."
    },
    "innererror": {
      "message": "patch : An error has occurred.\r\n",
      "type": "",
      "stacktrace": ""
    }
  }
}

Not exactly very descriptive in telling me what went wrong!

I’m using the exact format provided in the example, which appears to be the same as an element from “Part” as returned by GetByID. The example appears to list “0” for numeric types and “string” for string types, so I’m not exactly sure if I’m missing a specific value I need to have somewhere - I’m using RowMod=“U” although I have also tried omitting it completely and setting it to the empty string.

Have you been able to get the call to work to update anything part related? Can you post a screen shot of your parameters you’re trying?

No, I haven’t been able to get anything to update through the API. Here’s a screenshot of one particular input:

Here’s another… the web page gets a little wonky when you resize the input and wouldn’t let me scroll left, but the start of the input is visible:

With the UpdateExt calls, you should only have to specify the fields you want to update (should). The “required inputs” (company and partnum text boxes) are the keys that will make sure the right thing gets updated. I would try getting any old update to go through and go from there. I was able to update a random part description with the following:

I also received an error message for this SAME exact call saying it needed a PartClass…sometimes it seems the API’s can be finicky. I refreshed the help page and it went through.

1 Like

Oh wow, you’re right… guess I had stuff it didn’t want. I guess this means that I also don’t need a corresponding call to retrieve the part info first just to set a checkbox. Thanks!

1 Like

Glad you got it working! That’s the nice thing about UpdateExt calls, as long as you have the keys you’re set!