Comments (6)
@bjarnef yes, it is refreshed when an Unauthorized response is retrieved from HubSpot.
I have released a new version of the package here adding constant values.
Let me know if there is anything else I can help you with.
from umbraco.cms.integrations.
Btw. is it possible to possible from a form guid or does it need to entire HubSpotForm model? E.g. it passing in form guid to a Vue component.
E.g. there is a help to render the selected Hubspot form:
@Html.RenderHubspotForm(Model.HubspotForm)
But can we render it from a known Guid?
var guid = Guid.Parse("9ac95f04-a658-467d-936f-4b0a726eb3ca")
// Render Hubspot form
or
var guid = Guid.Parse(Model.HubspotForm.Guid)
// Render Hubspot form
Currently we have a project using a Vue component where form guid (hardcoded) is passed into an API Controller method like this:
[HttpGet]
public HttpResponseMessage getForm(string formId)
{
string hubspotApiKey = "something-secret";
string url = string.Format("https://api.hubapi.com/forms/v2/forms/{0}/?hapikey={1}", formId, hubspotApiKey);
using (WebClient wc = new WebClient())
{
var json = wc.DownloadString(url);
var jObject = JsonConvert.DeserializeObject<RootObject>(json);
var response = Request.CreateResponse(HttpStatusCode.OK, jObject , "application/json");
return response;
}
}
@acoumb maybe you know how something equivalent could work with the integration package? Is is only possible to fetch the form as HTML or as JSON like the code above?
from umbraco.cms.integrations.
Hi @bjarnef
When HubSpot introduced the EU data centers, this affected the form rendering of the forms. To support both scenarios the view model passed to the view contains the source of the JS script as well as some mandatory fields for HubSpot to initialize the JavaScript objects: region, portal ID and the form ID.
Does this answer your question?
from umbraco.cms.integrations.
Hi @acoumb
Okay, is it still possible to fetch the JSON as today, but it seems starting November 30, 2022, HubSpot API keys will no longer be able to be used as an authentication method to access HubSpot APIs as used in #48 (comment)
https://developers.hubspot.com/docs/api/developer-guides-resources
https://developers.hubspot.com/docs/api/migrate-an-api-key-integration-to-a-private-app
Currently it seems the Vue component fetch e.g. portal
from the mentioned API method and render to from JSON using vue-json-schema-form
:
It seems this it currently using "v2" https://legacydocs.hubspot.com/docs/methods/forms/v2/get_form but I noticed there's also a newer "v3" : GET /marketing/v3/forms/{formId}
https://developers.hubspot.com/docs/api/marketing/forms
I haven't looked into if there are differences in response in "v2" and "v3", but both can be authorized using OAuth Access Token or API Key - but I guess it is the API Key approach which will stop working.
https://developers.hubspot.com/docs/api/developer-guides-resources
from umbraco.cms.integrations.
@acoumb regarding the access token saved to the database https://umbraco.com/blog/integrating-umbraco-cms-with-hubspot-forms/ is this refreshed when expired? From what I understand it previous expired after 6 hours, but it seems to have changed to 30 minutes? https://developers.hubspot.com/changelog/upcoming-expiration-of-oauth-access-tokens-is-changing
It seems the "old" way using hapiKey
query parameter then need to send access token in Authorization
header instead:
https://developers.hubspot.com/docs/api/migrate-an-api-key-integration-to-a-private-app#update-the-authorization-method-of-your-integration-s-api-requests
from umbraco.cms.integrations.
Great, I think we can close this issue then.
For this project the client chosen to go with a private app to request the forms using then access token as it otherwise required a bit more work to first upgrade to Umbraco 8.5.4+
from umbraco.cms.integrations.
Related Issues (20)
- Dynamics Integration Database Table Issue HOT 1
- Sync test 1
- Sync test 2
- Sync test 3
- Sync test 4 HOT 1
- SyncTool - Integrations Test 1
- SyncTool - Integrations Test 2 HOT 1
- SyncTool - Integrations Test 1 HOT 1
- SyncTool - Integrations Test 2 HOT 2
- SyncTool - Integration Test 3 HOT 1
- SyncTool - test 3
- Javascript error on staging sites HOT 5
- Shopify - Slow perfomance HOT 5
- Dynamics 365 - No Forms Showing in Form Picker HOT 3
- Semrush Losing Connection HOT 1
- ActiveCampaign only returns 20 forms HOT 2
- Algolia - TinyMCE not indexed in Umbraco 13 with 2.1.4 Algolia HOT 1
- A number of problems HOT 2
- Hubspot crm integration Umbraco 14 HOT 3
- Null error when trying to retrieve Dynamics365 forms HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umbraco.cms.integrations.