Examples
Here we provide some basic code examples to interact with the Orbiit API. We also have specific examples for
Javascript
As an example we will retrieve the Members for an Audience in the following request.
const baseURL = 'https://api.orbiit.ai/v0';
const token = '<YOUR-ORBIIT-TOKEN>';
const workspaceId = '<YOUR-ORBIIT-WORKSPACE-ID>';
const audienceId = '<AUDIENCE-ID>';
const url = `${baseURL}/workspaces/${workspaceId}/audience/${audienceId}/members`;
fetch(url, {
method: 'get',
headers: new Headers({
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
})
})
.then((res) => res.json())
.then((data) => {
console.log('data: ', data);
})Python
import requests
base_url = 'https://api.orbiit.ai/v0'
token = '<YOUR-ORBIIT_TOKEN>'
headers = {
'Authorization': f'Bearer {auth_token}',
'Content-Type': 'application/json'
}
data = {'email' : '[email protected]'}
url = f'{base_url}/workspaces/${workspaceId}/members'
response = requests.post(url, json=data, headers=headers)
print(response.status_code)
print(response.json())Last updated