Base URL
The Base URL widget is a crucial element in Theneo's web editor, enabling you to clearly specify the root URL(s) for API requests. Here's how to use it:
- Insert the Widget: In your documentation, navigate to the place where you want to mention the base URL. On a new line, type
/base urland select the Base URL widget from the dropdown. - Edit Base URL: To edit the base URL, click the edit icon in the base URL widget or open the More Actions menu in the API Management widget and select the Base URL configuration option. A dialog box will appear, allowing you to add or modify URLs for different environments, such as Production and Sandbox.
- Save Environment URLs: Enter the title for each environment and the corresponding URL. For example, you could have "Production" with the URL
http://api.example.comand "Sandbox" with the URLhttp://sandbox.api.example.com. - Automatic Updates: Once you save your base URLs, they will be dynamically updated across all sections of your documentation. If you adjust the base URL, the changes will reflect throughout the documentation without the need for manual updates in each section.
- API Explorer Synchronization: The base URL also synchronizes with the API explorer, allowing users to switch between environments like Sandbox and Production effortlessly while trying out API calls.
Managing Base URLs
Default Setup
By default, your documentation includes a Production environment with a sample base URL:
http://example.io.
Adding Multiple Base URLs
You can enhance your documentation by configuring multiple base URLs within the same environment. For instance, under the Production environment, you can define two distinct base URLs such as http://example.io and http://example.prod.io. Follow these steps to add and customize base URLs:
Adding New Environments
You can create unlimited environments tailored to your API needs, such as “Sandbox,” “Testing,” or “Staging.” Here’s how to define multiple environments:
Customizing Environment Settings
Each environment can have its own set of base URLs and configurations, allowing you to align them with your development, staging, or production workflows.
Benefits of Configuring Base URLs and Environments
- Flexibility to manage multiple base URLs under a single environment.
- Seamless switching between environments for different stages of API development.
- Centralized configuration improves collaboration and consistency across your documentation.
- Updates are instantly reflected in both the editor and published documentation, ensuring accuracy.
FAQ:
- Can I edit the name of the environment? Yes, you can. By default, sample environment names are provided, but you have the flexibility to update and customize them to suit your preferences.
- Will I need to update the base URL in every section if it changes? No, once you update the base URL in the widget, it will automatically reflect across all sections of your documentation, saving you time and ensuring consistency.
What made this section unhelpful for you?
Base URL
Production:
Sandbox: