Package com.dropbox.core.v2
Class DbxTeamClientV2
- java.lang.Object
- 
- com.dropbox.core.v2.DbxTeamClientV2Base
- 
- com.dropbox.core.v2.DbxTeamClientV2
 
 
- 
 public class DbxTeamClientV2 extends DbxTeamClientV2Base Use this class to make remote calls to the Dropbox API team endpoints. Team endpoints expose actions you can perform on or for a Dropbox team. You'll need a team access token first, normally acquired by directing a Dropbox Business team administrator through the auth flow usingDbxWebAuth.Team clients can access user endpoints by using the asMember(java.lang.String)method. This allows team clients to perform actions as a particular team member.This class has no mutable state, so it's thread safe as long as you pass in a thread safe HttpRequestorimplementation.
- 
- 
Field Summary- 
Fields inherited from class com.dropbox.core.v2.DbxTeamClientV2Base_client
 
- 
 - 
Constructor SummaryConstructors Constructor Description DbxTeamClientV2(DbxRequestConfig requestConfig, DbxCredential credential)Create a client that usesDbxCredentialinstead of raw access token.DbxTeamClientV2(DbxRequestConfig requestConfig, DbxCredential credential, DbxHost host, java.lang.String userId)Same asDbxTeamClientV2(DbxRequestConfig, DbxCredential)except you can set host and userId.DbxTeamClientV2(DbxRequestConfig requestConfig, java.lang.String accessToken)Creates a client that uses the given OAuth 2 access token as authorization when performing requests against the default Dropbox hosts.DbxTeamClientV2(DbxRequestConfig requestConfig, java.lang.String accessToken, DbxHost host)Same asDbxTeamClientV2(DbxRequestConfig, String)except you can also set the hostnames of the Dropbox API servers.DbxTeamClientV2(DbxRequestConfig requestConfig, java.lang.String accessToken, DbxHost host, java.lang.String userId)Same asDbxTeamClientV2(DbxRequestConfig, String, DbxHost)except you can also set the userId for multiple Dropbox accounts.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description DbxClientV2asAdmin(java.lang.String adminId)Returns aDbxClientV2that performs requests against Dropbox API user endpoints as the given team admin.DbxClientV2asMember(java.lang.String memberId)Returns aDbxClientV2that performs requests against Dropbox API user endpoints as the given team member.DbxRefreshResultrefreshAccessToken()Refresh the access token insideDbxCredential.- 
Methods inherited from class com.dropbox.core.v2.DbxTeamClientV2BasefileProperties, team, teamLog
 
- 
 
- 
- 
- 
Constructor Detail- 
DbxTeamClientV2public DbxTeamClientV2(DbxRequestConfig requestConfig, java.lang.String accessToken) Creates a client that uses the given OAuth 2 access token as authorization when performing requests against the default Dropbox hosts.- Parameters:
- requestConfig- Default attributes to use for each request
- accessToken- OAuth 2 access token (that you got from Dropbox) that gives your app the ability to make Dropbox API calls. Typically acquired through- DbxWebAuth
 
 - 
DbxTeamClientV2public DbxTeamClientV2(DbxRequestConfig requestConfig, java.lang.String accessToken, DbxHost host) Same asDbxTeamClientV2(DbxRequestConfig, String)except you can also set the hostnames of the Dropbox API servers. This is used in testing. You don't normally need to call this.- Parameters:
- requestConfig- Default attributes to use for each request
- accessToken- OAuth 2 access token (that you got from Dropbox) that gives your app the ability to make Dropbox API calls. Typically acquired through- DbxWebAuth
- host- Dropbox hosts to send requests to (used for mocking and testing)
 
 - 
DbxTeamClientV2public DbxTeamClientV2(DbxRequestConfig requestConfig, DbxCredential credential) Create a client that usesDbxCredentialinstead of raw access token. The credential object include access token as well as refresh token, expiration time, app key and app secret. Using credential enables dropbox client to support short live token feature.- Parameters:
- requestConfig- Default attributes to use for each request
- credential- The credential object containing all the information for authentication.
 
 - 
DbxTeamClientV2public DbxTeamClientV2(DbxRequestConfig requestConfig, java.lang.String accessToken, DbxHost host, java.lang.String userId) Same asDbxTeamClientV2(DbxRequestConfig, String, DbxHost)except you can also set the userId for multiple Dropbox accounts.- Parameters:
- requestConfig- Default attributes to use for each request
- accessToken- OAuth 2 access token (that you got from Dropbox) that gives your app the ability to make Dropbox API calls. Typically acquired through- DbxWebAuth
- host- Dropbox hosts to send requests to (used for mocking and testing)
- userId- The user ID of the current Dropbox account. Used for multi-Dropbox account use-case.
 
 - 
DbxTeamClientV2public DbxTeamClientV2(DbxRequestConfig requestConfig, DbxCredential credential, DbxHost host, java.lang.String userId) Same asDbxTeamClientV2(DbxRequestConfig, DbxCredential)except you can set host and userId.- Parameters:
- requestConfig- Default attributes to use for each request
- credential- The credential object containing all the information for authentication.
- host- Dropbox hosts to send requests to (used for mocking and testing)
- userId- The user ID of the current Dropbox account. Used for multi-Dropbox account use-case.
 
 
- 
 - 
Method Detail- 
refreshAccessTokenpublic DbxRefreshResult refreshAccessToken() throws DbxException Refresh the access token insideDbxCredential. It has the same behavior asDbxCredential.refresh(DbxRequestConfig).- Returns:
- The result contains new short-live access token and expiration time.
- Throws:
- DbxOAuthException- If refresh failed because of invalid parameter or invalid refresh token.
- DbxException- If refresh failed before of general problems like network issue.
 
 - 
asMemberpublic DbxClientV2 asMember(java.lang.String memberId) Returns aDbxClientV2that performs requests against Dropbox API user endpoints as the given team member.This method performs no validation of the team member ID. - Parameters:
- memberId- Team member ID of member in this client's team, never- null.
- Returns:
- Dropbox client that issues requests to user endpoints as the given team member
- Throws:
- java.lang.IllegalArgumentException- If- memberIdis- null
 
 - 
asAdminpublic DbxClientV2 asAdmin(java.lang.String adminId) Returns aDbxClientV2that performs requests against Dropbox API user endpoints as the given team admin.This method performs no validation of the team admin ID. - Parameters:
- adminId- Team member ID of the admin in client's team, never- null.
- Returns:
- Dropbox client that issues requests to user endpoints as the given team Admin.
- Throws:
- java.lang.IllegalArgumentException- If- adminIdis- null
 
 
- 
 
-