Error 401 incorrect user authorization on Modify Channel Information

Just now I tried to use OAuth authorization code flow.
I formatted the url with all needed parameters and redirect_uri=‘http://localhost’.
I opened the url in browser and authorized my app. After that I was redirected to localhost with authorization code in the url.
I used that code to form a new request in python to generate access token according to the api reference and it successfully generated it.
I then tried to just use that newly created token in my code that I posted before to make the last request and it gave me the same error.