Oauth/tickets create ticket API endpoint returns a ticket with Authorized: null

I’m sending a POST request to https://api.netlify.com/api/v1/oauth/tickets?client_id={clientId}, but I’m getting data like the following:

{
"id": "{ticketId}",
"client_id": "{clientId}",
"created_at": "2020-02-13T22:33:26.338Z",
"authorized": null

}

I don’t understand why the ticket is coming back as not authorized. It looks like this is preventing me from completing subsequent request to get the access token. What could be causing this

Can you tell us more about what you are trying to accomplish, @hanoitower ? Perhaps there’s a different workflow you could be using, or maybe this is a bug, but best to start from something like “I’m trying to programatically create access tokens so I can XXX with Netlify’s service” (but expand “XXX” as much as possible, please!) so we can give you the best advice.

The documentation here is not clear. After creating the Ticket, I had to go to https://app.netlify.com/authorize?response_type=ticket&ticket=${ticket.id} with my ticket, and authorize through the UI before I could my ticket to create the access token.

The way I found this out is by looking at the https://github.com/netlify/js-client Readme. This flow needs to be clearly documented - the open api documentation didn’t have any details about this additional step.

It’s also unclear how to use Personal Access Tokens though you can generate them through the UI.

Yea, as mentioned in this post: [Common Issue] Understanding and using Netlify's API, the best way to learn how to use our API is to watch how our UI (app.netlify.com) does things. That said, I’m glad you found the info you needed in the js-client readme.

For those Personal Access Token, you can set those in an ‘Authorization’ header when invoking our API endpoints. The value will look like: Authorization: bearer <personal access token>

Hope that helps.