Planning REST APIs - List File
Summary
Planning REST APIs - List FileContent
Hi All.
I am using the list files api () to check for a file.
The JSON response has a field "lastmodifiedtime". The value is "1534769532000". How do we convert this value to Date Format? Find below an example
{
"lastModififedTime":"1534769532000",
"name":"FS_Data.csv",
"type":"EXTERNAL",
"size":"649890"
}
Thanks,
Arun
Version
18.09.63Code Snippet
response = requests.get(url,auth=HTTPBasicAuth(user_name,password),headers = headers)
if response.status_code == 200:
response = json.loads(response.text)
for f in response['items']:
if (f['type'] == fileType and f['name'] == "CEIX_Assets_Cost_Details.csv"):
print("file found")
print(f['lastModififedTime'])
print(f['name'])
print(f['type'])
print(f['size'])
Tagged:
0