Facing problem in getting the token using python backend

I am facing issue in getting the access token when I am redirected to redirect URI Although I get the code on URI but instead of access token I get the following error:-{“error”:“Exception when calling LoginApi->token: (401)\nReason: Unauthorized\nHTTP response headers: HTTPHeaderDict({‘Date’: ‘Fri, 23 Aug 2024 10:36:10 GMT’, ‘Content-Type’: ‘application/json’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘keep-alive’, ‘vary’: ‘Origin, Access-Control-Request-Method, Access-Control-Request-Headers’, ‘message’: ‘request failed’, ‘requestid’: ‘170a2913-8f3a-4bda-a3db-bd8b9034ba4d’, ‘x-content-type-options’: ‘nosniff’, ‘x-xss-protection’: ‘1; mode=block’, ‘Cache-Control’: ‘no-cache, no-store, max-age=0, must-revalidate’, ‘pragma’: ‘no-cache’, ‘expires’: ‘0’, ‘strict-transport-security’: ‘max-age=0; includeSubDomains’, ‘x-frame-options’: ‘DENY’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘Set-Cookie’: ‘__cf_bm=Sm1dvu.imZin0U8_Q5_HxFO3YI4GBjUXziXzwdDmrNE-1724409370-1.0.1.1-zOw5lQdggagwd8DuO8NbvO524CKdflbdOAJVfgFHapKXKq5MhrLF03m3tc_l47Bx; path=/; expires=Fri, 23-Aug-24 11:06:10 GMT; domain=.upstox.com; HttpOnly; Secure; SameSite=None, _cfuvid=pZWotSSLUJ2K9yNukAmLH094KU5DevWO6zRRL_Fl5n0-1724409370135-0.0.1.1-604800000; path=/; domain=.upstox.com; HttpOnly; Secure; SameSite=None’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘8b7a75c32fce47d0-BOM’, ‘alt-svc’: ‘h3=":443"; ma=86400’})\nHTTP response body: b’{"status":"error","errors":[{"errorCode":"UDAPI100070","message":"The \‘redirect_uri\’ provided is invalid. Please enter the valid URI and try again.","propertyPath":null,"invalidValue":null,"error_code":"UDAPI100070","property_path":null,"invalid_value":null}]}'\n”}

Please ensure that the redirect URL you entered while creating the app matches exactly. I suggest double-checking for any extra spaces or typos.