Skip to content
Account token failing graphql auth
jeremymatthewwerner
OP

10 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

10 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

10 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

10 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

10 months ago

feel free to reach out if you need further clarification


Status changed to Solved brody • 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...