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 highest weight.
If two pages have the same weight, they are
sorted alphabetically. By default, the weight 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" with weight: 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"
}
]
```
Information noteTip: 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.
Results
Once your portal is deployed, the new page appears. In this example, it looks like this:
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!