APIs & Integrations

Not applicable

Create TASK engagement with due date and reminder via API

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

0 Upvotes
5 Replies 5
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Create TASK engagement with due date and reminder via API

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"
  }
}
raihaniqbal
Participant

Create TASK engagement with due date and reminder via API

I'm setting the timestamp in milliseconds but it seems to be ignoring it and always sets it to the current date time.

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Create TASK engagement with due date and reminder via API

Hi, @raihaniqbal.

 

Can you provide an example request URL, payload, and the response from the Engagements API?

 

CC @Derek_Gervais

Isaac Takushi

Associate Certification Manager
0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Create TASK engagement with due date and reminder via API

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
  }
warrenei
Member

Create TASK engagement with due date and reminder via API

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

Regards,
Warren

0 Upvotes