REST Updating Part with a "/" in PartNum

I’m trying to update a field for a part. The issue is that using PATCH doesn’t work since the part number has a “/”. Encoding the “/” doesn’t seem to work since the URL has a / either way, so I tried using POST and the custom UpdateExt, both return the same error.
Here’s my request body (EDITED because I only included the “Part”: contents previously):

{
    "ds": {
        "Part": [
            {
                "PartNum": "PART",
                "ShopifyID": "",
                "RowMod": "U"
            }
        ]
    }
}

Here’s the error response:

{
  "HttpStatus": 400,
  "ReasonPhrase": "REST API Exception",
  "ErrorMessage": "Part Number already exists.",
  "ErrorType": "Ice.BLException",
  "ErrorDetails": [
    {
      "Message": "Part Number already exists.",
      "Type": "Error",
      "Table": "Part",
      "Field": "PartNum",
      "Program": "Erp.Services.BO.Part.dll",
      "Method": "ChangePartNum",
      "ColumnNumber": 17,
      "LineNumber": 2227
    }
  ],
  "CorrelationId": "592d8a25-6ca6-4d4a-88b6-cd7a50860bd1"
}

I’m not super familiar with UpdateExt and would appreciate feedback.

1 Like

Does the new PartNum exist already? The error message is saying it does…

Yes it exists, I’m trying to update an existing record. I recall using UpdateExt for another BO in the past for an update, but I’m not sure which.
My (limited) understanding was that the RowMod handled whether the call was for adding, updating, removing, etc.

Your request body is wrong for UpdateExt.

Should be more like this:

{
    "ds": {
        "Part": [
            {
                "Company": "YourCompany",
                "PartNum": "PART",
                "ShopifyID": "",
                "RowMod": "U"
            }
        ]
    }
}
1 Like

Holy crap what a brain lag moment. I literally have the company in my Python code but not in the Swagger UI… thanks Kevin.

1 Like