Create TASK engagement with due date and reminder via API

engagements

#1

My requirement here is create a task engagement with due date and custom reminders.

EX:
Due Date => 3 days from current date
Reminder Date => 1 day from current date

I have checked http://developers.hubspot.com/docs/methods/engagements/create_engagement documentation. May I know whether API have that feasibility, if yes what is data structure format.

Thanks,
Dhams


#2

Hi @Dhamsoft

You can create a reminder by including the "reminders" property in the metadata for the engagement. This example would create a reminger at March 2nd, 2017 11:45:00 AM EST:

"metadata": {
    "body": "<p>Meeting Description</p>",
    "status": "NOT_STARTED",
    "subject": "Meeting Title",
    "taskType": "CALL",
    "reminders": [
      1488473100000
    ],
    "sendDefaultReminder": true
  }

#3

Thank you for this information, is there a way to set the due date as per Dhamsoft's question?

Regards,
Warren


#4

Hi @warrenei,

The due date of a task is the timestamp field in the engagement body. Here's an example POST body for a task due on March 8th:

{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "TASK",
        "timestamp": ((due date)) /* Here's the timestamp of the task's due date */
    },
    "associations": {
        "contactIds": [12345],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
    "body": "This is the body of the task.",
    "subject": "This is the subject like of the task",
    "status": "NOT_STARTED",
    "forObjectType": "CONTACT"
  }
}