API POST to create new row on UD table

I am attempting to use the rest api and a POST call to create a new row on UD02 ud table. I have been able to do this with other tables, but any combination of fields that I use in swagger UI returns “unable to deserialize entity” code 400 Bad Request.

Can anybody provide me a BARE MINIMUM json with as few fields as necessary to create 1 row of data through the api. I can update the company field with my company id and then I will add in the fields I want to use one at a time once I can get that working. Thanks.

This JSON works perfectly on UDXX.Update

{
  "ds": {
    "UD10": [
      {
        "Company": "C1",
        "Key1": "Data1",
        "Key2": "Data2",
        "Key3": "",
        "Key4": "",
        "Key5": "",
        "Character01": "Mooooo",
        "SysRowID": "00000000-0000-0000-0000-000000000000",
        "RowMod": "A"
      }
    ],
    "UD10Attch": [],
    "ExtensionTables": []
  }
}

:slight_smile:

You’re right that did work perfectly. Must have been my sysrowid or rowmod then. Thanks!

Maybe… the odata endpoints can be a right anus!!

Oh one of my coworkers pointed out that RowMod is expecting A, U, or D for Add Update Delete. On the json template Swagger UI provides it defaults in as “string” so that was probably what was causing my error specifically. Might be useful information for anybody that stumbles on this post later.

And also if you have a UD field on your table that is a numeric, the Swagger UI loads it in as “Int Field Name: 0” in the JSON template, but the call will return a 400 error unless you make your 0 a string like “0”. Looking back this was likely the actual cause of my 400 error from original post.