APIs & Integrations

teja21
Contributor

Not able to get Custom Date reminder in API

SOLVE

Hey there, I have set the reminder for Custom Date in Task as shown in below screenshot: 

teja21_1-1725873384938.png

But in API, I cannot find any such date for reminder. Check below screenshot of API response:

teja21_2-1725873461515.png

Can anybody please suggest how can I get the custom date reminder in Task API?

Also for the At task due time reminder, it provides an empty/null values in relative reminder check below screenshot:

teja21_3-1725873631283.png

 

 

0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

Not able to get Custom Date reminder in API

SOLVE

Hey, @teja21 👋 Thanks for your question. I fell like there is some slight confusion about the expected response here. The documentation doesn't explicitly break this out for us, and I'll do my best.

 

  • Looking at your example, you created a task that doesn't repeat. Therefore, you will not get a value for `hs_task_relative_reminders`
  • Your task has a custom date reminder (which you stated in your post), but the property`hs_task_reminders` only returns the value in Unix timestamp in milliseconds. I can see in your screenshot, this format is what was returned in the response for `hs_task_reminders` — Link to source
  • If you want to have a value for `hs_task_relative_reminders` you have to create a task that repeats and doesn't have a custom reminder date (screenshot)
    CleanShot 2024-09-09 at 15.12.02@2x.png

I created two tasks and made two requests (one for each) and I got back the expected response. Please note that the `hs_task_relative_reminders` property is a "fieldType": "text" and doesn't return a date, but instead returns information about the interval between notifications. 

 

Example 1:

task-test2.png

Request

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/tasks/59916639002?properties=hs_task_relative_reminders%2Chs_task_reminders&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

Response

HTTP 200

{
  "id": "59916639002",
  "properties": {
    "hs_createdate": "2024-09-09T20:53:11.590Z",
    "hs_lastmodifieddate": "2024-09-09T20:53:12.460Z",
    "hs_object_id": "59916639002",
    "hs_task_relative_reminders": "[]",
    "hs_task_reminders": "1725980400000"
  },
  "createdAt": "2024-09-09T20:53:11.590Z",
  "updatedAt": "2024-09-09T20:53:12.460Z",
  "archived": false
}

 

Example 2: 

taks-test-3.png

Request

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/tasks/59915966487?properties=hs_task_relative_reminders%2Chs_task_reminders&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

Response

HTTP 200

{
  "id": "59915966487",
  "properties": {
    "hs_createdate": "2024-09-09T21:01:15.977Z",
    "hs_lastmodifieddate": "2024-09-09T21:01:18.899Z",
    "hs_object_id": "59915966487",
    "hs_task_relative_reminders": "[{\"unit\":\"HOURS\",\"count\":1,\"hour\":null,\"minute\":null}]",
    "hs_task_reminders": "1726059600000"
  },
  "createdAt": "2024-09-09T21:01:15.977Z",
  "updatedAt": "2024-09-09T21:01:18.899Z",
  "archived": false
}

 

I hope this helps get you moving forward! 

 

Have fun testing! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

View solution in original post

1 Reply 1
Jaycee_Lewis
Solution
Community Manager
Community Manager

Not able to get Custom Date reminder in API

SOLVE

Hey, @teja21 👋 Thanks for your question. I fell like there is some slight confusion about the expected response here. The documentation doesn't explicitly break this out for us, and I'll do my best.

 

  • Looking at your example, you created a task that doesn't repeat. Therefore, you will not get a value for `hs_task_relative_reminders`
  • Your task has a custom date reminder (which you stated in your post), but the property`hs_task_reminders` only returns the value in Unix timestamp in milliseconds. I can see in your screenshot, this format is what was returned in the response for `hs_task_reminders` — Link to source
  • If you want to have a value for `hs_task_relative_reminders` you have to create a task that repeats and doesn't have a custom reminder date (screenshot)
    CleanShot 2024-09-09 at 15.12.02@2x.png

I created two tasks and made two requests (one for each) and I got back the expected response. Please note that the `hs_task_relative_reminders` property is a "fieldType": "text" and doesn't return a date, but instead returns information about the interval between notifications. 

 

Example 1:

task-test2.png

Request

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/tasks/59916639002?properties=hs_task_relative_reminders%2Chs_task_reminders&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

Response

HTTP 200

{
  "id": "59916639002",
  "properties": {
    "hs_createdate": "2024-09-09T20:53:11.590Z",
    "hs_lastmodifieddate": "2024-09-09T20:53:12.460Z",
    "hs_object_id": "59916639002",
    "hs_task_relative_reminders": "[]",
    "hs_task_reminders": "1725980400000"
  },
  "createdAt": "2024-09-09T20:53:11.590Z",
  "updatedAt": "2024-09-09T20:53:12.460Z",
  "archived": false
}

 

Example 2: 

taks-test-3.png

Request

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/tasks/59915966487?properties=hs_task_relative_reminders%2Chs_task_reminders&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

Response

HTTP 200

{
  "id": "59915966487",
  "properties": {
    "hs_createdate": "2024-09-09T21:01:15.977Z",
    "hs_lastmodifieddate": "2024-09-09T21:01:18.899Z",
    "hs_object_id": "59915966487",
    "hs_task_relative_reminders": "[{\"unit\":\"HOURS\",\"count\":1,\"hour\":null,\"minute\":null}]",
    "hs_task_reminders": "1726059600000"
  },
  "createdAt": "2024-09-09T21:01:15.977Z",
  "updatedAt": "2024-09-09T21:01:18.899Z",
  "archived": false
}

 

I hope this helps get you moving forward! 

 

Have fun testing! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot