Allo there,
The API is currently offline.
https://twitter.com/BungieHelp/status/1656074370195017729?t=xtCmodLDbH-Dg2H28sPyxA&s=19
[quote]We are continuing to monitor various error codes and game stability. To set expectations, Destiny 2 integration features on Bungie.net, including the API, will remain offline overnight.
More information will be provided when available.[/quote]