I am working on setting up a 3 step API call to request Google refresh token. In order for that to happen, the end user must be redirected to an website external website where the user need to log in with their google account. Then, Use the returned google code in the returned page URL to be the first parameter used in Step 1 of the API. Then, the returned data of API 1 will be used to initialize the second API.
The process looks like that
-
-
- Step 1 : Redirect user to this external website something like this
-
-
- Once logged in with google, the user is redirected back to my website with a page URL that looks like that
https:// ssm9225 .preview. drapcode. io/dashboard?code=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXXXXXXX&scope=email+profile+https%3A%2F%2Fwww. googleapis. com%2Fauth%2Fyoutubepartner+https%3A%2F%2Fwww. googleapis .com%2Fauth%2Fuserinfo.email+openid+https%3A%2F%2Fwww. googleapis. com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=none
-
- The Code value in the page URL will be needed to initialize the first API
My question is how to extract the code value from the page URL ??
Please help