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
bashcurl -X GET https://api.aiosdna.com/api/kernels \-H "Authorization: Bearer your-token"
Create Workflow
bashcurl -X POST https://api.aiosdna.com/api/workflows \-H "Authorization: Bearer your-token" \-H "Content-Type: application/json" \-d '{"name": "my-workflow","steps": []}'
Python
pythonimport requestsheaders = {"Authorization": "Bearer your-token"}# List kernelsresponse = requests.get("https://api.aiosdna.com/api/kernels",headers=headers)kernels = response.json()# Create workflowworkflow_data = {"name": "my-workflow","steps": []}response = requests.post("https://api.aiosdna.com/api/workflows",headers=headers,json=workflow_data)
JavaScript
javascriptconst token = 'your-token';const headers = {'Authorization': `Bearer ${token}`};// List kernelsfetch('https://api.aiosdna.com/api/kernels', { headers }).then(res => res.json()).then(kernels => console.log(kernels));// Create workflowfetch('https://api.aiosdna.com/api/workflows', {method: 'POST',headers: {...headers,'Content-Type': 'application/json'},body: JSON.stringify({name: 'my-workflow',steps: []})});
Next Steps
- Learn about REST Endpoints
- Explore Authentication