I have completed steps of authorization and obtained access token and refresh token.
What should I do next to generate access token using refresh token that I have s
It's an old question but seems to me it wasn't completely answered, and I needed this information too so I'll post my answer.
If you want to use the Google Api Client Library, then you just need to have an access token that includes the refresh token in it, and then - even though the access token will expire after an hour - the library will refresh the token for you automatically.
In order to get an access token with a refresh token, you just need to ask for the offline access type (for example in PHP: $client->setAccessType("offline");) and you will get it. Just keep in mind you will get the access token with the refresh token only in the first authorization, so make sure to save that access token in the first time, and you will be able to use it anytime.
Hope that helps anyone :-)