This issue is because youâre trying to redeem a code generated in a different API, therefore, to overcome this issue, your codes must be generated at https://api.smartthings.com/v1/oauth/authorize.
Please, let me know if you have additional questions.
Weâve changed the endpoint to https://api.smartthings.com/v1/oauth/authorize, after login with valid credentials weâre getting authorization code and the code is passing to token endpoint then getting invalid authorization code error.
Weâre using the below curl command mentioned in the secure documentation.
Therefore, to have a better reference of the issue youâre having, please share with me a reference of the /authorize request (url used, params sent, headers, etc.).
Also, I noticed that the format of your code is larger than the code I received while replicating the issue, therefore, verify that your request is indeed at https://api.smartthings.com/v1/oauth/authorize
Weâre using the below url with clientId and redirect_url for getting authorization token.weâre not passing any headers and parameters in the url. is it mandatory to pass them?
I noticed that your request is well-formatted, which makes me think that this issue is not related to the API but to the client/browser instead, i.e. your browser has been cached. Therefore, I recommend you try the following steps:
Clear your browserâs cookies and cache or test the OAuth Flow through a fresh Incognito tab.
Recreate your API Access project to refresh your app credentials.
Also, in order to let other community members know that in this thread a solution was found, can you please mark any of your or my comments as a solution? That would be of great help to spread the word.