APIs & Integrations

KGopalakrishn
Participant

Retrieving Dynamic URL from HubSpot UI Extensions in Public App Settings

In the provided code, the url is being hardcoded, but I want to retrieve the URL dynamically from the HubSpot UI Extensions Public App Setting component. How can I achieve this?

 

class HttpWrapper {
private headers: Record<string, string>;
private baseurl: string;
constructor() {
this.headers = {
Authorization: "ABC",
};
this.baseurl = "https://{{domain}}/api";
}

public async get(url: string) {
try {
const response = await hubspot.fetch(this.baseurl + url, {
method: Method.GET,
headers: this.headers,
});
return await response.json();
} catch (error: any) {
throw error;
}
}
}

0 Upvotes
1 Reply 1
BérangèreL
Community Manager
Community Manager

Retrieving Dynamic URL from HubSpot UI Extensions in Public App Settings

Hi @KGopalakrishn, I hope that you are well!

Thanks for asking the Community!

I'd like to share this documentation "Fetching data for public apps (BETA)" that might help you!

I also wanted to invite a couple of subject matter experts to this conversation: Hi @deepikaverma, @HubSpot_Corey and @miljkovicmisa do you have suggestions to help @KGopalakrishn, please?

Thanks so much and have a great day!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


0 Upvotes