@rbaileysr/atlassian-marketplace-managed-api
v1.0.0
Published
Managed API wrapper for Atlassian Marketplace API Reporting endpoints
Maintainers
Readme
Atlassian Marketplace Managed API
A type-safe Managed API wrapper for Atlassian Marketplace API Reporting endpoints, designed for use in ScriptRunner Connect.
Overview
This package provides a comprehensive, type-safe interface to the Atlassian Marketplace API Reporting section, including:
- Reporting Links: Get links to permitted vendor reporting resources
- Feedback: Get feedback and aggregated feedback metrics
- Evaluations: Get aggregated evaluation metrics (by hosting, country, partner, region)
- Licenses: Get licenses, export licenses, and initiate async license exports
- Sales: Get sales metrics (churn, conversion, renewal), transactions, and benchmarks
- Customer Insights: Get customer insights by regions, editions, active users, and tiers
- Search Keywords: Get search keyword data and zero search results keywords
- Benchmark: Get benchmark evaluations and sales metrics
- App Requests: Get app requests and approvals
Installation
npm install @rbaileysr/atlassian-marketplace-managed-apiUsage
Setup
Configure an API Connection in ScriptRunner Connect web UI:
- Path:
scripts/api/atlassian-marketplace - Base URL:
https://marketplace.atlassian.com/rest/3 - Authentication: Configure using Generic Connector or appropriate authentication method
- Path:
Import and use the Managed API:
import { createMarketplaceApi } from '@rbaileysr/atlassian-marketplace-managed-api';
import MarketplaceApiConnection from './api/atlassian-marketplace';
const Marketplace = createMarketplaceApi(MarketplaceApiConnection);
// Get reporting links
const links = await Marketplace.Reporting.getReportingLinks({
developerId: 'your-developer-id'
});
// Get licenses
const licenses = await Marketplace.Licenses.getLicenses({
developerId: 'your-developer-id',
limit: 10
});
// Get aggregated evaluations by hosting
const evaluations = await Marketplace.Evaluations.getAggregatedEvaluations({
developerId: 'your-developer-id',
metric: 'hosting'
});
// Initiate async export of licenses
const exportResponse = await Marketplace.Licenses.initiateAsyncExportLicenses({
developerId: 'your-developer-id',
startDate: '2024-01-01',
endDate: '2024-12-31'
});
// Check export status
const status = await Marketplace.Licenses.getAsyncExportStatus({
developerId: 'your-developer-id',
exportId: exportResponse.exportId
});API Groups
Reporting
getReportingLinks(options)- Get links to permitted vendor reporting resources
Feedback
getFeedback(options)- Get a list of feedback for the specified vendor's appsgetAggregatedFeedback(options)- Get aggregated feedback (metric: 'reason' or 'type')
Evaluations
getAggregatedEvaluations(options)- Get aggregated evaluations (metric: 'hosting', 'country', 'partner', or 'region')
Licenses
getLicenses(options)- Get a list of licenses for the specified vendor's appsexportLicenses(options)- Export all licenses (CSV or JSON)initiateAsyncExportLicenses(options)- Initiate async export of licensesgetAsyncExportStatus(options)- Get status of async license exportgetAsyncExportResult(options)- Get result of async license export
Sales
getSalesMetricsChurn(options)- Get churn metricsgetSalesMetricsConversion(options)- Get conversion metricsgetSalesMetricsRenewal(options)- Get renewal metricsgetSalesMetricDetails(options)- Get details about individual Cloud license eventsexportSalesMetricDetails(options)- Export sales metric details (CSV or JSON)getSalesTransactions(options)- Get sales transactionsexportSalesTransactions(options)- Export sales transactions (CSV or JSON)initiateAsyncExportSalesTransactions(options)- Initiate async export of sales transactionsgetAsyncExportSalesTransactionsStatus(options)- Get status of async sales transactions exportgetAsyncExportSalesTransactionsResult(options)- Get result of async sales transactions exportgetSalesTransactionsByMetric(options)- Get sales transactions aggregated by metricexportFreeStarterTier(options)- Export free starter tier data (CSV or JSON)getSalesMetricsChurnBenchmark(options)- Get churn benchmark metrics
Customer Insights
getCustomerInsightsRegions(options)- Get customer insights by regiongetCustomerInsightsEditions(options)- Get customer insights by editiongetCustomerInsightsActiveUsers(options)- Get customer insights for active usersgetCustomerInsightsTiers(options)- Get customer insights by tier
Search Keywords
getSearchKeywordsBySource(options)- Get top 500 searched keywords by sourceexportSearchKeywordsBySource(options)- Export search keywords by source (CSV or JSON)getZeroSearchResultsKeywordsBySource(options)- Get keywords with zero search results by sourceexportZeroSearchResultsKeywordsBySource(options)- Export zero search results keywords by source (CSV or JSON)getSearchKeywords(options)- Get search keywords for vendor's appsexportSearchKeywords(options)- Export search keywords (CSV or JSON)getProductSearchKeywords(options)- Get search keywords for a specific productexportProductSearchKeywords(options)- Export product search keywords (CSV or JSON)
Benchmark
getBenchmarkEvaluations(options)- Get benchmark evaluation metricsgetBenchmarkSales(options)- Get benchmark sales metrics
App Requests
getAppRequestsAndApprovals(options)- Get app requests and approvals
Type Definitions
All types are exported from the package for use in your scripts:
import type {
GetLicensesOptions,
LicensesResponse,
GetFeedbackOptions,
Feedback,
// ... other types
} from '@rbaileysr/atlassian-marketplace-managed-api';Features
- Type Safety: Full TypeScript support with IntelliSense
- Error Handling: Comprehensive error handling with meaningful error messages
- Query Building: Automatic query string building from options
- Response Parsing: Automatic response parsing with proper error handling
- Export Support: Support for CSV and JSON export formats
- Async Exports: Support for async export operations with status checking
Requirements
- ScriptRunner Connect workspace
- API Connection configured in ScriptRunner Connect web UI
- Node.js >= 18.0.0 (for local development)
License
MIT
Support
For issues and questions, please refer to the ScriptRunner Connect Documentation.
