APIs & Integrations

sandy_ptc
Member

Workflow api is returing campaignIds which are deleted

Hi

 

I am using the workflows api to get a list of email campaign ids by calling the below url :

https://api.hubapi.com/automation/v3/workflows/{workflow-id}

 

When I using the emailcampaignids to get details by calling the below URL :

 

https://api.hubapi.com/email/public/v1/campaigns/{emailcampaignid}

 

i am getting error that campaingn id is not valid.

0 Upvotes
1 Reply 1
KhushbooP11
Participant

Workflow api is returing campaignIds which are deleted

Hi @sandy_ptc,

 

Steps to solve, 

1. Ensure that the email campaigns you're querying are active and published. If they have been deleted, they won’t return valid results.

2. Use additional filters or logic in your code to exclude campaign IDs that may no longer be valid. You could maintain a local cache of valid campaign IDs to cross-check.

3. If you suspect a data sync issue, try to re-fetch the workflow data after a short period. It could help ensure that you have the latest information.

4. Implement error handling in your code to gracefully handle cases where the campaign ID is invalid, such as logging the error or skipping those IDs.


5. If the issue persists, it might be a bug or limitation in the API. Reach out to HubSpot support with details of the API response and the invalid IDs.


Quick fix - Periodically update your list of valid campaign IDs by rerunning the Workflow API call and cross-checking for updates or deletions.

I hope it helps, let me know if you need to talk!

Khushboo Pokhriyal

Growth & Operations

GroRapid Labs

LinkedIn | 9315044754 | Email | Website

0 Upvotes