Step 6: Publish an API

This page applies to Apigeeand Apigee hybrid.

View Apigee Edge documentation.

In this step, you'll publish an API to the portal by performing the following steps:

  1. Create an API proxy from a spec
  2. Create an API product
  3. Publish the API to your portal

Step 1: Create an API Proxy from a spec

Create an API proxy from an OpenAPI Specification that describes the API.

To create an API proxy from an OpenAPI Specification:

Cloud Console UI

  1. In the Apigee in Cloud console, go to the Proxy Development > API proxiespage.

    Go to API proxies

  2. Click Create. The Create a proxywizard opens prompting you to select the type of API proxy to create.

  3. Click in the Proxy templatebox.

  4. Click OpenAPI spec template, Reverse Proxy (most common).

  5. Open the following file in a browser, and then save it:

     https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml 
    
  6. In Step 1 OpenAPI Specs, click Browse.

  7. Navigate to an OpenAPI Spec file you just downloaded, select it, and then click Open.

  8. Click Next.

  9. In Step 2 Proxy details, the fields are prepopulated using values from the OpenAPI Specification. Edit the Descriptionfield as follows: API proxy for hello world.

  10. Click Next.

  11. In Step 3 Flows, select all operations.

  12. Click Next.

  13. In Step 4 Deploy, select the environment to which you want to deploy.

  14. Click OK.

  15. Click Create.

When the proxy is deployed, the Statuscolumn in the Deploymentssection displays a green icon to show that the API proxy revision is deployed. You can hold the pointer over the status icon to see more information about the deployment.

Classic UI

  1. In the Apigee UI, select Develop > API proxies in the left navigation bar to open the API proxies page.
  2. Click Create New.Add API proxy

    The Create Proxy wizard opens prompting you to select the type of API proxy to create.

  3. Under Reverse Proxy (most common) , click Use OpenAPI Spec .Use OpenAPI Spec

    The Use OpenAPI Spec dialog displays.

  4. Copy and paste the following URL in OpenAPI Spec URL field on the URL tab:

     https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml 
    
  5. Click Select . The Create Proxy wizard opens and the Proxy details page is prepopulated using values from the OpenAPI Specification.

    Proxy details page in the Create Proxy wizard, prepopulated with content

  6. Edit the Description field as follows: API proxy for hello world.

  7. Click Next.

  8. On the Policies page:

    • Under Security: Authorization, select Pass through (no authorization).
    • Under Security: Browser, select Add CORS headers.

    Common policies page in the Create Proxy wizard with Pass through and Add CORS headers selected

  9. Click Next.

  10. On the Flowspage, make sure all operations are selected and click Next.Build a Proxy Flows

  11. On the Summarypage, select the environment to which you want to deploy under Optional Deployment.

  12. Click Create and deploy.

On the Summary page, you'll see an acknowledgement that your new API proxy was created successfully and deployed to the selected environment.

Step 2: Create an API product

Create an API product that contains the API resources that you want to expose to your API consumers.

To create an API product:

  1. In the Apigee in Cloud console, go to the Distribution > API productspage.

    Go to API products

  2. Click Create. The Product detailspage is displayed. Enter the Product Details for your API product.

    Field Value
    Name Hello World
    Display Name Hello World
    Description Simple hello world example
    Environment Select environment where API proxy is deployed.
    Access Public
    Automatically approve access requests Enabled
    Quota (leave blank)
    Allowed OAuth Scopes (leave blank)

  3. In the Operationssection, click Add an operationto identify the operations to add to your API product.

    • Under Source, select API proxyand then select Mock-Target-APIfrom the drop-down.
    • Under Operation, enter a forward slash ( / ) in the Pathfield. Ignore the other fields.
  4. Click Saveto save the operation.

  5. Click Saveto save the product.

Step 3: Publish the API to your portal

Publish the API to your portal to enable your customers to learn about and use it.

To publish the API to your portal:

Cloud Console UI

  1. In the Apigee in Cloud console, go to the Distribution > Portalspage.

    Go to Portals

  2. Click in the My first portalrow to open the portal.

  3. Click the APIstab.

  4. Click + API.

  5. For API productselect Hello World.

  6. Select Published (listed in the catalog)to publish the API to your portal.

  7. For Display title, enter Hello World.

  8. For Display image, click Select.

  9. Click Assets.

  10. Click Previewfor home-background.jpg .

  11. Click Select.

  12. For API documentation, to auto-generate API reference documentation from a snapshot of your OpenAPI Specification:

    1. Select OpenAPI document.
    2. Click Select.
    3. Click the URLtab.
    4. Type helloworldin the Spec namefield.
    5. Copy and paste the following URL in the URLfield:
       https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml 
      
    6. Click Select.
  13. Click Save.

Classic UI

  1. In the Apigee UI, navigate to the APIs page in your portal:
    1. Select Publish > Portals in the left navigation bar.
    2. Click in the My first portal row to open the portal.
    3. Click API Catalog to display the APIs page.
  2. Click + .
  3. Select Hello World in the Add an API product to the catalog dialog and click Next .
  4. Under API details , configure the following options:
    • Select Published (listed in the catalog) to publish the API to your portal.
    • For Display image :
      1. Click Select image .
      2. Click home-background.jpg from the list of existing images in the Select image dialog.
      3. Click Select .
      4. Preview the image and click Select .
    • For Categories , enter Get Started and press Enter .

    Leave all other values set to their defaults.

    API details section when adding an API to the portal

  5. Under API documentation , to auto-generate API reference documentation from a snapshot of your OpenAPI Specification:
    1. Select OpenAPI document .
    2. Click Select Document .
    3. Select the Import from a URL tab.
    4. Enter helloworld in the Spec name field.
    5. Copy and paste the following URL in the URL field and press Enter :
       https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml 
      
    6. Click Select .

    API documentation section when adding an API to the portal

  6. Click Save .

Step 4: View the API reference documentation

To view the API reference documentation:

  1. In the Apigee UI, click Live Portalto view the changes in the live portal (or refresh the live portal if it is already open in another tab).
  2. In the live portal:
    1. Click APIsin the top navigation bar to the view published API.
    2. Click the Hello Worldcard to view the API reference documentation.
    3. Give your API a try!

Mock Target API published with Try this API panel

Create a Mobile Website
View Site in Mobile | Classic
Share by: