APIs & Integrations

ztesting
Member

api endpoint to find a live agent is online or offline in the crm tool?

SOLVE

I am unable to find out weather a live agent is online or offline and also i want to find out the working hours set for each live agent. how do i achieve this using api endpoint ? 

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Top Contributor

api endpoint to find a live agent is online or offline in the crm tool?

SOLVE

Hi @ztesting 👋

 

You can retrieve this information via HubSpot's Users API. For example: 

 

GET https://api.hubapi.com/crm/v3/objects/users/?properties=hs_availability_status,hs_working_hours,hubspot_owner_id,hs_internal_user_id,hs_standard_time_zone,hs_timezone_auto_update_enabled

 

Example response body:

 

{
    "results": [
        {
            "id": "101010101",
            "properties": {
                "hs_availability_status": "available",
                "hs_createdate": "2022-01-06T17:06:01.486Z",
                "hs_internal_user_id": "22558899",
                "hs_lastmodifieddate": "2024-07-16T04:51:26.719Z",
                "hs_object_id": "33669988",
                "hs_standard_time_zone": null,
                "hs_timezone_auto_update_enabled": "true",
                "hs_working_hours": null,
                "hubspot_owner_id": "77441122"
            },
            "createdAt": "2022-01-06T17:06:01.486Z",
            "updatedAt": "2024-07-16T04:51:26.719Z",
            "archived": false
        },
        {
            "id": "3322116655",
            "properties": {
                "hs_availability_status": null,
                "hs_createdate": "2022-10-13T06:25:46.817Z",
                "hs_internal_user_id": "123454321",
                "hs_lastmodifieddate": "2024-07-16T04:51:26.719Z",
                "hs_object_id": "99885566",
                "hs_standard_time_zone": null,
                "hs_timezone_auto_update_enabled": "true",
                "hs_working_hours": null,
                "hubspot_owner_id": "88552233"
            },
            "createdAt": "2022-10-13T06:25:46.817Z",
            "updatedAt": "2024-07-16T04:51:26.719Z",
            "archived": false
        },
        {
            "id": "123456789",
            "properties": {
                "hs_availability_status": "away",
                "hs_createdate": "2023-07-20T03:48:19.588Z",
                "hs_internal_user_id": "987654321",
                "hs_lastmodifieddate": "2024-10-29T22:50:18.193Z",
                "hs_object_id": "1122334455",
                "hs_standard_time_zone": "Australia/Brisbane",
                "hs_timezone_auto_update_enabled": "true",
                "hs_working_hours": "[{\"days\":\"MONDAY_TO_FRIDAY\",\"startMinute\":540,\"endMinute\":960}]",
                "hubspot_owner_id": "5544332211"
            },
            "createdAt": "2023-07-20T03:48:19.588Z",
            "updatedAt": "2024-10-29T22:50:18.193Z",
            "archived": false
        }
    ]
}

 

To identify additional User properties that you can retrieve from the above endpoint, consider using HubSpot's CRM Properties endpoint, (i.e. GET https://api.hubapi.com/crm/v3/properties/USERS). 

 

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

0 Upvotes
2 Replies 2
zach_threadint
Solution
Top Contributor

api endpoint to find a live agent is online or offline in the crm tool?

SOLVE

Hi @ztesting 👋

 

You can retrieve this information via HubSpot's Users API. For example: 

 

GET https://api.hubapi.com/crm/v3/objects/users/?properties=hs_availability_status,hs_working_hours,hubspot_owner_id,hs_internal_user_id,hs_standard_time_zone,hs_timezone_auto_update_enabled

 

Example response body:

 

{
    "results": [
        {
            "id": "101010101",
            "properties": {
                "hs_availability_status": "available",
                "hs_createdate": "2022-01-06T17:06:01.486Z",
                "hs_internal_user_id": "22558899",
                "hs_lastmodifieddate": "2024-07-16T04:51:26.719Z",
                "hs_object_id": "33669988",
                "hs_standard_time_zone": null,
                "hs_timezone_auto_update_enabled": "true",
                "hs_working_hours": null,
                "hubspot_owner_id": "77441122"
            },
            "createdAt": "2022-01-06T17:06:01.486Z",
            "updatedAt": "2024-07-16T04:51:26.719Z",
            "archived": false
        },
        {
            "id": "3322116655",
            "properties": {
                "hs_availability_status": null,
                "hs_createdate": "2022-10-13T06:25:46.817Z",
                "hs_internal_user_id": "123454321",
                "hs_lastmodifieddate": "2024-07-16T04:51:26.719Z",
                "hs_object_id": "99885566",
                "hs_standard_time_zone": null,
                "hs_timezone_auto_update_enabled": "true",
                "hs_working_hours": null,
                "hubspot_owner_id": "88552233"
            },
            "createdAt": "2022-10-13T06:25:46.817Z",
            "updatedAt": "2024-07-16T04:51:26.719Z",
            "archived": false
        },
        {
            "id": "123456789",
            "properties": {
                "hs_availability_status": "away",
                "hs_createdate": "2023-07-20T03:48:19.588Z",
                "hs_internal_user_id": "987654321",
                "hs_lastmodifieddate": "2024-10-29T22:50:18.193Z",
                "hs_object_id": "1122334455",
                "hs_standard_time_zone": "Australia/Brisbane",
                "hs_timezone_auto_update_enabled": "true",
                "hs_working_hours": "[{\"days\":\"MONDAY_TO_FRIDAY\",\"startMinute\":540,\"endMinute\":960}]",
                "hubspot_owner_id": "5544332211"
            },
            "createdAt": "2023-07-20T03:48:19.588Z",
            "updatedAt": "2024-10-29T22:50:18.193Z",
            "archived": false
        }
    ]
}

 

To identify additional User properties that you can retrieve from the above endpoint, consider using HubSpot's CRM Properties endpoint, (i.e. GET https://api.hubapi.com/crm/v3/properties/USERS). 

 

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
BérangèreL
Community Manager
Community Manager

api endpoint to find a live agent is online or offline in the crm tool?

SOLVE

Hi @ztesting and welcome to the Community!
It's a pleasure to have you here!

Great question, thanks for asking!

First, I'd like to share these resources that might be of interest:

- Conversations inbox and messages APIs (BETA)
- Conversations API Overview

I'd love to put you in touch with some of our Top Experts: Hi @zach_threadint, @HubSpot_Corey and @Teun do you have suggestions to help @ztesting, please?

Thanks a lot and have a great day!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


0 Upvotes