When downloading files you have the ability to use PyChapi to facilitate your downloads. If this is your first time using the Python API, please install PyChapi.
Generating an API Key via Starship
Before you enable auto downloads you will need to generate an API Key via Starship, our onboarding portal. If you do not have permissions to generate API Keys please reach out to your Netflix Contact. To generate an API Key:
- Login to Starship with the same credentials used to access ContentHub.
- Once logged in you will see a page with your user information. Select the 3 dots menu and choose Vendor API Key.Figure A
- You will see the following popup with two values, Client ID and Client Secret.
Once you have your Client ID and Client Secret please let your Netflix Contact know. Additionally you will be able to access the Client ID and Client Secret at any time.
Setting Up PyChapi’s Headless Authentication
Now that you have your API keys you will need to set up PyChapi’s headless authentication. Before you begin this process, please ensure that you have installed PyChapi.
- Run the following chapi commands to save your credentials and API keys for headless authentication.
chapi saveCredentials --clientId <CLIENT_ID> --clientSecret <CLIENT_SECRET> --username <USERNAME/EMAIL> --password <PASSWORD>
Note: For your initial tests you can use your ContentHub Username/email and password for --username and --password arguments. Once you have completed testing, you could use the userid/password for the data IO team or a generic account, e.g firstname.lastname@example.org.
- Enable headless authentication, via CHAPI_AUTH_TYPE environment variable
export CHAPI_AUTH_TYPE=token. Please note this variable will need to be set every session when using <chapi at> commands
- Once credentials are saved and the authentication environment variable is set, all calls made to chapi will use the API key credentials.
- Test things are working by listing the projects you're on
Note: This should not throw any authentication prompts and should show a list of projects. You should now be able to submit a delivery to Netflix.
Enabling Automatic Downloads
Now that headless authentication has been set up and tested we are ready to configure the auto-transfer download.
- One-time setup to initialize the client. This will initialize the client and define the path to which downloads will be rooted.
chapi at init --downloadPath <DOWNLOAD_PATH>
Note: Currently chapi only supports a single download location.
- To verify the client has been initialized successfully, list the project download subscriptions you have access to:
chapi at listSubscriptions
You should see the projects you’ve been onboarded to
- Subscribe for auto-download by following the prompts
chapi at subscribe
- Start the auto-transfer daemon
chapi at start
At this point you are set up to receive downloads.