Cartodb: Add hubspot form newsletter id to /me endpoint request

Created on 10 Oct 2017  ·  10Comments  ·  Source: CartoDB/cartodb

In public maps, we have an input to subscribe to the newsletter. This input is generated by hubspot, but it needs a token to render it.

captura de pantalla 2017-10-10 a las 12 21 02

This is what we currently have at /api/v3/me:

captura de pantalla 2017-10-10 a las 12 23 37

I was thinking the endpoint should return this value in 'hubspot_ids' stringified json, what do you think?

Backend

Most helpful comment

My head is not what it used to be 🤦‍♂️ Yeah, I meant form_ids (updated my previous comment)

All 10 comments

I'm not 100% sure, but I'd keep at /me the current configuration structure:

      form_ids:
        newsletter: ''
      event_ids:
        import_failed: ''
       ...

hubspot_ids come from event_ids. I have mixed feelings. We could add a new form_newsletter event at hubspot_ids, or a new attribute hubspot_forms_ids at the same level than hubspot_ids (which should've been hubspot_events_ids). For structure consistency, I'd do the latter, but I'm not 100% sure.

I agree with you 👍 what do you think @matallo @javitonino?

Adding hubspot_form_ids sounds good to me. We can probably add it directly to the frontend config helper (which is used in /me).

Ey, it's not "adding hubspot_event_ids but hubspot_forms_ids. Current hubspot_ids attribute comes from event_ids. So, the less harm that we can do is adding hubspot_forms_ids from form_ids.

My head is not what it used to be 🤦‍♂️ Yeah, I meant form_ids (updated my previous comment)

I've seen that we are json-encoding some config values, but since it's fugly I'll not do it this time :)

You mean the hubspot_ids?

For example, yes. There are some configs that are rendered as a json string, which I strongly dislike

Me too. It's good to take this into account because we'll need to change some things in the public views if this changes. Thanks!

I won't change anything, but simply add this value as a json, not as a string ;). Just commenting because I'm _breaking coherence_. But since we all agree... 😄

Was this page helpful?
0 / 5 - 0 ratings