Create Access Role
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
roleName: 'Manager',
roleData: [
[
{path: '/', access: 'Full Access'},
{path: '/my-team', access: 'Team Data'},
{path: '/proof-of-work/screenshot', access: 'Own Data'}
]
]
})
};
fetch('https://api.trackpilots.com/v1/access-management', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.trackpilots.com/v1/access-management \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roleName": "Manager",
"roleData": [
[
{
"path": "/",
"access": "Full Access"
},
{
"path": "/my-team",
"access": "Team Data"
},
{
"path": "/proof-of-work/screenshot",
"access": "Own Data"
}
]
]
}
'import requests
url = "https://api.trackpilots.com/v1/access-management"
payload = {
"roleName": "Manager",
"roleData": [[
{
"path": "/",
"access": "Full Access"
},
{
"path": "/my-team",
"access": "Team Data"
},
{
"path": "/proof-of-work/screenshot",
"access": "Own Data"
}
]]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"statusCode": 200,
"statusMessage": "Page-level access permissions have been successfully assigned to the role.",
"error": null,
"data": {
"roleId": "c44a66ea-d0ba-4423-9f85-25c68f7aa37b",
"roleName": "Manager",
"roleData": [
{
"path": "/",
"access": "Full Access"
},
{
"path": "/my-team",
"access": "Team Data"
},
{
"path": "/proof-of-work/screenshot",
"access": "Own Data"
}
]
}
}
Access Control
Create Access Role
POST
/
v1
/
access-management
Create Access Role
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
roleName: 'Manager',
roleData: [
[
{path: '/', access: 'Full Access'},
{path: '/my-team', access: 'Team Data'},
{path: '/proof-of-work/screenshot', access: 'Own Data'}
]
]
})
};
fetch('https://api.trackpilots.com/v1/access-management', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.trackpilots.com/v1/access-management \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roleName": "Manager",
"roleData": [
[
{
"path": "/",
"access": "Full Access"
},
{
"path": "/my-team",
"access": "Team Data"
},
{
"path": "/proof-of-work/screenshot",
"access": "Own Data"
}
]
]
}
'import requests
url = "https://api.trackpilots.com/v1/access-management"
payload = {
"roleName": "Manager",
"roleData": [[
{
"path": "/",
"access": "Full Access"
},
{
"path": "/my-team",
"access": "Team Data"
},
{
"path": "/proof-of-work/screenshot",
"access": "Own Data"
}
]]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"statusCode": 200,
"statusMessage": "Page-level access permissions have been successfully assigned to the role.",
"error": null,
"data": {
"roleId": "c44a66ea-d0ba-4423-9f85-25c68f7aa37b",
"roleName": "Manager",
"roleData": [
{
"path": "/",
"access": "Full Access"
},
{
"path": "/my-team",
"access": "Team Data"
},
{
"path": "/proof-of-work/screenshot",
"access": "Own Data"
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Page-level access permissions have been successfully assigned to the role.
⌘I
