I’m glad to hear it’s working! I was incorrect in my example; the type should be TASK. I’ve corrected my previous post for posterity. Regarding your timestamp question; the timestamps are just in milliseconds, so you’re correct that it’s just a timestamp in seconds multiplied by 1000. I’m not very familiar with PHP, but this stack overflow topic I found seems to point to the microtime() method:
Times in HubSpot are formatted as millisecond unix timestamps, which is why the timestamp I included is 13 characters long. The developer doc below has some more info on that. The reminders array is just a field in the metadata, so you should be able to create a task engagement like this:
{
"engagement": {
"active": true,
"ownerId": 1,
"type": "TASK",
"timestamp": 1409172644778
},
"associations": {
"contactIds": [2],
"companyIds": [ ],
"dealIds": [ ],
"ownerIds": [ ]
},
"metadata": {
"body": "This is the body of the task.",
"subject": "Task title",
"status": "NOT_STARTED",
"reminders": [
1513018800000
]
}
}
Here’s the doc for creating an engagement, which is where I pulled this example JSON:
Hi @Derek_Gervais!
It works now. thank you for the support! 😃
One more thing how do you do the 13 numbers format? are you multiplying it in 1000?
One of the examples I have seen is “1513142777166”.
How can I convert that to date format?
@Derek_Gervais
why do you have 13 numbers of timestamp?
Can you also send the correct JSON or PHP array format to use and create a Task reminder to notify the owner through mobile?
Tasks are just engagements, so you’d still need to use the Engagements API. The engagement type would be TASK, and the doc below has details on the structure of task engagements:
It’s not currently possible to trigger in-app notifications based on @ mentions or assignments, but you might consider creating a task engagement and setting a date for the reminder; this will send an in app task notification and and email notification (depending on the user’s settings).
While it’s possible to create an @ mention in an engagement, the notification(s) that are sent for @ mentions are based on their creation in the UI. @ mentions created via the API will not trigger notifications, and therefore aren’t recommended.