APIs & Integrations

Hima
Participant

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Which auth scope do I need to call /email/public/v1/campaigns/by-id ?

The API call returns "does not have proper permissions! (requires any of [email-access])"

I don't see an email-access option in the app's auth config screen. Tried transactional email sope. However the sandbox portal claims to not have that feature.

Thanks!

0 Upvotes
1 Accepted solution
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Hi @Hima, happy to help here! For proper permissions for Marketing Emails, you'll need to give the Application scopes for "Content", which includes Marketing Emails, Sites, Blog, Campaigns and CTA's. If you've already done so, would you then mind sending me your Application ID, and the portal that you're looking to GET all campaigns by ID from?

View solution in original post

0 Upvotes
8 Replies 8
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Hi @Hima, happy to help here! For proper permissions for Marketing Emails, you'll need to give the Application scopes for "Content", which includes Marketing Emails, Sites, Blog, Campaigns and CTA's. If you've already done so, would you then mind sending me your Application ID, and the portal that you're looking to GET all campaigns by ID from?

0 Upvotes
Hima
Participant

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Thank you Connor. That was it. It would be helpful if you guys list the required scope under the method details section for each endpoint on its details page.

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Hi @Hima, thank you for the suggestion. We will be doing an audit of all docs soon, so we will certainly keep it in mind :slight_smile:

0 Upvotes
Hima
Participant

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Thank you @Connor_Barley. Can you please confirm that the startTimestamp filter for /email/public/v1/events endpoint is functional? It doesn't seem to change the results

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

@Hima, to confirm are you looking at the Event Creation Timestamp :created as the required parameter from here: https://developers.hubspot.com/docs/methods/email/get_event_by_id?

This filter should work. I've tested it out in my own portal and was able to get back the email event I was looking for. Make sure your timestamp is in milliseconds

0 Upvotes
Hima
Participant

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

@Connor_Barley, below is the method call.

https://api.hubapi.com/email/public/v1/events?campaignId=66200506&startTimestamp=1538069007&limit=10...

I'm sending the oAuth token in the header. Getting the same number of results immaterial of the startTimeStamp. Also, there are no events in the campaign after that time stamp. So, I'm expecting zero events.

Following the doc here: https://developers.hubspot.com/docs/methods/email/get_events

Thanks!

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Hey @Hima, your timestamp looks to be in seconds rather than milliseconds. You're likely starting from way back in time, so it's retrieving all campaigns. Let me know if changing your timestamp to milliseconds resolves it

0 Upvotes
Hima
Participant

Auth scope for /email/public/v1/campaigns/by-id?

SOLVE

Ugh. totally missed that one. Thanks!

0 Upvotes