Account token failing graphql auth
jeremymatthewwerner
FREEOP

2 months ago

This is failing with NOT AUTHORIZED:
curl -s -X POST https://backboard.railway.app/graphql/v2 \

-H "Authorization: Bearer YOUR_TOKEN_HERE" \

-H "Content-Type: application/json" \

-d '{"query": "query { me { projects { edges { node { id name services { edges { node { id name } } } } } } } }"}'

even though I am using a user-scoped token I created here:
https://railway.com/account/tokens

For what it's worth I'm still a trial account. Does that matter?

Solved$10 Bounty

Pinned Solution

domehane
FREE

2 months ago

the issue is your query path doesn't exist. you can't do me { projects { ... }}. you need to query through workspace instead:

bash

curl -s -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"query": "query { workspace(workspaceId: \"YOUR_WORKSPACE_ID\") { projects { edges { node { id name services { edges { node { id name } } } } } } } }"}'

get your workspace id by hitting cmd/ctrl + k in the dashboard and searching "copy active workspace id"

trial accounts have full api access so that's not the problem

3 Replies

Railway
BOT

2 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


domehane
FREE

2 months ago

the issue is your query path doesn't exist. you can't do me { projects { ... }}. you need to query through workspace instead:

bash

curl -s -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"query": "query { workspace(workspaceId: \"YOUR_WORKSPACE_ID\") { projects { edges { node { id name services { edges { node { id name } } } } } } } }"}'

get your workspace id by hitting cmd/ctrl + k in the dashboard and searching "copy active workspace id"

trial accounts have full api access so that's not the problem


domehane
FREE

2 months ago

feel free to reach out if you need further clarification


Status changed to Solved brody about 2 months ago


Loading...