cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Rename folder and file in iOs Using APIV2

Rename folder and file in iOs Using APIV2

bliss
Explorer | Level 3
Go to solution

How we can rename a folder or file in the IOS using objective c. I am using apiv2.

 

Thanks in advance.!!1

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The move method is an "RPC-style request", so you would use it like the samples in the documentation under "RPC-style request".

 

Specifically, it would look like:

 

[[client.filesRoutes move:@"/original_path" toPath:@"/new_path"] setResponseBlock:^(DBFILESMetadata *result, DBFILESRelocationError *routeError, DBRequestError *requestError) {
        if (result) {
            NSLog(@"%@\n", result);
        } else {
            NSLog(@"%@\n", routeError);
            NSLog(@"%@\n", requestError);
        }
}];

 

 

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution
To rename any file or folder using the API v2 Objective-C SDK, you should use the move method:

https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:ob...:

bliss
Explorer | Level 3
Go to solution
  - (DBRpcTask<DBFILESMetadata *, DBFILESRelocationError *> *_Nonnull)  move:(NSString *_Nonnull)fromPath toPath:(NSString *_Nonnull)toPath
{
   
}

 

can you pelase suggest how to use this method. I tried a lot.

Greg-DB
Dropbox Staff
Go to solution

The move method is an "RPC-style request", so you would use it like the samples in the documentation under "RPC-style request".

 

Specifically, it would look like:

 

[[client.filesRoutes move:@"/original_path" toPath:@"/new_path"] setResponseBlock:^(DBFILESMetadata *result, DBFILESRelocationError *routeError, DBRequestError *requestError) {
        if (result) {
            NSLog(@"%@\n", result);
        } else {
            NSLog(@"%@\n", routeError);
            NSLog(@"%@\n", requestError);
        }
}];

 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    bliss Explorer | Level 3
What do Dropbox user levels mean?