HubSpot Ideas

DSapphire

How we set Task Due Date & Time of TASK using API in C#

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
//}
}
});

0 Me gusta