I have just started learning Python on the job in the last week. I am trying to integrate with our HR system and upload the information into Okta (our SSO provider) using the API's from each.
the HR API outputs a json file in the following format
{
"isError": false,
"Status": 0,
"Message": "The request processed successfully.",
"Result": [
{
"EmployeeId": {
"DisplayValue": "004",
"FieldHistory": []
},
"Title": {
"DisplayValue": "",
"FieldHistory": []
},
"FirstName": {
"DisplayValue": "John",
"FieldHistory": []
},
"LastName": {
"DisplayValue": "Smith",
"FieldHistory": []
},
}]
}
I then want to enter this into a variable called EmployeeID
and put it in my code here:
PHRPayload = {
"APIKey": PHRAPI,
"Action": PHRAction,
"EmployeeId": EmployeeID,
}
I would like to iterate through the Result > EmployeeId > DisplayValue and print them into a dict and then iterate through these in another part of my code
OktaURL = "https://company.okta.com/api/v1/users/" + PHRPost.json()['Result']['EmailId']['DisplayValue']