{"id":13990055,"url":"https://github.com/apigee/api-platform-samples","last_synced_at":"2025-06-19T08:40:42.133Z","repository":{"id":4297870,"uuid":"5429091","full_name":"apigee/api-platform-samples","owner":"apigee","description":"Working samples for the Apigee API Platform","archived":false,"fork":false,"pushed_at":"2024-04-19T16:11:33.000Z","size":27477,"stargazers_count":498,"open_issues_count":44,"forks_count":715,"subscribers_count":196,"default_branch":"master","last_synced_at":"2024-10-29T10:55:08.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apigee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-08-15T17:22:53.000Z","updated_at":"2024-09-19T13:19:50.000Z","dependencies_parsed_at":"2024-08-09T13:21:22.785Z","dependency_job_id":null,"html_url":"https://github.com/apigee/api-platform-samples","commit_stats":{"total_commits":1149,"total_committers":50,"mean_commits":22.98,"dds":0.5491731940818103,"last_synced_commit":"6faefe8d4f0046cca93bbf3eaa533eb1b2415f77"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apigee%2Fapi-platform-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apigee%2Fapi-platform-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apigee%2Fapi-platform-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apigee%2Fapi-platform-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apigee","download_url":"https://codeload.github.com/apigee/api-platform-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227089507,"owners_count":17729478,"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":[],"created_at":"2024-08-09T13:02:19.154Z","updated_at":"2024-11-29T09:30:44.308Z","avatar_url":"https://github.com/apigee.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Apigee Edge sample API proxies\n\n* [Audience](#who)\n* [Intro](#intro)\n* [Before you begin](#before)\n* [Using the sample proxies](#using)\n* [Setting up](#initial)\n* [Deploying a sample proxy](#deploying)\n* [Invoking a sample proxy](#invoking)\n* [Modifying a sample proxy](#modifying)\n* [Bulk deployment](#bulk)\n* [What else is here?](#what)\n* [Ask questions on the Apigee Community](#ask)\n* [Apigee Edge documentation](#docs)\n\n## \u003ca name=\"who\"\u003e\u003c/a\u003eAudience\n\nYou are an Apigee Edge API proxy developer, or you would like to learn about\ndeveloping APIs that run on Apigee Edge. At a minimum, we assume you're familiar\nwith Apigee Edge and how to create simple API proxies. To learn more, we\nrecommend this [getting-started\ntutorial](https://docs.apigee.com/api-platform/get-started/get-started).\n\n\u003e These samples were built to work with Apigee EDGE. The current version of\n\u003e Apigee is known as Apigee X. Most of these samples will work with Apigee X,\n\u003e but the deployment scripts will not, and the instructions for administrative\n\u003e actions (eg, sign up for an account at apigee.com) will not work either. In\n\u003e those cases, you will need to substitute the appropriate actions relating to\n\u003e Apigee X!\n\n\u003e Bear with us, please!\n\n## \u003ca name=\"intro\"\u003e\u003c/a\u003eIntro\n\nThis repository contains a collection of sample API proxies that you can deploy and run on [Apigee Edge](https://apigee.com/api-management/#/products).\n\n![alt text](./images/sample-proxies-1.png)\n\nThe samples provide a jump-start for developers who wish to design and create Apigee Edge API proxies. Each proxy sample includes a `deploy.sh` and `invoke.sh` script. These scripts let you easily deploy and run the proxies.\n\nIn addition, you'll find:\n\n* API proxy schemas that you can reference\n* Tools for deploying proxies to Apigee Edge\n* Cookbook samples, which illustrate specific use cases\n\n\n## \u003ca name=\"before\"\u003e\u003c/a\u003eBefore you begin\n\n1. If you don't have one, you'll need to obtain an Apigee account. [Sign up for a free trial account.](https://accounts.apigee.com/accounts/sign_up)\n\n2. You also need to have [Python](http://python.org/getit/) on your system, to use the deployment tool.\n\n3. Download this project from GitHub to your system.\n\n## \u003ca name=\"using\"\u003e\u003c/a\u003eUsing the sample proxies\n\nMost developers begin by identifying an interesting sample based on a specific use case or need. You'll find the samples in the `./api-platform-samples/sample-proxies` folder. The Apigee doc site also has a handy [samples overview page](https://docs.apigee.com/api-platform/samples/samples-reference).\n\n\nFor example, if you're interested in doing XML to JSON transformations, check out `api-platform-samples/sample-proxies/xmltojson`.\n\n## \u003ca name=\"initial\"\u003e\u003c/a\u003eSetting up\n\nSet up your deployment environment.\n\n1. Open the file `./api-platform-samples/setup/setenv.sh` in a text editor.|\n\n2. Edit the file with your Apigee Edge account settings and save it. For example:\n\n    ```\n    org=myorg\n    username=jdoe@example.com\n    url=\"https://api.enterprise.apigee.com\"\n    env=test\n    api_domain=\"apigee.net\"\n    ```\n\n\n## \u003ca name=\"deploying\"\u003e\u003c/a\u003eDeploying a sample proxy\n\nWe make it easy:\n\n1. Be sure you've updated `./api-platform-samples/setup/setenv.sh` as explained previously.\n\n2. cd to one of the sample proxy folders in `./api-platform-samples/sample-proxies`.\n\n3. Be sure you can execute the `deploy.sh` script. For example:\n\n   `chmod 744 deploy.sh`\n\n4. Execute the deploy script.\n\n    `./deploy.sh`\n\n**Note:** If you already have the proxy deployed, the script will undeploy it first, then redeploy a new revision.\n\nOutput like this means a successful deployment:\n\n```\n    Imported new proxy version 3\n    Undeploying revision 2 in same environment and path:\n    Environment: test\n      Revision: 3 BasePath = /\n      State: error\n    If 'State: deployed', then your API Proxy is ready to be invoked.\n    Run 'invoke.sh'\n```\n\n## \u003ca name=\"invoking\"\u003e\u003c/a\u003eInvoking a sample proxy\n\nWe make this easy too! Each sample API proxy directory contains a script, `invoke.sh`, that issues a sample HTTP request to the API. Deploy the proxy and follow these steps:\n\n1. Be sure you've updated `./api-platform-samples/setup/setenv.sh` as explained previously.\n\n2. cd to one of the sample proxy folders in `./api-platform-samples/sample-proxies`.\n\n3. Be sure you can execute the `invoke.sh` script. For example:\n\n   `chmod 744 invoke.sh`\n\n4. Open the `invoke.sh` file and take a look at the code. Basically, the invoke scripts make `curl` requests to Apigee Edge. In some cases, `invoke.sh` performs other setup tasks, such as creating products, developer apps, and other entities on Edge.\n\n    **Tip:** Always open `invoke.sh` and look through it before executing it -- this will give you valuable insight into how the API proxy is called and any setup steps that are performed.\n\n4. Execute the `invoke.sh` script.\n\n    `./invoke.sh`\n\n\n## \u003ca name=\"modifying\"\u003e\u003c/a\u003eModifying a sample proxy\n\nFeel free to modify and build upon the sample proxies. You can make changes in the Edge management UI or by editing the proxy XML files locally and redeploying. Whichever approach is comfortable for you.\n\n\u003eTip: If you use Sublime for local development, check out the [Sweetlime](https://github.com/apigee/Sweetlime) project on GitHub. Sweetlime is a Sublime plugin for developing API proxies for Apigee Edge.\n\nSimply redeploy the proxies for changes to take effect.\n\n## \u003ca name=\"bulk\"\u003e\u003c/a\u003eBulk deployment\n\nYou can deploy all of the samples to your organization at once using a simple setup script provided in this distribution.\n\n1. Update the file `/setup/setenv.sh` with settings for your Apigee account.\n\n2. Run `deploy_all.sh`\n\n    **Note**: This step deploys all API products, developers, and apps needed for samples that use OAuth.\n\n## \u003ca name=\"what\"\u003e\u003c/a\u003eWhat else is here?\n\nIn addition to the sample proxies, this project includes the following:\n\n### `/learn-edge`\n\nThe Learn Edge series is a hands-on learning experience for beginning Edge developers. Each example is designed to be quick and easy to do, teaches a core Apigee Edge concept or technique, and follows three basic steps:\n\n1. Deploy it.\n2. Run it.\n3. Trace it.\n\nThe best way to learn Apigee Edge is by doing!\n\n### `/schemas`\n\nXML schemas that you can  use as a reference when working with policies, API proxy configuration,\nAPI products, apps, and developers.\n\n\n### `/setup`\n\nSimple scripts to help you deploy the sample API proxies and profiles that they\nrely on, including API products, developers, and apps.\n\nSet you Apigee API Platform account settings in `setenv.sh` ([Register for a free Apigee account](https://docs.apigee.com/api-platform/get-started/creating-apigee-edge-account))\n\nTo deploy a single sample, run `deploy.sh proxyName`, where `proxyName` is the name of the directory under `/sample-proxies` that contains the proxy you want to deploy.\n\nTo deploy all samples and API products, run `deploy_all.sh`\n\n### `/tools`\n\n* `deploy.py`: Uploads an API proxy to an organization on the Apigee Edge API Services platform and then deploys it to the environment specified.\n\n* `proxy_gen.sh`: A simple script that interacts with the API Services platform to locally generate an API proxy scaffold.\n\n* `/org-snapshot`: A configurable tool that retrieves organization settings from the API Services platform by using management server API calls.\n\n## \u003ca name=\"ask\"\u003e\u003c/a\u003eAsk questions on the Apigee Community\n\n[![alt text](./images/apigee-community.png \"Apigee Community is a great place to ask questions and find answers about developing API proxies. \")](https://community.apigee.com?via=github)\n\n## \u003ca name=\"docs\"\u003e\u003c/a\u003eApigee Edge documentation\n\nThe Apigee Edge docs are [here](https://docs.apigee.com).\n\n---\n\nCopyright © 2018 Apigee Corporation, 2024 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may\nnot use this file except in compliance with the License. You may obtain\na copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapigee%2Fapi-platform-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapigee%2Fapi-platform-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapigee%2Fapi-platform-samples/lists"}