Why does this setting in the CX as Code CLI configuration seem to ignore my OAuth token when attempting to export Architect flows?
I am currently building a Ruby on Rails middleware service to ingest and process Genesys Cloud webhook events. As part of a backup routine, I need to export all Architect flow definitions as JSON files using the CX as Code CLI tool. I have successfully authenticated using my organization ID and client credentials, generating a valid bearer token that works perfectly with Faraday for direct API calls to /api/v2/architect/flows.
However, when I execute the export command, specifically genesys-cloud export --resource-type=architect-flows --output-format=json, the process fails with a 401 Unauthorized error, even though the token is valid. The documentation suggests that the CLI should handle token refresh automatically, but I am unsure if I need to pass the token explicitly via an environment variable like GENESYS_CLOUD_ACCESS_TOKEN.
Here is the snippet of my shell script where the error occurs:
export GENESYS_CLOUD_ORG_ID="my-org-id"
export GENESYS_CLOUD_ACCESS_TOKEN="$TOKEN"
genesys-cloud export --resource-type=architect-flows --output-format=json
The error log indicates that the request is being made without an authentication header. Is there a specific configuration flag I am missing, or does the CLI require a different authentication flow compared to the standard REST API? I want to ensure this process is robust for my Sidekiq background jobs.