Importing an API Source

Import an OpenAPI spec to create an API Source

To create an API store, you need to first connect your APIs to MagicAPI.

When a user calls MagicAPI, then MagicAPI will call your APIs using the defined API source and the config.

The API config needs to be defined as an OpenAPI spec. If you don't have an OpenAPI spec yet, you can create one using ChatGPT. You can follow this tutorial with example ChatGPT prompts Create OpenAPI spec using ChatGPT

  1. Click on API Sources on the left side menu. Then click on the "Import Api Source" button.

Click Next to proceed.

  1. Import the OpenAPI YAML or JSON file. You should be able to see the paths imported from the YAML file.

Click Next to proceed.

  1. Enter a name and version for your API Source. All these details are Internal only and will never be exposed to your users.

Click Next to proceed.

  1. Set Custom Header for your API.

You can set custom headers. These are headers that will be set by MagicAPI for every request before being sent to your API. This needs to be a valid JSON key-value map.

Example:

{"source" : "MAGICAPI" }

This can be used to set and kind of headers including Authentication or API keys that are needed by your API Source endpoint.

Click Next to proceed.

  1. Set the Base Path URL.

This is the URL that MagicAPI's backend will call. This is never exposed to end users.

Click Next to proceed.

  1. Set Authentication

You can set Authentication headers using this window. You can use either this or use custom headers to pass Authentication to your API. This is used by MagicAPI to authenticate when calling your API. This is not exposed to users.

You can choose No Auth as well.

Click Next to proceed.

  1. Summary.

Finally, check the Summary of your API Source and click on Submit.

You should see the newly created API Source on the API Sources Page. Next step if to create "Products" with Pricing Plans attached. Click next to learn more.

Last updated