Files
netbird-docs/src/pages/quickstart.mdx
2023-05-09 12:17:28 +02:00

51 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {HeroPattern} from "@/components/HeroPattern";
export const description =
'This guide will get you all set up and ready to use the NetBird API. Well cover how to get started and how to make your first API request.'
<HeroPattern/>
# Quickstart
This guide will get you all set up and ready to use the NetBird API. We'll cover how to get started using cURL and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API. {{ className: 'lead' }}
## Install cURL
For this guide, we'll be using cURL to make our first API request. If you don't already have cURL installed, you can download it from the [cURL website](https://curl.se/download.html).
## Get an access token
Before making your first API request, you need to create an access token to authenticate requests to the API. You can create an access token in the [Netbird dashboard](https://app.netbird.io) under [Users &raquo; Me](https://app.netbird.io/users).
After the token was created successfully make sure to store it as we need it for the next step.
## Making your first API request
After creating your access token, you are ready to make your first call to the NetBird API. Below, you can see how to send a GET request to the peers endpoint to get a list of all peers in your network.
<CodeGroup tag="GET" label="/api/peers">
```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>'
```
</CodeGroup>
<div className="not-prose">
<Button
href="/peers"
variant="text"
arrow="right"
children="Read the docs for the peers endpoint"
/>
</div>
## What's next?
Great, you're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further into the NetBird API:
- [Read how to properly authenticate against the NetBird API](/authentication)
- [Check out the users endpoint](/users)
- [Learn about the different error types](/errors)