Get the site ID from the REST API during avi:forge:installed:app

For the trigger “avi:forge:installed:app”:
How do we get the site ID from the REST API - How do we get the site ID during the install event?
We couldn’t call this function from the webhook: “

Hi Philipp, the ids you get back in the response from are cloudIds.

In Forge Triggers you can get the cloudId from either the context or the event itself e.g.

export async function run(event, context) {
1 Like

@AdamMoore Thank you. That worked. And how can we retrieve the cloudId inside a ForgeUI component, e.g. IssueGlance PanelDetails?

For example, that’s what we tried and it didn’t work:

const PanelDetails = () => {
  const [siteId, setSiteId] = useState<string>('');
  useEffect(async () => {
    const endpoint = '';
    const res = await fetch(endpoint, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
    const jsonData = await res.json();
    console.log('AR', jsonData);
  }, []);
  return (

In UI Kit, you can use the useProductContext hook to get the cloudId.

@AdamMoore Thank you so much. That worked. :hugs:
Another follow up question: Can we also get the organizationName and the site url form the trigger “avi:forge:installed:app” event?

No, sorry, you’ll need to call the REST API

@AdamMoore The REST API you provided doesn’t seem to include organizationName and site url. Is baseUrl reliable to extract the site url? Where do we get the organizationName?

Yeah, baseUrl and siteUrl are the same. Sorry, I’m not actually sure if the organizationName is available. I’ll try and find out.