How do I enter an authentication code into a oauth2 api request

Hello, I have been stuck on this for days. I am trying to access in python with requests. I know there is a module for the API in python but it has almost no features and I can’t use it for this. Basically, I need to know how to make the request. I’ve tried adding "?code=##### " to it, and I’ve tried adding a header to my request with the code. but I just can’t figure it out. All of these requests just return

{‘errors’: [{‘code’: 1, ‘code_name’: ‘Unauthorized’, ‘detail’: “The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn’t understand how to supply the credentials required.”, ‘id’: ‘083bfdeb-5760-5af8-8aba-63902327e99c’, ‘status’: ‘401’, ‘title’: ‘Unauthorized’}]}

I know this is probably not an issue with the API. and just requests in general. But please any help is appreciated

Authorization code is used only once when you are calling the api to get the actual token after an authorization flow. Then you have to use the access token to make the call. Check how the PHP lib does that flow process (down below in the example):