add quickstart for api

This commit is contained in:
Pascal Fischer
2023-05-09 12:17:28 +02:00
parent 4d189d2e39
commit 7f5c373631
13 changed files with 66 additions and 120 deletions

View File

@@ -68,7 +68,7 @@ curl -X <%- operation.operation.toUpperCase() %> <%- operation.fullPath %> \\<%
-H 'Accept: application/json' \\<% }; -%> -H 'Accept: application/json' \\<% }; -%>
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>
-H 'Content-Type: application/json' \\<% }; %> -H 'Content-Type: application/json' \\<% }; %>
-H "Authorization: Token <TOKEN>" <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>\\\n--data-raw '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) -%>'<% }; %> -H 'Authorization: Token <TOKEN>' <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>\\\n--data-raw '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) -%>'<% }; %>
\`\`\` \`\`\`
\`\`\`js \`\`\`js

View File

@@ -18,7 +18,7 @@ export const title = 'Accounts'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/accounts \ curl -X GET https://api.netbird.io/api/accounts \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -237,7 +237,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/accounts/{accountId} \ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200

View File

@@ -18,7 +18,7 @@ export const title = 'DNS'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/dns/nameservers \ curl -X GET https://api.netbird.io/api/dns/nameservers \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -298,7 +298,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/dns/nameservers \ curl -X POST https://api.netbird.io/api/dns/nameservers \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "Google DNS", "name": "Google DNS",
"description": "Google DNS servers", "description": "Google DNS servers",
@@ -658,7 +658,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/dns/nameservers/{nsgroupId} \ curl -X GET https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -942,7 +942,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \ curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "Google DNS", "name": "Google DNS",
"description": "Google DNS servers", "description": "Google DNS servers",
@@ -1301,7 +1301,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/dns/nameservers/{nsgroupId}"> <CodeGroup title="Request" tag="DELETE" label="/api/dns/nameservers/{nsgroupId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/dns/nameservers/{nsgroupId} \ curl -X DELETE https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -1460,7 +1460,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/dns/settings \ curl -X GET https://api.netbird.io/api/dns/settings \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -1660,7 +1660,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/dns/settings \ curl -X PUT https://api.netbird.io/api/dns/settings \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"disabled_management_groups": [ "disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0" "ch8i4ug6lnn4g9hqv7m0"

View File

@@ -18,7 +18,7 @@ export const title = 'Events'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/events \ curl -X GET https://api.netbird.io/api/events \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -18,7 +18,7 @@ export const title = 'Groups'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/groups \ curl -X GET https://api.netbird.io/api/groups \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -237,7 +237,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/groups \ curl -X POST https://api.netbird.io/api/groups \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "devs", "name": "devs",
"peers": [ "peers": [
@@ -488,7 +488,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/groups/{groupId} \ curl -X GET https://api.netbird.io/api/groups/{groupId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -711,7 +711,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/groups/{groupId} \ curl -X PUT https://api.netbird.io/api/groups/{groupId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "devs", "name": "devs",
"peers": [ "peers": [
@@ -961,7 +961,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/groups/{groupId}"> <CodeGroup title="Request" tag="DELETE" label="/api/groups/{groupId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/groups/{groupId} \ curl -X DELETE https://api.netbird.io/api/groups/{groupId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -18,7 +18,7 @@ export const title = 'Peers'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers \ curl -X GET https://api.netbird.io/api/peers \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -252,7 +252,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/peers/{peerId} \ curl -X GET https://api.netbird.io/api/peers/{peerId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -508,7 +508,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/peers/{peerId} \ curl -X PUT https://api.netbird.io/api/peers/{peerId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "stage-host-1", "name": "stage-host-1",
"ssh_enabled": true, "ssh_enabled": true,
@@ -777,7 +777,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/peers/{peerId}"> <CodeGroup title="Request" tag="DELETE" label="/api/peers/{peerId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/peers/{peerId} \ curl -X DELETE https://api.netbird.io/api/peers/{peerId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -18,7 +18,7 @@ export const title = 'Policies'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/policies \ curl -X GET https://api.netbird.io/api/policies \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -296,7 +296,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/policies \ curl -X POST https://api.netbird.io/api/policies \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "ch8i4ug6lnn4g9hqv7mg", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "This is a default policy that allows connections between all the resources", "description": "This is a default policy that allows connections between all the resources",
@@ -742,7 +742,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/policies/{policyId} \ curl -X GET https://api.netbird.io/api/policies/{policyId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -1024,7 +1024,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/policies/{policyId} \ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "ch8i4ug6lnn4g9hqv7mg", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "This is a default policy that allows connections between all the resources", "description": "This is a default policy that allows connections between all the resources",
@@ -1473,7 +1473,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/policies/{policyId}"> <CodeGroup title="Request" tag="DELETE" label="/api/policies/{policyId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/policies/{policyId} \ curl -X DELETE https://api.netbird.io/api/policies/{policyId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -1,104 +1,50 @@
import {HeroPattern} from "@/components/HeroPattern"; import {HeroPattern} from "@/components/HeroPattern";
export const description = export const description =
'This guide will get you all set up and ready to use the Protocol API. Well cover how to get started an API client and how to make your first API request.' '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/> <HeroPattern/>
# Quickstart # Quickstart
This guide will get you all set up and ready to use the Protocol API. We'll cover how to get started using one of our API clients 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' }} 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' }}
<Note> ## Install cURL
Before you can make requests to the Protocol API, you will need to grab your
API key from your dashboard. You find it under [Settings &raquo; API](#).
</Note>
## Choose your client 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).
Before making your first API request, you need to pick which API client you will use. In addition to good ol' cURL HTTP requests, Protocol offers clients for JavaScript, Python, and PHP. In the following example, you can see how to install each client. ## Get an access token
<CodeGroup> 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.
```bash {{ title: 'cURL' }}
# cURL is most likely already installed on your machine
curl --version
```
```bash {{ language: 'js' }}
# Install the Protocol JavaScript SDK
npm install @example/protocol-api --save
```
```bash {{ language: 'python' }}
# Install the Protocol Python SDK
pip install protocol_api
```
```bash {{ language: 'php' }}
# Install the Protocol PHP SDK
composer require protocol/sdk
```
</CodeGroup>
<div className="not-prose">
<Button
href="/sdks"
variant="text"
arrow="right"
children="Check out our list of first-party SDKs"
/>
</div>
## Making your first API request ## Making your first API request
After picking your preferred client, you are ready to make your first call to the Protocol API. Below, you can see how to send a GET request to the Conversations endpoint to get a list of all your conversations. In the cURL example, results are limited to ten conversations, the default page length for each client. 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="/v1/conversations"> <CodeGroup tag="GET" label="/api/peers">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -G https://api.protocol.chat/v1/conversations \ curl -X GET https://api.netbird.io/api/peers \
-H "Authorization: Bearer {token}" \ -H 'Accept: application/json' \
-d limit=10 -H 'Authorization: Token <TOKEN>'
```
```js
import ApiClient from '@example/protocol-api'
const client = new ApiClient(token)
await client.conversations.list()
```
```python
from protocol_api import ApiClient
client = ApiClient(token)
client.conversations.list()
```
```php
$client = new \Protocol\ApiClient($token);
$client->conversations->list();
``` ```
</CodeGroup> </CodeGroup>
<div className="not-prose"> <div className="not-prose">
<Button <Button
href="/conversations" href="/peers"
variant="text" variant="text"
arrow="right" arrow="right"
children="Read the docs for the Conversations endpoint" children="Read the docs for the peers endpoint"
/> />
</div> </div>
## What's next? ## 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 Protocol API: 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:
- [Grab your API key from the Protocol dashboard](#) - [Read how to properly authenticate against the NetBird API](/authentication)
- [Check out the Conversations endpoint](/conversations) - [Check out the users endpoint](/users)
- [Learn about the different error messages in Protocol](/errors) - [Learn about the different error types](/errors)

View File

@@ -18,7 +18,7 @@ export const title = 'Routes'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/routes \ curl -X GET https://api.netbird.io/api/routes \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -293,7 +293,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/routes \ curl -X POST https://api.netbird.io/api/routes \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"description": "My first route", "description": "My first route",
"network_id": "Route 1", "network_id": "Route 1",
@@ -592,7 +592,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/routes/{routeId} \ curl -X GET https://api.netbird.io/api/routes/{routeId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -871,7 +871,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/routes/{routeId} \ curl -X PUT https://api.netbird.io/api/routes/{routeId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"description": "My first route", "description": "My first route",
"network_id": "Route 1", "network_id": "Route 1",
@@ -1169,7 +1169,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/routes/{routeId}"> <CodeGroup title="Request" tag="DELETE" label="/api/routes/{routeId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/routes/{routeId} \ curl -X DELETE https://api.netbird.io/api/routes/{routeId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -18,7 +18,7 @@ export const title = 'Rules'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/rules \ curl -X GET https://api.netbird.io/api/rules \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -285,7 +285,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/rules \ curl -X POST https://api.netbird.io/api/rules \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "Default", "name": "Default",
"description": "This is a default rule that allows connections between all the resources", "description": "This is a default rule that allows connections between all the resources",
@@ -594,7 +594,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/rules/{ruleId} \ curl -X GET https://api.netbird.io/api/rules/{ruleId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -865,7 +865,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/rules/{ruleId} \ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "Default", "name": "Default",
"description": "This is a default rule that allows connections between all the resources", "description": "This is a default rule that allows connections between all the resources",
@@ -1177,7 +1177,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/rules/{ruleId}"> <CodeGroup title="Request" tag="DELETE" label="/api/rules/{ruleId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/rules/{ruleId} \ curl -X DELETE https://api.netbird.io/api/rules/{ruleId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -18,7 +18,7 @@ export const title = 'Setup Keys'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/setup-keys \ curl -X GET https://api.netbird.io/api/setup-keys \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -277,7 +277,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/setup-keys \ curl -X POST https://api.netbird.io/api/setup-keys \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "Default key", "name": "Default key",
"type": "reusable", "type": "reusable",
@@ -568,7 +568,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/setup-keys/{keyId} \ curl -X GET https://api.netbird.io/api/setup-keys/{keyId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -831,7 +831,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \ curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "Default key", "name": "Default key",
"type": "reusable", "type": "reusable",

View File

@@ -26,7 +26,7 @@ export const title = 'Tokens'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/users/{userId}/tokens \ curl -X GET https://api.netbird.io/api/users/{userId}/tokens \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -251,7 +251,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/users/{userId}/tokens \ curl -X POST https://api.netbird.io/api/users/{userId}/tokens \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"name": "My first token", "name": "My first token",
"expires_in": 30 "expires_in": 30
@@ -492,7 +492,7 @@ echo $response;
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \ curl -X GET https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -693,7 +693,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/users/{userId}/tokens/{tokenId}"> <CodeGroup title="Request" tag="DELETE" label="/api/users/{userId}/tokens/{tokenId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \ curl -X DELETE https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js

View File

@@ -26,7 +26,7 @@ export const title = 'Users'
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X GET https://api.netbird.io/api/users \ curl -X GET https://api.netbird.io/api/users \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js
@@ -268,7 +268,7 @@ echo $response;
curl -X POST https://api.netbird.io/api/users \ curl -X POST https://api.netbird.io/api/users \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"email": "demo@netbird.io", "email": "demo@netbird.io",
"name": "Tom Schulz", "name": "Tom Schulz",
@@ -561,7 +561,7 @@ echo $response;
curl -X PUT https://api.netbird.io/api/users/{userId} \ curl -X PUT https://api.netbird.io/api/users/{userId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Token <TOKEN>" \ -H 'Authorization: Token <TOKEN>' \
--data-raw '{ --data-raw '{
"role": "admin", "role": "admin",
"auto_groups": [ "auto_groups": [
@@ -813,7 +813,7 @@ echo $response;
<CodeGroup title="Request" tag="DELETE" label="/api/users/{userId}"> <CodeGroup title="Request" tag="DELETE" label="/api/users/{userId}">
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/users/{userId} \ curl -X DELETE https://api.netbird.io/api/users/{userId} \
-H "Authorization: Token <TOKEN>" -H 'Authorization: Token <TOKEN>'
``` ```
```js ```js