- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-01-2019 10:44 AM - last edited on 09-02-2020 10:51 AM by CHopson
Hi- I'm trying to use the API with Python and am having some trouble getting authorized to obtain data using the x-redlock-auth request header.
First, let me add the disclaimer that I'm no Python expert so the help is appreciated even if it seems basic. I also understand that PAN/ Redlock isn't here to teach us how to code but I'm looking for an API doc example at a minimum which seems reasonable.
BTW: the API documentation is great and it's cool that there are code examples!
That said, I'm left wondering about using the Python requests module and how to state the x-redlock-auth mandatory request header.
The docs say that the x-redlock-auth and Content-Type are mandatory. I can successfully declare declare content type as application/json using standard Python response module code.
I'm also able to get my JWT andI can define the content type ok as I can get my JWT and parse into a variable from the successful JSON response.
However, I don't see example code to use x-redlock-auth in the request header.
In the examples there is a pop-up for x-redlock-auth prompting for the JWT but the code example doesn't refelct how to use in the params statement of the requests module.
Example code snippet from the REST API Doc's - generated using the the query params.
Can anyone provide an example of defining the headers for the required x-redlock-auth mandatory request headers in the context of this?
Thanks for any help! Would love to automate Redlock login monitoring into a security validation workflow at my organization.