Yes, Adobe Analytics can support a flow similar to what you're describing through its OAuth 2.0 Server-to-Server authentication and JWT-based integration although JWT is getting deprecated starting next year.
Upon successful onboarding and token exchange, Adobe issues Access Tokens that allow access to specific APIs. These tokens can be scoped to ensure that only necessary resources are accessed. Adobe Analytics allows you to dynamically specify report suites (analogous to “properties”) when querying data. This can be done using an API request where the desired report suite is specified as part of the request. Sharing sample Python code in which you can see that an access code is first generated and then shared to retrieve data from Adobe Admin.
import logging
import requests
from datetime import datetime, timedelta, time
logging.basicConfig(level="INFO")
logger = logging.getLogger()
# OAuth and API configuration details (replace with your org specific data)
config = {
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"scopes": "openid,AdobeID,additional_info.projectedProductContext",
"token_url": "https://ims-na1.adobelogin.com/ims/token/v3",
"company_id": "your_company_id",
"api_base_url": "https://analytics.adobe.io/api/"
}
# Get timestamps for yesterday
yesterday = datetime.now() - timedelta(days=1)
start_date_str = datetime.combine(yesterday, time.min).strftime("%Y-%m-%dT%H:%M:%S-07")
end_date_str = datetime.combine(yesterday, time.max).strftime("%Y-%m-%dT%H:%M:%S-07")
def get_access_token_oauth(config):
"""Fetches an OAuth access token using the client credentials method."""
post_body = {
"grant_type": "client_credentials",
"client_id": config["client_id"],
"client_secret": config["client_secret"],
"scope": config["scopes"]
}
response = requests.post(config["token_url"], data=post_body)
response.raise_for_status()
return response.json()["access_token"]
def get_admin_logs(config, access_token, start_date, end_date):
"""Fetches admin usage logs for the specified date range."""
url = f"{config['api_base_url']}{config['company_id']}/auditlogs/usage"
querystring = {
"startDate": start_date,
"endDate": end_date,
"limit": "1000"
}
headers = {
"x-api-key": config["client_id"],
"Authorization": f"Bearer {access_token}",
"Accept": "application/json"
}
response = requests.get(url, headers=headers, params=querystring)
response.raise_for_status()
return response.json()
# Fetch the access token
access_token = get_access_token_oauth(config)
logger.info(f"Access token retrieved successfully.")
# Retrieve admin logs
logs = get_admin_logs(config, access_token, start_date_str, end_date_str)
logger.info(f"Retrieved {len(logs)} logs.")
Hope this helps!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.