Elk

Community / REST API Integration Examples

REST API Integration Examples

API / SDK Posted 4 days ago by api_dev

Practical code samples for using Elk's APIs to automate deployments and manage application lifecycles.

User Profile

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)

User Avatar

john_doe123

2 days ago

Great examples! How would this work with custom headers for authentication?

User Avatar

devops_guru

1 day ago

The client automatically includes the Authorization header from your config. You can override with custom headers using elkClient.setRequestHeaders().

User Avatar

api_dev

Today

Thanks for the follow-up question! We've updated the example to show header customization in the latest SDK version.

User Avatar