getOAuthAccessTokenWithHttpInfo method
Retrieve the OAuth access token of a user
Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned.
Note: This method returns the HTTP Response
.
Parameters:
-
String userId (required): The ID of the user for which to retrieve the OAuth access token
-
String provider (required): The ID of the OAuth provider (e.g.
oauth_google
) -
bool paginated: Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated.
-
int limit: Applies a limit to the number of results returned. Can be used for paginating the results together with
offset
. -
int offset: Skip the first
offset
results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction withlimit
.
Implementation
Future<http.Response> getOAuthAccessTokenWithHttpInfo(
String userId,
String provider, {
bool? paginated,
int? limit,
int? offset,
}) async {
// ignore: prefer_const_declarations
final path = r'/users/{user_id}/oauth_access_tokens/{provider}'
.replaceAll('{user_id}', userId)
.replaceAll('{provider}', provider);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (paginated != null) {
queryParams.addAll(_queryParams('', 'paginated', paginated));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (offset != null) {
queryParams.addAll(_queryParams('', 'offset', offset));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}