Posted on 09-09-2024 07:51 PM
I am trying to retrieve the scope of apps, including the catalog and associated scopes/groups for my instance, but so far, I have been unable to fetch the app information as outlined in the API documentation at api.zuludesk.com. According to the documentation, the GET URL provided is as follows:
https://{yourDomain}.jamfcloud.com/apps/:id
the response would include the serial number of the devices but I am only getting the following:
","vendor":"Mathematics Rockx Pty Ltd","price":0,"isDeleted":false,"isDeviceAssignable":true,"is32BitOnly":false,"isCustomB2B":false,"deviceFamilies":["iphone","ipad","ipod"],"isTvOSCompatible":false,"isMacOsCompatible":false,"autoGrant":true,"autoRevoke":true,"totalLicenses":149,"usedLicenses":0,"availableLicenses":149,"isVppV2":false}
#Script for testing purposes, retrive app ID#30
#Headers Authorization not included for security
------Python script
APP_DETAIL_URL = 'https://xxxx..jamfcloud.com/api/apps/30'
# Headers for the GET request
headers = {
'User-Agent': 'curl/7.24.0',
'X-Server-Protocol-Version': '2',
'Authorization': f'Basic {encoded_credentials}',
'Accept': 'application/json'
}
def test_get_request():
try:
# Perform the GET request
response = requests.get(APP_DETAIL_URL, headers=headers)
# Check if the response was successful
response.raise_for_status()
# Print the raw response content for debugging
print(f"Raw response content: {response.text}")
# Parse the JSON data
try:
data = response.json()
print(f"Parsed JSON response: {data}")
# Define the output file path
output_file = 'app_detail_output.json'
# Write the JSON data to a file
with open(output_file, 'w', encoding='utf-8') as file:
json.dump(data, file, indent=4)
print(f"JSON data has been saved to {output_file}")
except ValueError:
print("Response is not in JSON format.")
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}")
except requests.exceptions.RequestException as req_err:
print(f"Request error occurred: {req_err}")
except Exception as err:
print(f"An error occurred: {err}")
if __name__ == "__main__":
test_get_request()
Has anyone come across a way to successfully retrieve this information?