A
A
algrandeth2022-01-11 10:40:36
API
algrandeth, 2022-01-11 10:40:36

Why does AmoCRM incorrectly accept the date?

I send the following JSON to amoCRM.

[
  {
    "id": 53814890,
    "custom_fields_values": [
      {
        "field_id": 1961338,
        "values": [
          {
            "value": "testURL"
          }
        ]
      },
      {
        "field_id": 1961340,
        "values": [
          {
            "value": 0
          }
        ]
      },
      {
        "field_id": 1961358,
        "values": [
          {
            "value": 1641896887
          }
        ]
      }
    ]
  }
]


All fields are saved, everything is ok. In addition to the field with the date - 1961358.
In the response for this transaction, I get the following:
{
                        "field_id": 1961358,
                        "field_name": "Дата последнего изменения любого из вышеописанных атрибутов по кабинету",
                        "field_code": null,
                        "field_type": "date",
                        "values": [
                            {
                                "value": 1641848400
                            }
                        ]
                    }


1641848400. Where does this date come from if I pass 1641896887? data type - unix timestamp to long

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Chmykh, 2022-01-11
@algrandeth

You have a Date field type - amoCRM cuts off extra seconds, that is, you pass 01/11/2022, 13:28:07, and amo leaves 01/11/2022, 00:00:00

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question