APIs & Integrations

abrkhan
Member

Adding Type (Email) to an Engagement Task via HUBSPPOT API

SOLVE

 

I would like to add a type (like Email) to a hubspot engagement task via hubspot API, however there is no clear way of doing this via API

 

On the other hand the UI has an option.

 

Any suggestions on how I can do this through the API would be really appreciated !

 

Many thanks

 

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Adding Type (Email) to an Engagement Task via HUBSPPOT API

SOLVE

Hi @abrkhan,

 

When looking to create a task with email type engagement using the Create an Engagement | Engagements API, you can do so by adding the taskType key under metadata. Example below:

 

For EMAIL task type:

{
    "engagement": {
        "active": true,
        "ownerId": {{owner id}},
        "type": "TASK",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
        "body": "via api",
"taskType": "EMAIL",
"subject":"this is an email task type"
    }
}

 

For CALL task type:

{
    "engagement": {
        "active": true,
        "ownerId": {{owner id}},
        "type": "TASK",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
        "body": "via api",
"taskType": "CALL",
"subject":"this is an CALL task type"
    }
}

 

For TODO task type:

{
    "engagement": {
        "active": true,
        "ownerId": {{owner id}},
        "type": "TASK",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
        "body": "via api",
"taskType": "TODO",
"subject":"this is an TODO task type"
    }
}

View solution in original post

0 Upvotes
2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Adding Type (Email) to an Engagement Task via HUBSPPOT API

SOLVE

Hi @abrkhan,

 

When looking to create a task with email type engagement using the Create an Engagement | Engagements API, you can do so by adding the taskType key under metadata. Example below:

 

For EMAIL task type:

{
    "engagement": {
        "active": true,
        "ownerId": {{owner id}},
        "type": "TASK",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
        "body": "via api",
"taskType": "EMAIL",
"subject":"this is an email task type"
    }
}

 

For CALL task type:

{
    "engagement": {
        "active": true,
        "ownerId": {{owner id}},
        "type": "TASK",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
        "body": "via api",
"taskType": "CALL",
"subject":"this is an CALL task type"
    }
}

 

For TODO task type:

{
    "engagement": {
        "active": true,
        "ownerId": {{owner id}},
        "type": "TASK",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
    "metadata": {
        "body": "via api",
"taskType": "TODO",
"subject":"this is an TODO task type"
    }
}
0 Upvotes
abrkhan
Member

Adding Type (Email) to an Engagement Task via HUBSPPOT API

SOLVE

Many thanks , this is really helpful - spend a lot of time tring to figure !

0 Upvotes