box api - As Co-Admin, how to move folder in another user's account? -
i updating user management script execute when leaves our company.
the app aligned co-admin account , has various enterprise scopes enabled (except "manage webhooks v2"). "read , write files , folders stored in box" scope checked.
oh, using python sdk.
basically, process works follows:
first, move separating users '0' (top-level) folder account. kind of custom function call /users//folders/0 via put json parameter of owned_by:
<new_user_id>next want move folder underneath sub-folder of
<new_user_id>. code looks following:client.folder(folder_id=folder_to_move_id).as_user(new_user_id_obj_from_step_1).move(client.folder(folder_id=new_parent_folder_id))however, results in following error:
boxsdk.exception.boxapiexception: message: none status: 403 code: none request id: none headers: {'content-length': '0', 'age': '0', 'strict-transport-security': 'max-age=31536000; includesubdomains', 'server': 'ats', 'connection': 'keep-alive', 'date': 'fri, 07 apr 2017 22:52:43 gmt', 'www-authenticate': 'bearer realm="service", error="insufficient_scope", error_description="the request requires higher privileges provided access token."'} url: https://api.box.com/2.0/folders/23596411401 method: put context info: none
searching around "insufficient_scope" error, makes me think access token needs have requested different scope, (a) i'm not clear 1 , (b) i'm not sure how change scope mid-script. maybe should approaching different way?
thanks feedback.
Comments
Post a Comment