We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

DatataseTable Agent InsertRow - How to insert a DataTime when using a JSON body

Hi,

I am calling the following Rest Endpoint: /api/v1/Agents/DatabaseTable/InsertRow and trying to insert a row into a table with a DateTime column.

I am using the following JSON body, but get the following error:

Here is the class I am serialising:

public class RestAPITest : CSTable
{

   public Int32 x_superofficecompany { get; set; }
   public Int32 x_superofficecontactid { get; set; }
   public String x_longtext { get; set; }

   // [JsonConverter(typeof(DateFormatConverter), "yyyy-MM-ddThh:mm:ss")]
   public System.DateTime x_datetime { get; set; }

   public float x_float { get; set; }
   public Boolean x_boolean { get; set; }
}

How should I specify the DateTime field in the JSON as it will always serealise a DateTime object to a string? I have tried several different formats but with no success.

Or is it a case of having to use XML instead?

Cheers

Rich

 

 

RE: DatataseTable Agent InsertRow - How to insert a DataTime when using a JSON body

Hello Rich,

See my response in this thread.

Von: David Hollegien 20. Jan 2020

RE: DatataseTable Agent InsertRow - How to insert a DataTime when using a JSON body

David,

Perfect, that has worked a treat - Many Thanks!

Cheers

Rich

 

Von: Rich Hacker 20. Jan 2020