Вот как вы можете ответить на свой вопрос для Google.
Сначала вы подключаетесь к веб-приложению Google API Explorer: https://developers.google.com/apis-explorer/#p/
Эта веб-страница помогает вам просматривать множество API Google.,Итак, ищите API с именем API Discovery Service .Он будет отвечать API, который предоставляет информацию о других API Google, таких как доступные API, ресурсы и сведения о методах для каждого API .
. Поэтому, чтобы получить список всехAPI, вы можете вызвать точку входа list этой службы обнаружения API здесь: https://www.googleapis.com/discovery/v1/apis?preferred=true
Вот начало результата:
{
"kind": "discovery#directoryList",
"discoveryVersion": "v1",
"items": [
{
"kind": "discovery#directoryItem",
"id": "abusiveexperiencereport:v1",
"name": "abusiveexperiencereport",
"version": "v1",
"title": "Abusive Experience Report API",
"description": "Views Abusive Experience Report data, and gets a list of sites that have a significant number of abusive experiences.",
"discoveryRestUrl": "https://abusiveexperiencereport.googleapis.com/$discovery/rest?version=v1",
"icons": {
"x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
"x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
},
"documentationLink": "https://developers.google.com/abusive-experience-report/",
"preferred": true
},
[...]
На каждомиз этих API, перечисленных в предыдущем вызове, поле discoveryRestUrl дает вам URL-адрес, по которому вы можете получить информацию, такую как точка входа соответствующего API.
Например, вы можете обнаружить, чтоGMail API описывается здесь: https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest
В выводе извлеките часть OAuth2 из записи auth , чтобы получить области действия:
"auth": {
"oauth2": {
"scopes": {
"https://mail.google.com/": {
"description": "Read, compose, send, and permanently delete all your email from Gmail"
},
"https://www.googleapis.com/auth/gmail.compose": {
"description": "Manage drafts and send emails"
},
"https://www.googleapis.com/auth/gmail.insert": {
"description": "Insert mail into your mailbox"
},
"https://www.googleapis.com/auth/gmail.labels": {
"description": "Manage mailbox labels"
},
"https://www.googleapis.com/auth/gmail.metadata": {
"description": "View your email message metadata such as labels and headers, but not the email body"
},
"https://www.googleapis.com/auth/gmail.modify": {
"description": "View and modify but not delete your email"
},
"https://www.googleapis.com/auth/gmail.readonly": {
"description": "View your email messages and settings"
},
"https://www.googleapis.com/auth/gmail.send": {
"description": "Send email on your behalf"
},
"https://www.googleapis.com/auth/gmail.settings.basic": {
"description": "Manage your basic mail settings"
},
"https://www.googleapis.com/auth/gmail.settings.sharing": {
"description": "Manage your sensitive mail settings, including who can manage your mail"
}
}
}
},
В описаниивы также найдете конечную точку для API GMail: https://www.googleapis.com/gmail/v1/users/
Наконец, вы можете получить доступ к этому API с помощью OAuth2.
ПРИМЕЧАНИЕ. Все области, связанные с одним или несколькими API,перечисленные здесь: https://developers.google.com/identity/protocols/googlescopes