Apigee API는 일련의 RESTful 작업으로 API를 프로그래매틱 방식으로 개발하고 관리하는 데 사용할 수 있습니다.
Apigee API를 사용하여 API 프록시 관리를 조직의 소프트웨어 개발 수명 주기(SDLC)에 통합할 수 있습니다.
Apigee API은 API 프록시를 배포하는 스크립트나 코드를 작성하거나, 다른 애플리케이션을 배포하거나 마이그레이션하는 대규모 자동화 프로세스의 일환으로 API 프록시를 다른 환경으로 마이그레이션하는 스크립트나 코드를 작성하는 용도로 흔히 쓰입니다.
Apigee API가 사용 설정되었는지 확인합니다. 프로젝트에 API를 사용 설정하는 가장 간단한 방법은 Google Cloud 콘솔을 사용하는 것입니다. 자세한 내용은 1단계: API 사용 설정을 참조하세요.
OAuth 2.0 액세스 토큰 가져오기
Apigee API는 사용자 인증을 위해 OAuth 2.0을 지원합니다. OAuth 2.0을 사용하면 Google Cloud 사용자 인증 정보를 액세스 토큰으로 교환하여 Apigee API를 안전하게 호출하는 데 사용할 수 있습니다. 토큰을 받으면 토큰이 만료될 때까지 사용자 인증 정보를 다시 교환할 필요가 없습니다.
Google Cloud 사용자 인증 정보를 사용하여 토큰 가져오기
Google Cloud 사용자 인증 정보를 사용하여 토큰을 가져오려면 다음 안내를 따르세요.
Google 사용자 인증 정보로 Cloud Platform에 액세스하도록 gcloud를 승인합니다.
gcloud auth login
현재 활성 계정의 토큰을 가져옵니다.
export TOKEN=$(gcloud auth print-access-token)
Apigee API를 호출할 때 Authorization 헤더에 액세스 토큰을 전달합니다.
예를 들면 다음과 같습니다.
[[["이해하기 쉬움","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)."]]