cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"users/get_current_account": Invalid select user id format error.

"users/get_current_account": Invalid select user id format error.

trithanhnguyen
Helpful | Level 6
Go to solution

I have a test program and it works fine in Windows 11. When I ported the code into Centos 7 and ran it, it returned an error:

 

com.dropbox.core.BadRequestException: Error in call to API function "users/get_current_account": Invalid select user id format

 

I am using Java 8 and Dropbox SDK version 4.0.1. This is portion of the code that causes the problem:

 

static List<EventLog> getFilesFromMember(List<EventLog> fileLog,
String teamMemberId,
String teamMemberEmail,
String ownerName) throws DbxException
{
    DbxClientV2 dbxClient = dbxTeamClient.asMember(teamMemberId);
    FullAccount acc = dbxClient.users().getCurrentAccount(); //Work fine in Windows 11 but fails in Centos 7 server.
    String rootNs = acc.getRootInfo().getRootNamespaceId();
    dbxClient = dbxClient.withPathRoot(PathRoot.namespaceId(rootNs));
    ListFolderResult fileRes = dbxClient.files().listFolderBuilder("").withRecursive(true).start();

 

 

Any suggestion to fix it?

 

Thank you.

1 Accepted Solution

Accepted Solutions

trithanhnguyen
Helpful | Level 6
Go to solution

Your suggestion to check the teamMemberId is very helpful. I did make some change after I ported the code that messed up the ID. 

 

Thank you.

View solution in original post

7 Replies 7

trithanhnguyen
Helpful | Level 6
Go to solution

This is a full error messages:

 

com.dropbox.core.BadRequestException: Error in call to API function "users/get_current_account": Invalid select user id format
at com.dropbox.core.DbxRequestUtil.unexpectedStatus(DbxRequestUtil.java:337)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:154)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:330)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriableWithRefresh(DbxRawClientV2.java:351)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:137)

Здравко
Legendary | Level 20
Go to solution

@trithanhnguyen, Are you sure your 'teamMemberId' parameter carries correct value? Print it out and check the place where/how you get it from and is on that place something 'strange'. 😉

trithanhnguyen
Helpful | Level 6
Go to solution

I did print the teamMemberId to the log in the Centos server and checked it. It is correct string ID (I compare it with the one from the Windows 11 program).

Здравко
Legendary | Level 20
Go to solution

Better perform this call on 'dbxTeamClient' context. So you wouldn't need 'broken; parameter (it's meaningless actually). 😉

trithanhnguyen
Helpful | Level 6
Go to solution

For the DbxTeamClient I do not have a way to list all the folders and files for each member of the Namespace. So I have to switch to the DbxClientV2 to do that. If you can list all the folders and files for each member of the team in the same Namespace using the DbxTeamClient, could you please show me a code snippet how to do it?

 

Thank you. 

Здравко
Legendary | Level 20
Go to solution

@trithanhnguyen wrote:

For the DbxTeamClient I do not have a way to list all the folders and files for each member of the Namespace. ...


Does the listing fail? 🤔 Or something else before actual listing call...

 


@trithanhnguyen wrote:

... So I have to switch to the DbxClientV2 to do that. ...


Of course, there is no other way. 😉

Take a bit more care.

 

PS: alternative can be passing client object ready to use for listing (without need of any additional actions - like the failing one).

trithanhnguyen
Helpful | Level 6
Go to solution

Your suggestion to check the teamMemberId is very helpful. I did make some change after I ported the code that messed up the ID. 

 

Thank you.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    trithanhnguyen Helpful | Level 6
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?