Basic Auth
A guide on how to use Basic Auth for authenticating our REST API.
Overview
Prerequisites
Code Sample
export DT_SERVICE_ACCOUNT_KEY_ID=<YOUR_SERVICE_ACCOUNT_KEY_ID>
export DT_SERVICE_ACCOUNT_SECRET=<YOUR_SERVICE_ACCOUNT_SECRET>requests==2.31.0import os
import requests
if __name__ == '__main__':
projects = requests.get(
url='https://api.d21s.com/v2/projects',
auth=(
os.environ.get('DT_SERVICE_ACCOUNT_KEY_ID'),
os.environ.get('DT_SERVICE_ACCOUNT_SECRET'),
)
)
print(projects.json())npm install [email protected]const axios = require('axios').default;
async function main() {
const response = await axios({
method: 'GET',
url: 'https://api.disruptive-technologies.com/v2/projects',
auth: {
username: process.env.DT_SERVICE_ACCOUNT_KEY_ID,
password: process.env.DT_SERVICE_ACCOUNT_SECRET,
}
})
console.log(JSON.stringify(response.data, null, 2))
}
main()Last updated
Was this helpful?