After running a GET API call, I am presented with the following output:
{
"limit": 1000,
"offset": 0,
"records": [{
"associatedItems": [{
"id": "rk:db",
"name": "rk:db",
"parentId": "10000",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory",
"typeName": "USER"
}],
"category": "group management",
"created": "2022-10-13T17:44:01.633+0000",
"eventSource": "",
"id": 42914,
"objectItem": {
"name": "system-administrators",
"parentId": "10000",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory",
"typeName": "GROUP"
},
"summary": "User added to group"
}, {
"associatedItems": [{
"id": "rk:da",
"name": "rk:da",
"parentId": "10000",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory",
"typeName": "USER"
}],
"category": "group management",
"created": "2022-10-13T17:44:01.610+0000",
"eventSource": "",
"id": 42913,
"objectItem": {
"name": "site-admins",
"parentId": "10000",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory",
"typeName": "GROUP"
}
}],
"total": 492
}
I want to extract each element from the "records" array to create multiple JSON objects.
One (1) JSON object per array element.
For example: JSON Object #1
{
"associatedItems": [{
"id": "rk:db",
"name": "rk:db",
"parentId": "10000",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory",
"typeName": "USER"
}],
"category": "group management",
"created": "2022-10-13T17:44:01.633+0000",
"eventSource": "",
"id": 42914,
"objectItem": {
"name": "system-administrators",
"parentId": "10000",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory",
"typeName": "GROUP"
},
"summary": "User added to group"
}
Ideally, I want to perform the JSON object manipulation using Python.
Can anyone help me achieve this goal? Thanks!