APIs & Integrations

DSapphire
Membro

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

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 Avaliação positiva
4 Respostas 4
DSapphire
Membro

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

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

0 Avaliação positiva
Jaycee_Lewis
Gerente da Comunidade
Gerente da Comunidade

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

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

 

Thank you for taking a look! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Avaliação positiva
DSapphire
Membro

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

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-A...


We eagerly await your thoughtful response and solutions.

0 Avaliação positiva
DSapphire
Membro

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

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.

0 Avaliação positiva