Situation
I’m trying to call the api/v2/tasks endpoint. I’m using my runner launch token to make this call. The documentation says that this is supported.
Result
The request fails with the message: 'unauthorized'
My request looks like this:
fetch("https://runner.circleci.com/api/v2/tasks?resource-class=test-namespace/test-resource", {
headers: { Authorization: "Bearer XXXXXXXXXXXXX" },
})
This request works fine if I use my personal token, like this:
fetch("https://runner.circleci.com/api/v2/tasks?resource-class=test-namespace/test-resource", {
headers: { "Circle-Token": "XXXXXXXXXXXXX" },
})
…but I can’t do this for the project I’m working on.
For my launch token, I am using the token I generated in the process of setting up a self-hosted runner.
Please help!