Error on first attempt to retrieve a Doppler secret "invalid auth token"

I just signed up to Doppler and am trying to retrieve a secret value.

I created a new project named trevor. Under the prd config, I added a secret named TEST_SECRET.

Then, under the Access tab, I generated a Service Token for the prd config.

I used the documentation for Secret → Retrieve, to get the PowerShell code snippet to grab the secret value.

$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("authorization", "Bearer xxxxxxxxxxxxxxxx")
$response = Invoke-WebRequest -Uri 'https://api.doppler.com/v3/configs/config/secret?project=trevor&config=prd&name=TEST_SECRET' -Method GET -Headers $headers

All I get in response is:

{
  "messages": [
    "Invalid Auth token"
  ],
  "success": false
}

How do I successfully retrieve a secret? Seems like this should be pretty straightforward.

Solution

Nevermind, I didn’t realize that somehow the Service Token got pasted twice in succession. I didn’t notice that. Maybe it happened when I copied it from the UI? Not entirely sure.

I deleted the old Service Token, generated a new one, and copied / pasted that value, and it’s working (and half the length).