# How we set Task Due Date & Time using TASK API in C#, Please read below description

**URL:** <https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129>\
**Category:** APIs & Integrations\
**Created:** [August 31, 2022, 4:30am UTC](https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129 "2022-08-31T04:30:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSapphire](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@DSapphire](https://community.hubspot.com/u/DSapphire)\
**Post date:** [August 31, 2022, 4:30am UTC](https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129/1 "2022-08-31T04:30:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 1, 2022, 5:20pm UTC](https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129/2 "2022-09-01T17:20:38Z")

</div>

Hi, @DSapphire 👋 Thanks for providing your example. Hey, @JBeatty, do you have any experience here?

Thank you for taking a look! — Jaycee

---

<div class="post-metadata">

**Author:** ![DSapphire](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@DSapphire](https://community.hubspot.com/u/DSapphire)\
**Post date:** [September 12, 2022, 4:47am UTC](https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129/3 "2022-09-12T04:47:58Z")

</div>

Hello @Jaycee_Lewis, Thank you for your response, however we still don’t understand how to set the task’s due date and time via an API call.  
We eagerly await your thoughtful response and solutions.

---

<div class="post-metadata">

**Author:** ![DSapphire](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@DSapphire](https://community.hubspot.com/u/DSapphire)\
**Post date:** [September 21, 2022, 7:14am UTC](https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129/4 "2022-09-21T07:14:14Z")

</div>

Hello @Jaycee_Lewis,@JBeatty Thank you for your response, however we still don’t understand how to set the task’s due date and time via an API call.

-In all reference seen like dd timestame property in engangement but, in this class not feasible.

so , please suggest us.

Here, seen but not possible to do like this

[https://community.hubspot.com/t5/APIs-Integrations/Create-a-Task-and-set-Due-Date-with-Engagements-API/m-p/396261](https://community.hubspot.com/t5/APIs-Integrations/Create-a-Task-and-set-Due-Date-with-Engagements-API/m-p/396261)

We eagerly await your thoughtful response and solutions.

---

<div class="post-metadata">

**Author:** ![DSapphire](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@DSapphire](https://community.hubspot.com/u/DSapphire)\
**Post date:** [September 26, 2022, 6:00am UTC](https://community.hubspot.com/t/how-we-set-task-due-date-time-using-task-api-in-c-please-read-below-description/64129/5 "2022-09-26T06:00:37Z")

</div>

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 ???

[https://community.hubspot.com/t5/APIs-Integrations/How-we-set-Task-Due-Date-amp-Time-using-TASK-API-in-C-Please/m-p/687329#M56482](https://community.hubspot.com/t5/APIs-Integrations/How-we-set-Task-Due-Date-amp-Time-using-TASK-API-in-C-Please/m-p/687329#M56482)
