Hola! ¡Tenemos nuestra Comunidad en Español!

Activity required from contacts Ask Nicely

SOLVE
Highlighted
New Contributor

I'm trying to get either the latest activity or all activity, I've checked my code with events middle REM URL so I know it's authenticating OK, but the results are empty any help would be great here, thanks!


'URL = "https://api.hubapi.com/engagements/v1/engagements/paged?hapikey=demo"
'URL = "https://api.hubapi.com/reports/v2/events?hapikey=demo"
URL = "https://api.hubapi.com/engagements/v1/engagements/recent/modified?hapikey=demo&count=100&count=100&o..."
response.Write URL
response.flush
Dim oXMLHTTP
Set oXMLHTTP = CreateObject("Msxml2.ServerXMLHTTP")
on error resume next

oXMLHTTP.Open "GET", URL, False
oXMLHTTP.Send
GetTextFromUrl = "<br><BR>"& oXMLHTTP.responseText
response.Write GetTextFromURL

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Community Manager

Hey @dntaker ,

 

If you know the external ID for a specific event, you can use the following method:

https://developers.hubspot.com/docs/methods/timeline/get-event

 

Keep in mind: There isn't any 'Get all' method for Timeline events, since they were not designed to be exported by a 3rd party. If you need some sort of bulk export of AskNicely events, I'd recommend trying to do so in AskNicely.

Reply
0 Upvotes
7 Replies
Community Manager

Hey @dntaker ,

 

I'm not particularly familiar with the language you're using, but based on this Stackoverflow post, nothing seems particularly out of order. Can you give me some more information on what exactly this line is doing?

GetTextFromUrl = "<br><BR>"& oXMLHTTP.responseText

I'm wondering if oXMLHTTP.responseText actually does have a value, but this line is interfering somehow? Also, can you include some more information on the headers being set here? Is it possible that you're getting a 415 or something?

Reply
0 Upvotes
New Contributor

All it is doing is setting a variable with a couple of breaks and the response text.

Nothing is displayed when outputting the text to the screen. Luckily the breaks don't need to be case sensitive LOL.

 

The content of the responseText should contain the data right?

When I run the other URLs they seem to work OK?

Reply
0 Upvotes
New Contributor

Just noticed the count variable was in twice.

Just taken it out no difference:

URL = "https://api.hubapi.com/engagements/v1/engagements/recent/modified?hapikey=demo&count=100&offset=0"

Reply
0 Upvotes
Community Manager

Hey @dntaker ,

 

Thanks for the additional information. It's tough to say what's going on in more detail since I'm not familiar with the language you're using. Is there any way for you you log the full, raw response you're getting from HubSpot, including the response code? That will likely give me more information on whether or not this is an issue on the HubSpot side.

Reply
0 Upvotes
Community Manager

@dntaker and I touched base via private message.

 

The tl;dr is: The AskNicely events are custom timeline events created by the AskNicely integration, not engagements. Custom timeline events for integrations aren't accesible via the API unless you have the external event ID that was used to create the event. This is becasue the Timeline API provides methods for an integration to create timeline events, but does not provide methods for a third party (i.e. a different integration) to access those methods.

Reply
0 Upvotes
New Contributor

Thanks for looking into this, How do I get the events if I know the event id?

Or all events if I don't?

 

Which API would that be as they're not engagements.

 

Best Regards

 

Dave

Reply
0 Upvotes
Community Manager

Hey @dntaker ,

 

If you know the external ID for a specific event, you can use the following method:

https://developers.hubspot.com/docs/methods/timeline/get-event

 

Keep in mind: There isn't any 'Get all' method for Timeline events, since they were not designed to be exported by a 3rd party. If you need some sort of bulk export of AskNicely events, I'd recommend trying to do so in AskNicely.

Reply
0 Upvotes