You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jean-Sébastien Sevestre edited this page May 6, 2019
·
2 revisions
Media Snippets
Change media visibility
#Python2.7fromlumapps.clientimportApiClientimportjsontoken="token here"INSTANCE_ID="ID Here"api=ApiClient(token=token)
# Get a list of files from the media library for the target instance# this example returns 30 filesbody= {
"maxResults": 30,
"more": True,
"lang": "en",
"docPath": "provider=local/site="+INSTANCE_ID,
"searchParameters": {
"shared": True,
"trashed": False
},
"sortOrder": [],
"searchTypes": [
"FOLDER",
"IMAGE",
"OTHER"
]
}
documents=api.iter_call("document", "list", body=body)
fordocumentindocuments:
# Set isShared to False so it can be removed from the media library# And displayed only in the media author librarydocument['isShared'] =Falseupdate=api.get_call("document", "update", body=document)