diff --git a/src/lib/get-org-data.ts b/src/lib/get-org-data.ts
new file mode 100644
index 0000000..cea1faf
--- /dev/null
+++ b/src/lib/get-org-data.ts
@@ -0,0 +1,33 @@
+import 'source-map-support/register';
+import * as debugLib from 'debug';
+import * as snykApiSdk from 'snyk-api-ts-client';
+import { getApiToken } from './get-api-token';
+import { string } from 'yargs';
+import _ = require('lodash');
+
+const debug = debugLib('snyk-licenses:getLicenseDataForOrg');
+
+export interface OrgData {
+ name: string;
+ id: string;
+ slug: string;
+ url: string;
+ group: {
+ name: string;
+ id: string;
+ };
+}
+
+export async function getOrgData(orgPublicId: string): Promise
{
+ getApiToken();
+
+ try {
+ const snykApiClient = await new snykApiSdk.Orgs();
+ const allOrgs: OrgData[] = _.get(await snykApiClient.get(), 'orgs', []);
+ const orgData = allOrgs.filter(org => org.id === orgPublicId)[0];
+ return orgData;
+ } catch (e) {
+ debug('❌ Failed to get org data for org ID:' + orgPublicId);
+ throw e;
+ }
+}
diff --git a/test/lib/__snapshots__/generate-html-report.test.ts.snap b/test/lib/__snapshots__/generate-html-report.test.ts.snap
index 742fe16..b5ffd4d 100644
--- a/test/lib/__snapshots__/generate-html-report.test.ts.snap
+++ b/test/lib/__snapshots__/generate-html-report.test.ts.snap
@@ -141,7 +141,7 @@ exports[`Generate HTML report License HTML Report is generated as expected 1`] =
Licenses Attribution Report
- Org ID: f35105cf-1aff-449b-8456-259331391dac
+
BSD-2-Clause
@@ -181,7 +181,9 @@ exports[`Generate HTML report License HTML Report is generated as expected 1`] =
Projects in Snyk
- XXXX(snyk-fixtures/npm-with-single-dep:package.json)
+
@@ -382,7 +384,9 @@ THIS SOFTWARE IS PROVIDED BY <
Projects in Snyk
-
XXX(snyk-fixtures/tiny-monorepo:gradle/build.gradle)
+
@@ -427,7 +431,9 @@ THIS SOFTWARE IS PROVIDED BY <
Projects in Snyk
-
XXX(snyk-fixtures/npm-with-single-dep:package.json)
+