Is there an API to find the Compass WorkspaceID?

After some digging I found that the Compass Component ARI is build using this format ari:cloud:compass:[CLOUD_ID]:component/[WORKSPACE_ID]/[COMPONENT_SHORT_ID]

How does one resolve the WORKSPACE_ID for a Compass installation in a remote backend?

The FullContext object in @forge/bridge has an optional placeholder for a workspaceId but I cannot find the backend equivalent of this.

Is there an API (REST or GraphQL) that I can use to resolve the Workspace ID for a given Compass instance?

1 Like

@markrekveld you could use the tenantContexts API to retrieve the workspace. This GraphQL API is briefly mentioned here https://developer.atlassian.com/cloud/compass/components/create-components-using-the-api/#look-up-the-unique-cloudid-for-your-atlassian-site but you’ll also notice that in the full specification that links to the explorer, there are more fields that can be requested back.

The activationId that would be associated to the compass product would be the workspace Id that you’re looking for:

query FindWorkspaceIds {
  tenantContexts(cloudIds: "your-cloud-id") {    
    activationIdByProduct(product: "compass") {
      active
      product
    }
  }
}
1 Like

Thanks @EnriqueSerranoValle that worked nicely!

1 Like