Skip to content

Add Manage resources section to API reference #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,16 @@
"restapi/api-limits"
]
},
{
"group": "Manage resources",
"pages": [
"restapi/manage-resources/overview",
"restapi/manage-resources/manage-annotations",
"restapi/manage-resources/manage-api-tokens",
"restapi/manage-resources/manage-datasets",
"restapi/manage-resources/manage-users"
]
},
{
"group": "User endpoints",
"pages": [
Expand Down
145 changes: 145 additions & 0 deletions restapi/manage-resources/manage-annotations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: Manage datasets via API
sidebarTitle: "Datasets"
description: "Learn how to manage Axiom datasets via API."
tags: ['axiom documentation', 'documentation', 'axiom', 'axiom api', 'rest api', 'rest', 'authorization', 'headers', 'datasets', 'users', 'monitors', 'notifiers', 'response']
---

import Prerequisites from "/snippets/minimal-prerequisites.mdx"

This page explains how to manage datasets programmatically via the API.

TODO

<Prerequisites />
{/* list separator */}
- [Create an API token in Axiom](/reference/tokens) with permissions to create, read, update, and delete datasets.
- In the code samples below, replace `API_TOKEN` with the Axiom API token you have generated. For added security, store the API token in an environment variable.

## Create datasets

To create a dataset, send a POST request to the `datasets` endpoint. In the body of the request, specify the name and the description of the dataset. For example:

```bash
curl -X 'POST' 'https://api.axiom.co/v2/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN' \
-d '{
"description": "This is a test dataset.",
"name": "test_dataset"
}'
```

The example response contains the dataset ID that you can later use to access the dataset programmatically.

```json
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a test dataset.",
"id": "test_dataset",
"name": "test_dataset",
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/createDataset).

## Get information about datasets

### Get information about all datasets

To get information about all the datasets in your Axiom organization, send a GET request to the `datasets` endpoint. For example:

```bash
curl -X 'GET' 'https://api.axiom.co/v2/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

The example response is a list of dataset objects. Each object contains a unique dataset ID that you can later use to access the dataset programmatically.

```json
[
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a test dataset.",
"id": "test_dataset1",
"name": "test_dataset1",
"who": ""
},
{
"created": "2024-04-20T02:35:24.137Z",
"description": "This is another test dataset.",
"id": "test_dataset2",
"name": "test_dataset2",
"who": ""
}
]
```

For more information, see the [API reference](/restapi/endpoints/getDatasets).

### Get information about specific dataset

To get information about a specific dataset, send a GET request to the `datasets/ID` endpoint where `ID` is the unique ID of the dataset. For example:

```bash
curl -X 'GET' 'https://api.axiom.co/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

Example response:

```json
[
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a test dataset.",
"id": "test_dataset",
"name": "test_dataset",
"who": ""
},
]
```

For more information, see the [API reference](/restapi/endpoints/getDataset).

## Update datasets

To update a dataset, send a PUT request to the `datasets/ID` endpoint where `ID` is the unique ID of the dataset. In the body of the request, specify the properties you want to update. For example:

```bash
curl -X 'PUT' 'https://api.axiom.co/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN' \
-d '{
"description": "This is a production dataset."
}'
```

Example response:

```json
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a production dataset.",
"id": "test_dataset",
"name": "test_dataset",
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/updateDataset).

## Delete datasets

To delete a dataset, send a DELETE request to the `datasets/ID` endpoint where `ID` is the unique ID of the dataset. For example:

```bash
curl -X 'DELETE' 'https://api.axiom.co/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

For more information, see the [API reference](/restapi/endpoints/deleteDataset).
145 changes: 145 additions & 0 deletions restapi/manage-resources/manage-api-tokens.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: Manage datasets via API
sidebarTitle: "Datasets"
description: "Learn how to manage Axiom datasets via API."
tags: ['axiom documentation', 'documentation', 'axiom', 'axiom api', 'rest api', 'rest', 'authorization', 'headers', 'datasets', 'users', 'monitors', 'notifiers', 'response']
---

import Prerequisites from "/snippets/minimal-prerequisites.mdx"

This page explains how to manage datasets programmatically via the API.

TODO

<Prerequisites />
{/* list separator */}
- [Create an API token in Axiom](/reference/tokens) with permissions to create, read, update, and delete datasets.
- In the code samples below, replace `API_TOKEN` with the Axiom API token you have generated. For added security, store the API token in an environment variable.

## Create datasets

To create a dataset, send a POST request to the `datasets` endpoint. In the body of the request, specify the name and the description of the dataset. For example:

```bash
curl -X 'POST' 'https://api.axiom.co/v2/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN' \
-d '{
"description": "This is a test dataset.",
"name": "test_dataset"
}'
```

The example response contains the dataset ID that you can later use to access the dataset programmatically.

```json
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a test dataset.",
"id": "test_dataset",
"name": "test_dataset",
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/createDataset).

## Get information about datasets

### Get information about all datasets

To get information about all the datasets in your Axiom organization, send a GET request to the `datasets` endpoint. For example:

```bash
curl -X 'GET' 'https://api.axiom.co/v2/datasets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

The example response is a list of dataset objects. Each object contains a unique dataset ID that you can later use to access the dataset programmatically.

```json
[
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a test dataset.",
"id": "test_dataset1",
"name": "test_dataset1",
"who": ""
},
{
"created": "2024-04-20T02:35:24.137Z",
"description": "This is another test dataset.",
"id": "test_dataset2",
"name": "test_dataset2",
"who": ""
}
]
```

For more information, see the [API reference](/restapi/endpoints/getDatasets).

### Get information about specific dataset

To get information about a specific dataset, send a GET request to the `datasets/ID` endpoint where `ID` is the unique ID of the dataset. For example:

```bash
curl -X 'GET' 'https://api.axiom.co/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

Example response:

```json
[
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a test dataset.",
"id": "test_dataset",
"name": "test_dataset",
"who": ""
},
]
```

For more information, see the [API reference](/restapi/endpoints/getDataset).

## Update datasets

To update a dataset, send a PUT request to the `datasets/ID` endpoint where `ID` is the unique ID of the dataset. In the body of the request, specify the properties you want to update. For example:

```bash
curl -X 'PUT' 'https://api.axiom.co/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN' \
-d '{
"description": "This is a production dataset."
}'
```

Example response:

```json
{
"created": "2024-04-20T02:35:14.137Z",
"description": "This is a production dataset.",
"id": "test_dataset",
"name": "test_dataset",
"who": ""
}
```

For more information, see the [API reference](/restapi/endpoints/updateDataset).

## Delete datasets

To delete a dataset, send a DELETE request to the `datasets/ID` endpoint where `ID` is the unique ID of the dataset. For example:

```bash
curl -X 'DELETE' 'https://api.axiom.co/v2/datasets/test_dataset' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer API_TOKEN'
```

For more information, see the [API reference](/restapi/endpoints/deleteDataset).
Loading