R
Railway6mo ago
Arctic

Railway API problems

Hey everyone. Im trying to access railway api. what im i doing wrong? const response = await fetch( 'https://backboard.railway.app/graphql/v2', { method: 'POST', headers: { Authorization: Bearer ${RAILWAY_API_KEY}, 'Content-Type': 'application/json' }, body: JSON.stringify({ query: 'query { me { name email } }' }) } ); if (!response.ok) { throw new Error('Network response was not ok'); } const res = await response.json(); console.log(res); this is the console.log(res) POST /api/railway 200 in 456ms { errors: [ { message: 'Not Authorized', locations: [Array], path: [Array], extensions: [Object] } ], data: null }
Solution:
yes, you would only be able to make queries relating to the team with a team key
Jump to solution
4 Replies
Percy
Percy6mo ago
Project ID: N/A
Arctic
ArcticOP6mo ago
N/A Oh and yes i have logged my api key and it gets properly returned. ok i created a new api key and it worked. Could the problem be that my first API Key was a team key?
Solution
Brody
Brody6mo ago
yes, you would only be able to make queries relating to the team with a team key
Arctic
ArcticOP6mo ago
makes sense
Want results from more Discord servers?
Add your server