APIs & Integrations

dntaker
Miembro

Activity required from contacts Ask Nicely

resolver

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

0 Me gusta
1 Soluciones aceptada
Derek_Gervais
Solución
Exmiembro de HubSpot
Exmiembro de HubSpot

Activity required from contacts Ask Nicely

resolver

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.

Ver la solución en mensaje original publicado

0 Me gusta
7 Respuestas 7
dntaker
Miembro

Activity required from contacts Ask Nicely

resolver

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"

0 Me gusta
Derek_Gervais
Exmiembro de HubSpot
Exmiembro de HubSpot

Activity required from contacts Ask Nicely

resolver

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.

0 Me gusta
Derek_Gervais
Exmiembro de HubSpot
Exmiembro de HubSpot

Activity required from contacts Ask Nicely

resolver

@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.

0 Me gusta
dntaker
Miembro

Activity required from contacts Ask Nicely

resolver

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

0 Me gusta
Derek_Gervais
Solución
Exmiembro de HubSpot
Exmiembro de HubSpot

Activity required from contacts Ask Nicely

resolver

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.

0 Me gusta
Derek_Gervais
Exmiembro de HubSpot
Exmiembro de HubSpot

Activity required from contacts Ask Nicely

resolver

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?

0 Me gusta
dntaker
Miembro

Activity required from contacts Ask Nicely

resolver

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?

0 Me gusta