UPM API v 1.0 works for Connect but not Forge

Hi,

I am migrating the Connect Viso Publisher for Confluence macro to Forge. The macro is typicallly added to a space page using Confluence API called from a companion Visio Addin called ModelGen for Visio.

In the Visio Addin I wan to check the version of the Confluence plugin in a given Confluence Cloud subscription to determine whether the older Connect version is installed, or alternatively the new Forge version.

When I run the UPM API https://cpas.atlassian.net/wiki/rest/plugins/1.0/visio-publisher-for-confluence-key for the Connect version I get the following:

{
    "links": {
        "self": "/wiki/rest/plugins/1.0/visio-publisher-for-confluence-key",
        "plugin-summary": "/wiki/rest/plugins/1.0/visio-publisher-for-confluence-key/summary",
        "plugin-icon": "/wiki/rest/plugins/1.0/visio-publisher-for-confluence-key/media/plugin-icon",
        "plugin-logo": "/wiki/rest/plugins/1.0/visio-publisher-for-confluence-key/media/plugin-logo",
        "manage": "https://cpas.atlassian.net/wiki/plugins/servlet/upm?fragment=manage%2Fvisio-publisher-for-confluence"
    },
    "key": "visio-publisher-for-confluence",
    "enabled": true,
    "enabledByDefault": true,
    "version": "1.1.10-AC",
    "description": "Allows Model Gen Visio VSTO add-in to publish natively to Confluence Cloud",
    "name": "Visio Publisher for Confluence",
    "modules": [],
    "userInstalled": true,
    "optional": true,
    "unrecognisedModuleTypes": false,
    "unloadable": false,
    "static": false,
    "usesLicensing": true,
    "remotable": true,
    "vendor": {
        "name": "Crecy Poitiers Agincourt Solutions",
        "marketplaceLink": "https://crecy.com.au",
        "link": "https://crecy.com.au"
    }
}

However the equivalent UPM API https://cpas-test.atlassian.net/wiki/rest/plugins/1.0/visio-publisher-for-confluence-key for the Forge version returns nothing (404 Not Found).

The test site has Development, Staging and Production versions of the macro installed. However, the Forge app is yet to be published to MaarketPlace, so there is no valid license.

I am using the same user / API key in both instances

Any thoughts would be gratefully received.

Thanks and regards,
Andrew

Thanks to @SeanBourke I have figured this out. Graph QL can be used to get the Forge App info. First you need to get the cloudId and activationIds using the following query:

query example { tenantContexts(hostNames:["<domain>.atlassian.net"]) { cloudId, activationIds {product, active}}}

These can then be used to construct the graph QL query to retrieve the Forge plugin info (forgeAppId can be sourced from manifest.yaml):

{"query":" query confluence_manageApps_getEcosystemInstalledApp($contextAri: ID!, $appId: ID!) {                    ecosystem {                        appInstallationsByContext(filter: {appInstallations: {contexts: [$contextAri]}, apps: {ids: [$appId]}}) {                        nodes {    id    createdAt    license {        active        type        supportEntitlementNumber        ccpEntitlementId        ccpEntitlementSlug        trialEndDate        isEvaluation        subscriptionEndDate        billingPeriod    }    app {        contactLink        createdBy {            name        }        description        id        tags        marketplaceApp {            appKey            name            tagline            logo {                scaled {                    id                }            }            versions (filter: {                productHostingOptions:CLOUD,                visibility: PUBLIC            }) {                edges {                    node {                        paymentModel                        deployment {                            ... on MarketplaceCloudAppDeployment {                                cloudAppVersionId                                scopes {                                    id                                    capability                                }                            }                        }                    }                }            }        }        name        privacyPolicy        termsOfService        vendorName    }    appEnvironment {        key        type        oauthClient {            clientID        }    }    appEnvironmentVersion {        id        version        requiresLicense        isLatest        permissions {            scopes {                key            }        }    }}                        pageInfo {                            endCursor                            hasNextPage                        }                    }                }                    extensionContexts(contextIds: [$contextAri]) {                        globalSettingsPageExtensions: extensionsByType(type: \"confluence:globalSettings\") {                            id                            environmentId                            environmentType                            properties                            type                            appVersion                            installationId                        }                        configurePageExtensions: extensionsByType(type: \"connect-confluence:configurePage\") {                            id                            environmentId                            environmentType                            properties                            type                            appVersion                            installationId                            migrationKey                            key                        }                        postInstallPageExtensions: extensionsByType(type: \"connect-confluence:postInstallPage\") {                            id                            environmentId                            environmentType                            properties                            type                            appVersion                            installationId                            migrationKey                            key                        }                        extensionsByType(type: \"confluence:globalSettings\") {                            id                            environmentId                            environmentType                            properties                            type                            appVersion                            installationId                        }                    }                }            ","variables":{"contextAri":"ari:cloud:confluence:<cloudId>:workspace/<activationId>,"appId":"ari:cloud:ecosystem::app/<forgeAppId>","environmentType":"STAGING"}}
1 Like