REST API Integration Examples
Practical code samples for using Elk's APIs to automate deployments and manage application lifecycles.
api_dev
4 days ago
Here are some sample REST API integrations for common use cases. These examples use Node.js with the Elk SDK but can also be adapted to vanilla JS, Python, or other environments:
Deployment Example
elkClient.deployments.create({ repository: 'github.com/your-org/your-repo', branch: 'main', environment: 'production' }).subscribe(data => { console.log('Deployment Created:', data.deployment_id); });
Status Check Example
elkClient.status.get({ deployment_id: 'abc123' }).then(response => { console.log('Current Status:', response.status); });
Comments (3)
john_doe123
2 days agoGreat examples! How would this work with custom headers for authentication?
devops_guru
1 day agoThe client automatically includes the Authorization header from your config. You can override with custom headers using elkClient.setRequestHeaders().
api_dev
TodayThanks for the follow-up question! We've updated the example to show header customization in the latest SDK version.