Interact with the developer portal

Explore how your end users can use the developer portal to discover, access, and use your API products.

Before you begin

Before giving your end users the developer portal, make sure that you completed all the setup tasks, including the following.

  1. Install and make sure that the portal is healthy, including the portal, external auth, rate limiting, and Redis components.
  2. Create your API products.
  3. Prepare usage plans for your API products, including external auth and rate limiting policies.
  4. Configure the developer portal, including to expose the portal server securely.
  5. Create a frontend for your developer.

Discover your API products

End users can discover API products in your developer portal that they have access to.

  1. To launch the developer portal, your end users enter the hostname that you exposed the portal on, such as developer.example.com, in their web browser.
  2. By default, end users can review the home page. They can see any APIs that you did not require authentication for via external auth policies. If you followed the steps in Configure the developer portal, the tracks and petstore API products are included in the portal. However, only the tracks API is publicly available and can be seen when selecting APIs from the menu bar. The petstore API is set to private and can only be seen after the user logs in to the developer portal.
  3. To review private APIs and perform other actions, such as to create an API key, the end users click Login. They are redirected to the OIDC provider that you configured.
  4. After successfully logging in, the end users can see the public and private APIs that they have access to.
  5. Users can select an API product to see the OpenAPI specification for that API in Swagger or Redoc format. They can review details, such as the API schema, required request parameters, response body information, or supported HTTP response codes.

View usage plans

End users can view the usage plans in the developer portal that you set up for your API products.

  1. To view usage plans, users must click Login to log in to the OIDC provider that you configured.
  2. After successfully logging in, the Login button disappears and the username of the user that is logged in to the developer portal is displayed.
  3. End users can click the username and then select API keys to view the public and private API products that they have access to.
  4. Users select an API product and can view the usage plans that were configured for that API product.

Create an API key to use the API products

To interact with APIs that require API key authentication, end users can use the developer portal to create an API key.

  1. To create an API key, users must follow steps 1 -3 in View usage plans.

  2. Users select the API product that they want to create an API key for. Then, they find the usage plan that requires an API key and click the Add key button or the generate a key link.

  3. In the pop-up window, your users can enter a name for the API key and then click Generate key.

  4. After the API key is generated, it is displayed to the user. The user must copy this API key and store it in a secure place as the API key cannot be accessed anymore after the pop-up window is closed.

  5. To access an API with the API key that was generated, users can review the API docs for a product and send a request to an API, such as the following request to tracks. Replace $API_KEY with the value of the API key that you previously created.

    curl -v -H 'api-key: $API_KEY' http://api.example.com/trackapi/tracks
    

    Example output:

    < HTTP/1.1 200 OK
    ...
       [
      {
        "id": "c_0",
        "thumbnail": "https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg",
        "topic": "Cat-stronomy",
        "authorId": "cat-1",
        "title": "Cat-stronomy, an introduction",
        "description": "Curious to learn what Cat-stronomy is all about? Explore the planetary and celestial alignments and how they have affected our space missions.",
        "numberOfViews": 163,
        "createdAt": "2018-09-10T07:13:53.020Z",
        "length": 2377,
        "modulesCount": 10,
        "modules": [
          "l_0",
          "l_1",
          "l_2",
          "l_3",
          "l_4",
          "l_5",
          "l_6",
          "l_7",
          "l_8",
          "l_9"
        ]
      },
    ...
    

Delete an API key

End users can use the developer portal to remove API keys that are not used anymore.

  1. To delete an API key, users must follow steps 1 -3 in View usage plans.
  2. Users select the API product and usage plan for which they created the API key and then find the API key that they want to remove.
  3. To remove the API key, users click x and confirm the deletion of the API key by clicking Delete.