My Goal:
Fetch logs via the Railway Public GraphQL API from Project A, but I can’t even retrieve the environmentId using a Project Token.
My Problem: I am using a Windows machine (yeah sry D:) and I tried to test the API in any way with curl and stuff. And ChatGPT wasn't helpful too...
I either get an error because the command is not working on windows or I get something like this:
{@{message=Project Token not found; locations=System.Object[]; path=System.Object[]; extensions=; traceId=2917802231414876688}}
And I am very sure that I copied the project token correctly!
This is one example I tested:
$TOKEN = 'YOUR_PROJECT_TOKEN'
$ENDPOINT = 'https://backboard.railway.com/graphql/v2'
JSON-Body als Here-String (vermeidet alle Quote-Probleme)
$BODY = @'
{"query":"query { projectToken { projectId environmentId } }"}
'@
Invoke-RestMethod -Method POST -Uri $ENDPOINT -Headers @{ 'Project-Access-Token' = $TOKEN }
-ContentType 'application/json' `
-Body $BODY
Sry I am new to this type of api. In general I learned how to use REST APIs 1 month ago. So I hope you guys are not mad D: