We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
I'm using an API to generate contacts and tasks for those contacts.
I need that task's due date and time to be specified.
All references I've found for the due date mention using the timestamp property, however this has never worked. The reminder due date is set, but in the same manner. Unset due date and time.
Reminder set using this --> DateTimeOffset.Now.AddDays(5).ToUnixTimeMilliseconds()
how we set Due Date &Time ???
api.Engagement.Create(new EngagementHubSpotModel()
{
Engagement = new EngagementHubSpotEngagementModel()
{
Type = "TASK",//used for file attachments
OwnerId = TaskOwnerId
},
Metadata = new
{
body = TaskBody,
subject = TaskSubject,
status = "NOT_STARTED",
taskType = "CALL",
priority = "MEDIUM",
timestamp = DateTimeOffset.Now.AddDays(5).ToUnixTimeMilliseconds(),
sendDefaultReminder = true,
reminders = DateTimeOffset.Now.AddDays(4).ToUnixTimeMilliseconds()
},
Associations = new EngagementHubSpotAssociationsModel()
{
ContactIds = new List<long>() { 3351 } //use the ID of the created contact from above contact.Id.Value
},
Attachments = new List<EngagementHubSpotAttachmentModel>()
{
//new EngagementHubSpotAttachmentModel()
//{
// Id = fileId
//}
}
});