APIs & Integrations

VroomlyTeam
Participant

How to export a tasks view filtered on queues, including associated contact's phone number

SOLVE

I created (through the UI) a tasks view showing tasks that are in a queue and added the associated contact's phone number as colon.

 

Threfore, I have a list af tasks belonging to a certain queue and their associated contact's phone number :

VroomlyTeam_0-1725532788065.png

 

 

While I am able to export this view in the UI, I can not find a way to do so via the API.


I would like to export this view through API. I manage to create an export of all tasks but I don't manage to :

- filter theses tasks on queue
- add the assiciated contact's phone number as a colon on the export

 

It thiis possible through the API?

 

Thank you

0 Upvotes
1 Accepted solution
VroomlyTeam
Solution
Participant

How to export a tasks view filtered on queues, including associated contact's phone number

SOLVE

I managed to get what I needed by doing this :

 

1. Get the view of task filtered on queue, on associated contact's ID :

{
    "exportType": "VIEW",
    "format": "CSV",
    "exportName": "my_beautiful_export",
    "objectProperties": [
        "hs_unique_id",
        "hs_task_subject",
        "hubspot_owner_id",
        "hs_task_status"
    ],
    "language": "FR",
    "objectType": "TASKS",
    "associatedObjectType": "CONTACT",
    "publicCrmSearchRequest": {
        "filters": [
                {
                    "propertyName": "hs_task_status",
                    "operator": "EQ",
                    "value": "NOT_STARTED"
                },
                {
                    "propertyName": "hs_queue_membership_ids",
                    "operator": "EQ",
                    "value": "7691325"
                }
        ]
    }
}



2. Get contact's phone number :

https://api.hubapi.com/crm/v3/objects/contacts/{contact_id}?properties=phone&archived=false


3. Combined those in a pandas dataframe (Python)

View solution in original post

0 Upvotes
1 Reply 1
VroomlyTeam
Solution
Participant

How to export a tasks view filtered on queues, including associated contact's phone number

SOLVE

I managed to get what I needed by doing this :

 

1. Get the view of task filtered on queue, on associated contact's ID :

{
    "exportType": "VIEW",
    "format": "CSV",
    "exportName": "my_beautiful_export",
    "objectProperties": [
        "hs_unique_id",
        "hs_task_subject",
        "hubspot_owner_id",
        "hs_task_status"
    ],
    "language": "FR",
    "objectType": "TASKS",
    "associatedObjectType": "CONTACT",
    "publicCrmSearchRequest": {
        "filters": [
                {
                    "propertyName": "hs_task_status",
                    "operator": "EQ",
                    "value": "NOT_STARTED"
                },
                {
                    "propertyName": "hs_queue_membership_ids",
                    "operator": "EQ",
                    "value": "7691325"
                }
        ]
    }
}



2. Get contact's phone number :

https://api.hubapi.com/crm/v3/objects/contacts/{contact_id}?properties=phone&archived=false


3. Combined those in a pandas dataframe (Python)

0 Upvotes