g4g_exchangeCodeForToken()

*//////////////////////////////////////////////////////////////*

* g4g_exchangeCodeForToken - Exchange Code for Token *

* *

* Output: *

* Out_errMsg - The error message (if error exists). *

* *

* Returns: *

* -1 for error, 0 for success *

* *

* Settable Variables ([r]=required) *

* id - Google ID [r] *

* service - The service to register [r] *

* state_code - The state code returned from *

* g4g_getRegistrationURL [r] *

* ccsid - The CCSID to use (1208) *

* debug - Turn on Debug (*NO, *YES) *

* debug_file - The debug file name. *

* (/tmp/g4g_[id]_exchangeCodeForToken.txt) *

* *

*//////////////////////////////////////////////////////////////*

D g4g_exchangeCodeForToken...

D PR 10i 0

D Out_errMsg 256 Options(*NOPASS)

g4g_exchangeCodeForToken is used to retrieve an OAuth token (and other information). If successful, the user will be set up to use the service with the account that was registered.

Returns: 0 for successful creation, -1 for error.

Output Parameters:

  • Out_errorMsg - An error message if an error was encountered.

Settable Variables:

  • id - Google ID [required]

  • service - The service to register [required]

  • state_code - The state code returned from g4g_getRegistrationURL() [required]

  • ccsid - The CCSID to use (1208)

  • debug - Turn on Debug (*NO, *YES)

  • debug_file - The debug file name. The default is /tmp/g4g_[id]_getRegistrationURL.txt)