Googleapis Client
Library ini di buat agar mempermudah kalian menggunakan googleapis karena library official sulit terutama bagi orang baru / awam / pemula.
Membuat Secret Api Key
- Service Account
- Buka browser kamu console.cloud.google.com
- Bikin Project / Pilih Project
- Buka Tab Api & services
- Tap Create Credentials
- Pilih Service Account
instruksi Full Silahkan liat video di bawah ini
create_service_account_googleapis.webm
Install library
dart pub add googleapis_client
Add Library
import 'package:googleapis_client/googleapis_client.dart';
Documentation
Jika kamu tidak memiliki banyak kuota internet kamu bisa melihat dokumentasi menggunakan cara ini
git clone https://github.com/azkadev/googleapis_client.git
cd googleapis_client
cd web
flutter clean
flutter pub get
flutter run
Quickstart
import 'dart:convert';
import 'package:googleapis_client/googleapis_client.dart';
void prettyPrint(dynamic data) {
if (data is Map || data is List) {
print(JsonEncoder.withIndent(" " * 2).convert(data));
} else {
print(data.toString());
}
}
void main(List<String> args) async {
GoogleApisClient googleApisClient = GoogleApisClient(
googleApisClientApiKey: GoogleApisClientApiKey(
{
"type": "service_account",
"project_id": "nod",
"private_key_id": "",
"private_key": "-----BEGIN -----END PRIVATE KEY-----\n",
"client_email": "mkkm",
"client_id": "1580",
"auth_uri": "https://o/oauth2/auth",
"token_uri": "https:/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "",
"universe_domain": "",
},
),
);
await googleApisClient.youtube.subscribeChannel(channel: "@azkadev");
await googleApisClient.youtube.addComment(videoId: "HV4kn5j7IwQ", text: "Hai ini pesan automatis");
// with dart class scheme
await googleApisClient.request(
requestData: YoutubeGetChannel.create(
special_type: "youtubeGetChannel",
channel_id: "@azkadev",
),
);
// with dart class scheme
await googleApisClient.request(
requestData: JsonApis({
"@type": "youtubeSubscribeChannel",
"@client_channel": "",
"channel_id": "@azkadev",
}),
);
await googleApisClient.request(
requestData: JsonApis({
"@type": "gmailSendMessage",
"email_id": "email@gmail.com",
"text": "",
}),
);
}
Example client use this library
Libraries
- apis/apis
- apis/gmail_forward_message
- apis/gmail_send_message
- apis/json_dart
- apis/youtube_get_channel
- apis/youtube_get_channel_by_video
- apis/youtube_get_channel_full_info
- apis/youtube_get_channel_video
- apis/youtube_get_query_suggestions
- apis/youtube_get_video
- apis/youtube_get_video_comments
- apis/youtube_subscribe_channel
- apis/youtube_unsubscribe_channel
- gmail/gmail
- gmail/gmail_core
- google_apis_client_key
- googleapis_client
- googleapis_client_core
- googleapis_client_raw/google_apis_client_raw
- googleapis_client_raw/google_apis_client_raw_core
- packages/google_auth
- packages/google_auth_io
- packages/packages
- scheme/json_dart
- scheme/scheme
- scheme/service_account
- scheme/youtube_channel
- scheme/youtube_channel_full_info
- scheme/youtube_channel_links
- scheme/youtube_channel_thumbnails
- scheme/youtube_channel_videos
- scheme/youtube_schema_text
- scheme/youtube_search_suggestions
- scheme/youtube_search_videos
- scheme/youtube_video
- scheme/youtube_video_comment
- scheme/youtube_video_comments
- scheme/youtube_video_engagement
- scheme/youtube_video_manifest
- scheme/youtube_video_manifest_audio
- scheme/youtube_video_manifest_muxed
- scheme/youtube_video_manifest_stream
- scheme/youtube_video_manifest_video
- scheme/youtube_video_thumbnails
- scopes/scopes
- sheets/sheets
- sheets/sheets_core
- utils/utils
- youtube/youtube
- youtube/youtube_core
- youtube/youtube_no_auth