getRefresh: Retrieves a Google Analytics refresh token using a...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function retrieves a Google Analytics refresh token using a supplied credentials and code. The function will use GAR_CLIENT_ID, GAR_CLIENT_SECRET environmental variables if present. A refresh token can be traded for an access token repeatedly. As a result, this should only be needed one time unless the refresh token is revoked or lost. The refresh token is stored in an 'GAR_REFRESH_TOKEN' environmental variable.

Usage

1
 getRefresh(client_id, client_secret, code)

Arguments

client_id

Client ID found in API Console. String format.

client_secret

Client Secret found in API Console. String format.

code

Code obtained from the redirect URL provided by the getCode() function. String format.

Details

Function returns a GA refresh token.

Value

Refresh token is a string to be used in conjunction with tokenRefresh() function.

Author(s)

Andrew Geisler

References

https://developers.google.com/analytics/devguides/reporting/core/v3/

See Also

GAR gaRequest getCode getRefresh tokenRefresh

Examples

1
2
3
4
5
getRefresh(
            client_id="ABCDEFG",
            client_secret="HIJKLMNOP",
            code="QRSTUVWX"
            )

GAR documentation built on May 1, 2019, 11:26 p.m.