Adobe Analytics client implementation of open api definition
Hi,
I am trying to implement in Java an Adobe Analytics 2.0 client using open api client generation with this definition
https://adobedocs.github.io/analytics-2.0-apis/datasources.json
I need to use the POST JOB endpoint to upload a data file to an existing Data Srouces account. My issue is that I cannot find a way how could I provide the data file to the endpoint createJob.
I believe there's an issue with the above api definition for the data sources because also in the swagger page there are errors:
Go to https://adobedocs.github.io/analytics-2.0-apis/?urls.primaryName=Data%20Sources%202.0%20APIs
Select a definition : Data Sources 2.0 API
Under JOB definition there's a POST endpoint that doesn't work (there are also errors in the console).
Am I doing something wrong? Did anybody face this issue before?
I'm trying to achive this: https://developer.adobe.com/analytics-apis/docs/2.0/guides/endpoints/data-sources/#post-data
Here is my client implementation.
@Slf4j
@Service
public class AdobeAnalyticsClient {
JobApi jobApi;
AdobeAnalyticsProperties adobeAnalyticsProperties;
StatisticsProperties statisticsProperties;
public AdobeAnalyticsClient(
final JobApi jobApi,
final AdobeAnalyticsProperties adobeAnalyticsProperties,
final ApiClientProperties apiClientProperties,
final StatisticsProperties statisticsProperties) {
this.jobApi = jobApi;
this.adobeAnalyticsProperties = adobeAnalyticsProperties;
this.statisticsProperties = statisticsProperties;
setupClient(apiClientProperties);
}
public DataSourcesJob importStatisticsData(File file) throws ApiException {
// how should can I provide the input file here?
return jobApi.createJob(statisticsProperties.getReportSuiteId(), adobeAnalyticsProperties.getConfigDataSourceId());
}
private void setupClient(final ApiClientProperties apiClientProperties) {
log.info("Setting up adobe analytics client: {}", adobeAnalyticsProperties.getBaseUrl());
final ApiClient apiClient = new ApiClient();
apiClient.setBasePath(adobeAnalyticsProperties.getBaseUrl());
apiClient.setApiKey(adobeAnalyticsProperties.getGlobalCompanyId());
apiClient.setAccessToken(adobeAnalyticsProperties.getAccessToken());
apiClient.setConnectTimeout(apiClientProperties.getDefaultConnectTimeoutMs());
apiClient.setReadTimeout(apiClientProperties.getDefaultReadTimeoutMs());
apiClient.setWriteTimeout(apiClientProperties.getDefaultWriteTimeoutMs());
jobApi.setApiClient(apiClient);
}
}