Why am I receiving "The Pipedream Connect token is invalid" error with freshly generated tokens in my curl command?

This topic was automatically generated from Slack. You can find the original thread here.

I keep getting "The Pipedream Connect token is invalid. Please generate a new one and try again." with freshly generated tokens. Any idea why? Here is my curl command:

curl 'https://api.pipedream.com/v1/connect/actions/run' \
  -H 'authorization: Bearer REDACTED' \
  -H 'content-type: application/json' \
  -H 'x-pd-environment: development' \
  --data-raw '{"external_user_id":"asdfasdf","id":"google_sheets-get-values-in-range","configured_props":{"googleSheets":{"authProvisionId":"apn_ABCABCABC"},"sheetId":{"__lv":{"label":"Untitled spreadsheet","value":"1gCKKCknhViK4U6Pp4VZGYGDkuRW2XdyPaCHj3L40P2c"}},"worksheetId":{"__lv":{"label":"Sheet1","value":0}},"range":"A1:E5"}}'

You’re getting that error from the /actions/run call?

What type of token are you sending in the authorization header?

I am sending a connect token in the auth header, which looks like ctok_*****

I need to doublecheck but ctoks might not work as auth in the REST API — are you intending to send the request from a client or server?

I am sending all requests through curl on my terminal, not on a browser

Can you send your access token instead of a Connect Token? I’m curious why you’re sending a Connect Token as auth?

because I inspected the REST call from One SDK, thousands of API integrations and it uses a connect token

Is the app you’re building going to make calls from the client or server?

for now, from the client