Apigee API は、一連の RESTful オペレーションを使用してプログラムで API を開発、管理するために使用できます。
Apigee API を使用することで、API プロキシ管理を組織のソフトウェア開発ライフサイクル(SDLC)に統合できます。Apigee API の一般的な用途は、他のアプリケーションのデプロイや移行も行う自動化された大規模なプロセスの一部として、API プロキシをデプロイするスクリプトやコードを作成することや、API プロキシを環境間で移行するスクリプトやコードを作成することです。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-18 UTC。"],[[["\u003cp\u003eThe Apigee API allows for programmatic development and management of APIs using RESTful operations, integrating API proxy management into your organization's SDLC.\u003c/p\u003e\n"],["\u003cp\u003eEnabling the Apigee API is necessary and can be done through the Google Cloud console, as detailed in the documentation.\u003c/p\u003e\n"],["\u003cp\u003eOAuth 2.0 is the authentication method for the Apigee API, requiring you to exchange your Google Cloud credentials for an access token, either through the gcloud command or a service account key.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment variables, such as \u003ccode\u003e$ORG\u003c/code\u003e, \u003ccode\u003e$API\u003c/code\u003e, and \u003ccode\u003e$ENV\u003c/code\u003e, are used throughout the documentation to simplify example API requests and should be set to relevant values for your environment.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecurl\u003c/code\u003e command-line tool is used in the examples to demonstrate API usage, with options like \u003ccode\u003e-H\u003c/code\u003e for headers and \u003ccode\u003e-X\u003c/code\u003e for request type, and will require the use of an OAuth 2.0 access token.\u003c/p\u003e\n"]]],[],null,["*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nThe Apigee API can be used to programmatically develop and manage APIs with a set of RESTful operations.\n\n\nYou can use the Apigee API to integrate API proxy management into your organization's software development lifecycle (SDLC).\nA common usage of the Apigee API is to write scripts\nor code that deploy API proxies or that migrate API proxies from one environment to another, as part of a larger automated process that also\ndeploys or migrates other applications.\n\n\nFor more information, see [Apigee API](/apigee/docs/reference/apis/apigee/rest).\n\nEnabling the Apigee API\n\nEnsure that you have enabled the Apigee API. The simplest way to enable an API for your project\nis to use the Google Cloud console. For complete details, see\n[Step 1: Enable APIs](/apigee/docs/hybrid/latest/precog-enableapi).\n\nObtaining an OAuth 2.0 access token\n\nThe Apigee API supports OAuth 2.0 for user authentication. With OAuth 2.0, you exchange your Google Cloud\ncredentials for an access token that you can then use to make secure calls to the Apigee API. Once\nyou obtain a token, you do not need to exchange your credentials again until the token expires.\n| **Note:** Short-lived service account credentials are useful for scenarios where you need to grant limited access to resources for trusted service accounts, and they reduce the risk compared to using long-lived credentials like service account keys. For more information, see [Generating an OAuth 2.0 access token](/iam/docs/creating-short-lived-service-account-credentials#sa-credentials-oauth).\n\nGet a token using Google Cloud credentials\n\n\nTo get a token using your Google Cloud credentials:\n\n1. Authorize [gcloud](/sdk/docs) to access the Cloud Platform with your Google user credentials: \n\n ```\n gcloud auth login\n ```\n2. Get a token for the currently active account: \n\n ```\n export TOKEN=$(gcloud auth print-access-token)\n ```\n3. When you call an Apigee API, pass the access token in the Authorization header. For example: \n\n ```\n curl \"https://apigee.googleapis.com/v1/organizations\" -H \"Authorization: Bearer $TOKEN\"\n ```\n\nGet a token using a Google Cloud service account key\n\n\nTo get a token using a service account key for authorization:\n\n1. Generate a key for your service account using the Google Cloud console, as described in [Creating and managing service account keys](/iam/docs/creating-managing-service-account-keys).\n\n A JSON file that contains your service account credentials is downloaded to your computer.\n2. Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path where the\n service account key is located:\n\n export GOOGLE_APPLICATION_CREDENTIALS=\u003cvar translate=\"no\"\u003eyour_sa_credentials_file\u003c/var\u003e.json\n\n3. When you call an Apigee API, use the Google Cloud CLI to add an access token to the Authorization header. For example: \n\n ```\n curl \"https://apigee.googleapis.com/v1/organizations\" -H \"Authorization: Bearer $(gcloud auth application-default print-access-token)\"\n ```\n\nSetting environment variables for Apigee API requests\n\n\nThe Apigee API and gcloud CLI examples provided throughout the documentation use one or more of the environment variables defined\nin the following table.\n\nBy setting the environment variables upfront to meaningful values in your environment, you can copy and paste the example requests\nto execute them in your own environment with minimal or no modifications.\n\n| Environment variable | Description |\n|----------------------|----------------------------------------------------------------------------------|\n| `$API` | Name of your API proxy. |\n| `$APIPRODUCT` | Name of the API product. |\n| `$APP` | ID of an app. |\n| `$DEVELOPER_EMAIL` | Email address of the developer. |\n| `$ENV` | Name of your environment, such as `test` or `prod`. |\n| `$ID` | Resource ID. |\n| `$KEY` | Consumer key. |\n| `$NAME` | Name of your resource. |\n| `$ORG` | Your Apigee organization. |\n| `$REV` | Revision number of your API proxy. |\n| `$SHAREDFLOW` | Name of your shared flow. |\n| `$TYPE` | [Resource type](/apigee/docs/api-platform/develop/resource-files#resourcetypes). |\n\nUsing curl\n\nThe examples within this section use [`curl`](https://curl.haxx.se/) to demonstrate how to develop applications\nusing the Apigee API. `curl` is an open source, command-line tool for transferring data\nwith URL syntax, supporting common protocols such as HTTP and HTTPS.\n\nThe following table summarizes the curl command-line options used in the examples.\n\n| Option | Description |\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `-d '{}' --data @`\u003cvar translate=\"no\"\u003efilename\u003c/var\u003e `--data-binary @`\u003cvar translate=\"no\"\u003efilename\u003c/var\u003e | Defines the request body, which you can pass directly or by specifying a filename. |\n| `-F file=@`\u003cvar translate=\"no\"\u003efilename\u003c/var\u003e ` --form file=@`\u003cvar translate=\"no\"\u003efilename\u003c/var\u003e | Defines form-based data that you can pass by specifying a filename. |\n| `-H` `--header` | Defines a request header. You must pass the following information in the request header: - `Authorization` header: OAuth 2.0 token for user authentication, as described in [Obtaining an OAuth 2.0 access token](#oauth20). - `Content-Type` header: Content type of the request body being sent when creating or updating a resource (POST, PATCH, PUT) using the API. |\n| `-X` | Specifies the type of request (GET, POST, and so on). |\n\nFor example: \n\n```\ncurl \"https://apigee.googleapis.com/v1/organizations/$ORG/apis\" \\\n -X GET \\\n -H \"Authorization: Bearer $TOKEN\"\n```\n\nWhere `$TOKEN` is set to your OAuth 2.0 access token, as described in\n[Obtaining an OAuth 2.0 access token](/apigee/docs/api-platform/get-started/api-get-started#oauth20)."]]