Browse topics, discover Works With Legrand community!

Error 400 (bad request) for Refresh Token


I do not succeed to get a refresh token, it always end in error 400 (bad request)
See below a debug of the request I make (where I replace clientid, client secret, and access token)

Can you tell what's wrong ?

DEBUG:Starting new HTTPS connection (1):
send: b'POST /token HTTP/1.1\r\nHost:\r\nUser-Agent: python-requests/2.21.0\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Length: 1327\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n'
send: b'grant_type=refresh_token&client_id=MYCLIENTID&client_secret=MYCLIENTSECRET&refresh_token=MYREFRESHTOKEN'
reply: 'HTTP/1.1 400 Bad Request\r\n'


It seems to work on my side

When you generate your access_token, you retrieve a JSON with a new access_token and a refresh_token

Are you sure you are using the refresh_token and not the access_token in your POST refresh_token request ?

Have a good day,

Leslie - Community Manager

Sorry indeed it was a misuse on my side ! thanks

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.


message2 replies
people2 participants