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:Jump to solution
yes, you would only be able to make queries relating to the team with a team key
4 Replies
Project ID:
N/A
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
yes, you would only be able to make queries relating to the team with a team key
makes sense