{"id":26426377,"url":"https://github.com/pavelsr/api-google","last_synced_at":"2025-03-18T03:29:45.549Z","repository":{"id":56832686,"uuid":"73321637","full_name":"pavelsr/API-Google","owner":"pavelsr","description":"https://metacpan.org/pod/WebService::GoogleAPI::Client","archived":false,"fork":false,"pushed_at":"2022-07-29T18:06:57.000Z","size":28,"stargazers_count":3,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-20T22:28:22.395Z","etag":null,"topics":["google-api","offline-mode","perl"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/API::Google","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavelsr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-09T21:12:22.000Z","updated_at":"2021-07-21T07:57:25.000Z","dependencies_parsed_at":"2022-09-08T05:11:24.693Z","dependency_job_id":null,"html_url":"https://github.com/pavelsr/API-Google","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelsr%2FAPI-Google","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelsr%2FAPI-Google/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelsr%2FAPI-Google/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavelsr%2FAPI-Google/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavelsr","download_url":"https://codeload.github.com/pavelsr/API-Google/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244149605,"owners_count":20406398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-api","offline-mode","perl"],"created_at":"2025-03-18T03:29:45.073Z","updated_at":"2025-03-18T03:29:45.538Z","avatar_url":"https://github.com/pavelsr.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nAPI::Google - Perl library for easy access to Google services via their API\n\n# VERSION\n\nversion 0.12\n\n# SYNOPSIS\n\n    use API::Google;\n    my $gapi = API::Google-\u003enew({ tokensfile =\u003e 'config.json' });\n    \n    $gapi-\u003erefresh_access_token_silent('someuser@gmail.com');\n    \n    $gapi-\u003eapi_query({ \n      method =\u003e 'post', \n      route =\u003e 'https://www.googleapis.com/calendar/v3/calendars/'.$calendar_id.'/events',\n      user =\u003e 'someuser@gmail.com'\n    }, $json_payload_if_post);\n\n# CONFIGURATION\n\nconfig.json must be structured like:\n\n    { \"gapi\":\n      {\n        \"client_id\": \"001122334455-abcdefghijklmnopqrstuvwxyz012345.apps.googleusercontent.com\",\n        \"client_secret\": \"1ayL76NlEKjj85eZOipFZkyM\",\n        \"tokens\": {\n            \"email_1@gmail.com\": {\n                \"refresh_token\": \"1/cI5jWSVnsUyCbasCQpDmz8uhQyfnWWphxvb1ST3oTHE\",\n                \"access_token\": \"ya29.Ci-KA8aJYEAyZoxkMsYbbU9H_zj2t9-7u1aKUtrOtak3pDhJvCEPIdkW-xg2lRQdrA\"\n            },\n            \"email_2@gmail.com\": {\n                \"access_token\": \"ya29.Ci-KAzT9JpaPriZ-ugON4FnANBXZexTZOz-E6U4M-hjplbIcMYpTbo0AmGV__tV5FA\",\n                \"refresh_token\": \"1/_37lsRFSRaUJkAAAuJIRXRUueft5eLWaIsJ0lkJmEMU\"\n            }\n        }\n      }\n    }\n\n    You can easily generate such config with goauth CLI tool inluded in this package\n\n# SUBROUTINES/METHODS\n\n## refresh\\_access\\_token\\_silent\n\nGet new access token for user from Google API server and store it in jsonfile\n\n## build\\_headers\n\nKeep access\\_token in headers always actual \n\n    $gapi-\u003ebuild_http_transactio($user);\n\n## build\\_http\\_transaction \n\n    $gapi-\u003ebuild_http_transaction({ \n      user =\u003e 'someuser@gmail.com',\n      method =\u003e 'post',\n      route =\u003e 'https://www.googleapis.com/calendar/users/me/calendarList',\n      payload =\u003e { key =\u003e value }\n    })\n\n## api\\_query\n\nLow-level method that can make API query to any Google service\n\nRequired params: method, route, user \n\nExamples of usage:\n\n    $gapi-\u003eapi_query({ \n        method =\u003e 'get', \n        route =\u003e 'https://www.googleapis.com/calendar/users/me/calendarList'',\n        user =\u003e 'someuser@gmail.com'\n      });\n\n    $gapi-\u003eapi_query({ \n        method =\u003e 'post', \n        route =\u003e 'https://www.googleapis.com/calendar/v3/calendars/'.$calendar_id.'/events',\n        user =\u003e 'someuser@gmail.com'\n    }, $json_payload_if_post);\n\n# AUTHOR\n\nPavel Serikov \u003cpavelsr@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2016 by Pavel Serikov.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavelsr%2Fapi-google","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavelsr%2Fapi-google","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavelsr%2Fapi-google/lists"}