View all methods

scorecards.info

Retrieve details about a specific scorecard, including its defined levels and checks.

Facts

Method GET https://api.getdx.com/scorecards.info
Required scope scorecards:read

Arguments

Name Type Description
token Token Auth token passed as an HTTP header.
id Text The unique ID of the scorecard.

Example request

This is a typical request:

curl -X GET https://api.getdx.com/scorecards.info?id=qjfj1a6cmit4 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx'

Example response

This is a typical success response:

{
  "ok": true,
  "scorecard": {
    "id": "qjfj1a6cmit4",
    "name": "My custom scorecard",
    "description": "",
    "type": "LEVEL",
    "published": true,
    "entity_filter_type": "entity_types",
    "entity_filter_sql": null,
    "entity_filter_type_ids": ["4aav7arl6mo6"],
    "tags": [{ "value": "production", "color": "#38bdf8" }],
    "editors": [
      {
        "id": 2468,
        "email": "liszt@example.com",
        "name": "Franz Liszt",
        "avatar": "https://avatars.slack-edge.com/2024-07-05/1234567890.jpg",
        "created_at": "2024-06-28T04:03:53.245Z"
      }
    ],
    "admins": [
      {
        "id": 123456,
        "email": "beethoven@example.com",
        "name": "Ludwig van Beethoven",
        "avatar": "https://avatars.slack-edge.com/2024-07-05/1234567890.jpg",
        "created_at": "2024-06-28T04:03:53.245Z"
      }
    ],
    "sql_errors": [],
    "levels": [
      {
        "id": "vic57y3o55r4",
        "name": "Bronze",
        "rank": 1,
        "color": "#fdba74"
      },
      {
        "id": "nqbw5y1fogur",
        "name": "Silver",
        "rank": 2,
        "color": "#9ca3af"
      },
      {
        "id": "mfq00xe2z3vm",
        "name": "Gold",
        "rank": 3,
        "color": "#fbbf24"
      }
    ],
    "empty_level_label": "None",
    "empty_level_color": "#e5e7eb",
    "checks": [
      {
        "id": "y3ynphtim81c",
        "ordering": 0,
        "name": "Has Owner",
        "description": "Important for entities to have an owner",
        "sql": "SELECT CASE\n    WHEN count(*) > 0 THEN 'PASS'\n    ELSE 'FAIL'\n  END AS status\nFROM dx_catalog_entities e\n  JOIN dx_catalog_entity_owners o ON e.id = o.entity_id\nWHERE e.identifier = $entity_identifier;",
        "filter_sql": null,
        "filter_message": null,
        "output_enabled": false,
        "output_type": null,
        "output_custom_options": null,
        "output_aggregation": null,
        "external_url": null,
        "published": true,
        "level": {
          "id": "vic57y3o55r4",
          "name": "Bronze"
        }
      },
      {
        "id": "5p63mg261ypp",
        "ordering": 0,
        "name": "Another check",
        "description": "asdf",
        "sql": "SELECT 'PASS' AS status, 123 AS output",
        "filter_sql": "",
        "filter_message": "",
        "output_enabled": true,
        "output_type": "custom",
        "output_custom_options": {
          "unit": "widget",
          "decimals": "auto"
        },
        "output_aggregation": "mean",
        "external_url": "",
        "published": true,
        "level": {
          "id": "nqbw5y1fogur",
          "name": "Silver"
        }
      },
      {
        "id": "pevrw9vec5rk",
        "ordering": 0,
        "name": "Has tier",
        "description": "### Why this matters\n\n### How to pass this check\n\n### Resources",
        "sql": "SELECT CASE\n    WHEN count(*) > 0 THEN 'PASS'\n    ELSE 'FAIL'\n  END AS status\nFROM dx_catalog_entities e\n  JOIN dx_catalog_entity_properties ep ON e.id = ep.entity_id\n  JOIN dx_catalog_properties p ON p.id = ep.property_id\nWHERE e.identifier = $entity_identifier\n  AND p.identifier = 'tier';",
        "filter_sql": null,
        "filter_message": null,
        "output_enabled": false,
        "output_type": null,
        "output_custom_options": null,
        "output_aggregation": null,
        "external_url": null,
        "published": true,
        "level": {
          "id": "mfq00xe2z3vm",
          "name": "Gold"
        }
      }
    ]
  }
}

Errors

This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.

Error Description
not_authed No authentication token provided.
invalid_auth Some aspect of authentication cannot be validated.
e>