Skip to content

Sample for revealing maintenance token. #193

Answered by jshcodes
JayBabs asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @JayBabs!

Try this and let us know if you have any questions or problems:

from falconpy.sensor_update_policy import Sensor_Update_Policy as SensorPolicies

creds = {
    "client_id": "API_CLIENT_ID_HERE",
    "client_secret": "API_CLIENT_SECRET_HERE"
}
falcon = SensorPolicies(creds=creds)

result = falcon.revealUninstallToken(body={"device_id": "MAINTENANCE"})
try:
    maint_token = result["body"]["resources"][0]["uninstall_token"]
except KeyError:
    maint_token = "Unable to retrieve maintenance token, check that your API key has access to the Sensor Update Policy API."

print(f"Result: {maint_token}")

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by jshcodes
Comment options

You must be logged in to vote
1 reply
@jshcodes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
sensor update Sensor Update Policy issues and questions
2 participants