Add a Markdown file as a new page in your portal.
Procedure
- In your API Portal repository, go to the content folder.
-
Create a new Markdown file.
The name of the file is used to create the URL of the page. If you create a file named examples.md, the page will be available at
<portal-url>/examples
. -
Add metadata for your page
The metadata is surrounded with
---
and defines the title of the page and its position on the header. The header displays pages from lowest to highestweight
. If two pages have the sameweight
, they are sorted alphabetically. By default, theweight
of the "Getting started" page is set to 10, and the "APIs" page is set to 20. If you add a new page named "Examples" withweight: 20
, it will appear after "APIs" in the header.Example
--- title: Examples menu: main: weight: 20 ---
-
Add your content under the metadata.
For more information about writing in Markdown, see Markdown Guide.
Example
--- title: Examples menu: main: weight: 20 --- # Examples ## Fetching a book by title 1. Generate an access token. 2. Run the following command with the relevant query parameters: `curl -X GET -H "Authorization:Basic {userToken}" https://company.com/api/books?title={bookTitle}` ### Result A response containing information about the book is returned. For example, the request `https://company.com/api/books?title=Jane+Eyre` returns the following information: ``` json [ { "id": "hfp1651869", "title": "Jane Eyre", "author": "Charlotte Brontë", "publisher": "Penguin", "isbn": "978-0141441146" } ] ```
Tip: If your want to add code samples in your content, you can specify the language after the opening```
to enable syntax highlighting. - Commit your changes.