How to create an email alias for a JWT app?
回答済みHello,
We are trying to use a Box App to download daily data files from specific Box folders to a different location programmatically. Following the advice from multiple threads (https://support.box.com/hc/en-us/community/posts/360049197793-How-to-Collaborate-JWT-Service-Account, https://support.box.com/hc/en-us/community/posts/360049197513-Restricting-JWT-App-to-Certain-Folders), we created a Box App with JWT Authorization that has "Application" Access enabled. This App was then authorized by our Box-Admin.
But before I can use the app's service account for downloading files, I understand that this account's login needs to be added as a collaborator to the required folders. When I used the "Current User" method:
current_user = client.user().get()
it returned the following information:
<Box User - ###User_ID### ($$$Name$$$)>
Since there's no email alias, I tried using the "Create Email Alias" method (https://developer.box.com/reference/post-users-id-email-aliases/)
But it returned the following error:
error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token."
Though I reached out to our Box Admin, I did not receive any positive answer from their end about their ability to create the email alias for the Box App. Could someone please let me know what steps they need to take to create an email alias or what kind of permissions should they grant me to use the create email alias method in the Box API Documentation?
Please help!
Thanks in advance,
Anirudh
-
正式なコメント
Hi Anirudh,
You're pretty close! The field you're looking for is "login", on that current_user object. If you take a look at the type of the object returned by client.user().get(), you'll see
<class 'boxsdk.object.user.User'>
So, to print out the actual email address to use for collaboration invitations, you'd want to access the 'login' field with something like
print(user.login)
Hope that helps! Please let us know if this works for you.
コメントアクション
サインインしてコメントを残してください。
コメント
1件のコメント