AIOS DNA

API Code Examples

Code examples for using the AIOS DNA API

API Code Examples

Code examples for using the AIOS DNA API in different languages.

cURL

List Kernels

bash
curl -X GET https://api.aiosdna.com/api/kernels \
-H "Authorization: Bearer your-token"

Create Workflow

bash
curl -X POST https://api.aiosdna.com/api/workflows \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{
"name": "my-workflow",
"steps": []
}'

Python

python
import requests
headers = {
"Authorization": "Bearer your-token"
}
# List kernels
response = requests.get(
"https://api.aiosdna.com/api/kernels",
headers=headers
)
kernels = response.json()
# Create workflow
workflow_data = {
"name": "my-workflow",
"steps": []
}
response = requests.post(
"https://api.aiosdna.com/api/workflows",
headers=headers,
json=workflow_data
)

JavaScript

javascript
const token = 'your-token';
const headers = {
'Authorization': `Bearer ${token}`
};
// List kernels
fetch('https://api.aiosdna.com/api/kernels', { headers })
.then(res => res.json())
.then(kernels => console.log(kernels));
// Create workflow
fetch('https://api.aiosdna.com/api/workflows', {
method: 'POST',
headers: {
...headers,
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'my-workflow',
steps: []
})
});

Next Steps

Was this helpful?