How to create Apigee API Proxy?

Pankaj Sharma
pankajtechblogs
Published in
4 min readJul 10, 2021

--

Welcome back, this is a continuation of my previous blog — https://iampankajsharma.medium.com/why-to-use-an-api-gateway-b36c9988f581

We will create an API proxy in Apigee edge.

If we don’t have an Apigee Edge account, we can sign up for a free trial version using the below link and is ready for 30 days evaluation — https://login.apigee.com/sign_up

Or else, let’s sign in to the Edge account — https://login.apigee.com/login

Once we sign in to the Edge account, we are landed on the Apigee edge dashboard.

Apigee Dashboard has two panels Left and Right, which gives us a view of the following:

A left panel has the organization listed here (catallicaws-eval, that's my personal org, and by eval, it shows that it is in evaluation mode), the user can edit the account or sign out.

Below the mentioned Name as Pankaj Sharma, we can see further tabs as.

  • Develop — Used to develop a proxy
  • Publish — Publishing API products, portals, dev programs, and apps.
  • Analyze — provides you the reporting feature on your various proxies.
  • Admin — Used for Administration purpose of account and environments configurations available for proxy deployment.

The right panel gives a view of:
1. Specs — we can import API specs using file/URL or create a new spec which is open API 3 specification (Swagger).
2. API Proxies — we can create or import existing proxies into the account.
3. API Products — Controls the access for the APIs.
4. Portals — We can have all API catalog here and maintain it.
5. Learn more — Link to tutorials tips and documentations.
6. Community — Use to get help from Apigee Community for any questions we might have.

Now, we got a high-level view of Dashboard, let’s proceed to create a proxy.

Create a new Apigee Proxy

We will create a proxy for sample API, readily available to use on the public URL — https://gorest.co.in/.

Let’s click on Api Proxies on the right panel of the dashboard.
It will list two sample proxies for the new accounts and might show a red alert (Environment: stats does not exist). Ignore that alert for now, as Apigee will fix it for us in a while as it’s preparing Test and Prod env for us by default. Thanks to Apigee. :-)

Let’s click on the +Proxy button on the Top Right corner.

Now this gives us a new view with the following options.
1. Reverse Proxy — Which we will use most commonly.
2. SOAP Service — we can create a pass-through for a SOAP API.
3. No Target — Used to create Proxy which will not connect to any backend, usually for mocking purposes.
4. Hosted Target — This lets us run Node.js applications in a native runtime environment hosted by Apigee.
5. Upload proxy bundle — Importing an existing proxy in the organization.

Let’s click on a Reverse proxy for now, and enter the required details as depicted below, and click on Next.

Now, this screen lets us define some common policies for the Proxy we are creating.
1. Security: Authorization using API Key or OAuth2.0 or just a Pass through(No authentication).
2. Impose Quota per API only for proxies that have some authorizations.
3. Adding CORS Headers, to enable browser access to this proxy.

Any of these policies, and many more in the list, we can apply later point as well. Don’t worry about all this, it was just to introduce few features that proxy can provide, and for now, lets select Pass through and click on Next,

Now we assign the virtual host for the proxy here, we can choose HTTPS host or HTTP host depending on our need. We can create more Virtual hosts as well and define the TLS settings for those domains. Not rushing into it, so let’s select default and click next.

Now on Summary view, it tells all the details, and Optional Deployment which we can push either to Prod or test (or any new env added to our account). For now, let's select test and click create and deploy.

Apigee starts on its magic, just hold on for few secs and you should see the URL and deployed environment.

Copy the URL and hit on the browser, you will notice that it gives you a JSON (response from backend server).

Congratulations, we successfully created a proxy for an API of user-service here. :-)

You should also see a button to Edit proxy. Let's click on that now and follow the next blog (https://iampankajsharma.medium.com/how-to-edit-an-apigee-proxy-f064516994c0).

--

--

I am a tech enthusiast, currently working in the IT industry. I love to explore tech stacks, frameworks, and design/develop MS using various design patterns.