R
R
Roman2019-06-18 07:52:28
RESTful API
Roman, 2019-06-18 07:52:28

How to specify the deadline in the Bitrix24 task via rest?

Hello.
I'm now setting up automatic creation of a task through rest.
Everything works, the task is created, but there is one catch - I don’t know how to set the deadline ((
Below is an example of an array of data that is sent when calling the rest method tasks.task.add:

$taskParams = [
        'fields' => [
            'TITLE' => $TITLE, // название задачи
            'ALLOW_TIME_TRACKING' => 'Y', // включить учёт времени
            'ALLOW_CHANGE_DEADLINE' => 'N', // разрешить ответственному менять сроки
            'TASK_CONTROL' => 'Y', // принять после завершения
            'RESPONSIBLE_ID' => $ID, // ответственный
            'DESCRIPTION' => $desc, // описание
            'UF_CRM_TASK' => [$UF_CRM_TASK],
            'ADD_IN_REPORT' => 'Y',           
        ]
    ];

The parameter is responsible for the deadline DEADLINE, which is written in the ISO 8601 format (for example, 2019-06-18T01:43:46+03:00 ). And here's how to add 1-2 days to it, I can't figure it out.
So I'll be grateful for any hints.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Gololobov, 2019-06-18
@dGololobov

Here is a help for working with date in php

D
Danil K., 2020-03-03
@Danya_Violet

deadline = str(date.today() + timedelta(days=3)) + 'T14:55:00+03:00'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question