#!/usr/bin/env python3
"""Get custom_labels from app."""
import json, sys, urllib.request

BASE = "http://localhost:8000/api/v1"
TOKEN = "2|IqbpR94lOiexx5gXHV3BO31utUhuqwi9Y5T2lLCe1505d5d4"
APP_UUID = "bjcuhkadno0onqp2dltlfuek"

req = urllib.request.Request(BASE + f"/applications/{APP_UUID}", method="GET")
req.add_header("Authorization", f"Bearer {TOKEN}")
req.add_header("Accept", "application/json")
with urllib.request.urlopen(req, timeout=60) as resp:
    r = json.loads(resp.read().decode())
print("=== custom_labels ===")
print(r.get('custom_labels'))
