Finding Content Associated with an Integration

Problem

You want to find all content associated with an integration.

Solution

Warning

You must have administrator or publisher privileges to find an integration.

Get an integration and use its associations.find() method to find all associated content.

from posit import connect

GUID = "84f0f0ae-e328-44b0-98ba-aee6e775b5f0"

client = connect.Client()
integration = client.oauth.integrations.get(GUID)
associations = integration.associations.find()

The results can be transformed into a DataFrame for easy viewing and filtering.

>>> import polars as pl
>>> pl.DataFrame(associations)
shape: (3, 6)
┌─────────────────────────────────┬─────────────────────────────────┬────────────────────────┬───────────────────────────────┬────────────────────────────┬──────────────────────┐
│ app_guid                        ┆ oauth_integration_guid          ┆ oauth_integration_name ┆ oauth_integration_description ┆ oauth_integration_template ┆ created_time         │
------------------
strstrstrstrstrstr
╞═════════════════════════════════╪═════════════════════════════════╪════════════════════════╪═══════════════════════════════╪════════════════════════════╪══════════════════════╡
│ e3155944-f997-4af5-9f6a-2fe852… ┆ 84f0f0ae-e328-44b0-98ba-aee6e7… ┆ Azure                  ┆ Azure (staging)               ┆ azure                      ┆ 2024-07-17T21:13:21Z
│ b1ce5e4a-298d-48db-82f1-88a861… ┆ 84f0f0ae-e328-44b0-98ba-aee6e7… ┆ Azure                  ┆ Azure (staging)               ┆ azure                      ┆ 2024-07-19T18:03:44Z
│ c722a97c-b1c8-441d-9d8f-b470c5… ┆ 84f0f0ae-e328-44b0-98ba-aee6e7… ┆ Azure                  ┆ Azure (staging)               ┆ azure                      ┆ 2024-08-05T21:41:41Z
└─────────────────────────────────┴─────────────────────────────────┴────────────────────────┴───────────────────────────────┴────────────────────────────┴──────────────────────┘

Follow the Finding Integrations recipe to get the integration’s GUID, then use the connectapi client to make a direct call to the associations endpoint.

library(connectapi)

GUID <- "84f0f0ae-e328-44b0-98ba-aee6e775b5f0"

client <- connect()
associations <- client$GET(paste0("v1/oauth/integrations/", GUID, "/associations"))

The results can be transformed into a DataFrame for easy viewing and filtering.

> map_dfr(associations, ~.x)
# A tibble: 3 × 6
  app_guid                             oauth_integration_guid               oauth_integration_name   oauth_integration_description oauth_integration_template created_time        
  <chr>                                <chr>                                <chr>                    <chr>                         <chr>                      <chr>               
1 e3155944-f997-4af5-9f6a-2fe8524be7f3 84f0f0ae-e328-44b0-98ba-aee6e775b5f0 Azure                  Azure (staging)               azure                      2024-07-17T21:13:21Z
2 b1ce5e4a-298d-48db-82f1-88a861e946a0 84f0f0ae-e328-44b0-98ba-aee6e775b5f0 Azure                  Azure (staging)               azure                      2024-07-19T18:03:44Z
3 c722a97c-b1c8-441d-9d8f-b470c58fe70b 84f0f0ae-e328-44b0-98ba-aee6e775b5f0 Azure                  Azure (staging)               azure                      2024-08-05T21:41:41Z

See also