We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

srinivas1995's avatar
srinivas1995
Explorer | Level 3
8 years ago

Drobox API V 1 error 400 depricated

I am getting "error loading metadata: Error Domain=dropbox.com Code=400 "(null)" UserInfo={path=/DocWalletDB.sqlite, error=v1_retired}" in my Console.

 

I am working with Objective c .So,please help me to resolve the above issue and if i update my Dropbox SDK from V 1to V1,will my back files are delete or not?

 

 

Dropbox SDK is used in my project.Not Pods.Help me ,Thank you

4 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    As announced last year, API v1 has been retired. You can find more information in the blog post here:

    https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/

    We notified developers by email, but it sounds like those emails unfortunately did not make it to you.

    Now that API v1 has been retired, further API calls to it will fail. You should migrate your app to API v2 instead:

    https://www.dropbox.com/developers

    For Objective-C, we recommend using the official Dropbox API v2 Objective-C SDK:

    https://github.com/dropbox/dropbox-sdk-obj-c

    The documentation there covers a few different supported installations methods.

    Now that API v1 is retired, you won't be able to use it to make any further API calls, so you won't be able to upload files via API v1, for example. Any files already in your Dropbox are unaffected though, and you can upload/download using API v2 instead.
  • srinivas1995's avatar
    srinivas1995
    Explorer | Level 3
    8 years ago

    Thankyou.

    I'm entry level to this code.The previous developer integrated dropbox with sqlite database .

    Can you please give me the Upload ,download methods along with how to call Paths?

    Means from --- to --path ?

     

  • srinivas1995's avatar
    srinivas1995
    Explorer | Level 3
    8 years ago

    Hi Greg ,when i'm trying to download file from dropbox to my path ,it is not happening.I'm getting below response ,please help me

    I'm doubting ,iam not sure , i didn't give proper path ?

    {

        "client_modified" = "2018-01-30T15:41:01Z";

        "content_hash" = d163f97a49ad06d8c25a20d2797faa20c07aee5fcf90443fa1069d720b62a768;

        id = "id:tQnxMnQWzyAAAAAAAAAACA";

        name = "Document3.zip";

        "path_display" = "/Document3.zip";

        "path_lower" = "/document3.zip";

        rev = 16cac9e50;

        "server_modified" = "2018-01-30T15:41:02Z";

        size = 656674;

    }

    DBUserClient *client = [DBClientsManager authorizedClient];

     

                                                                  NSFileManager *fileManager = [NSFileManager defaultManager];

                                                                  NSURL *outputDirectory = [fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask][0];

                                                                  FilePath = [Database getDatabasePath];

                                                                  NSURL *outputUrl = [outputDirectory URLByAppendingPathComponent:@"Doc.sqlite"];

                                                                  

                                                                  [[[client.filesRoutes downloadUrl:@"/Document3.zip" overwrite:YES destination:outputUrl]

                                                                    setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError,

                                                                                       NSURL *destination) {

                                                                        if (result) {

                                                                            NSLog(@"%@\n", result);

                                                                            NSData *data = [[NSFileManager defaultManager] contentsAtPath:FilePath];

                                                                            NSString *dataStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

                                                                            NSLog(@"%@\n", dataStr);

                                                                            """"'Here DataStr is coming as Nill"

     

     

    Please help me, thank you

                                                                           

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    There are examples of using the SDK to upload and download files here:

    https://github.com/dropbox/dropbox-sdk-obj-c#request-types

    For instance, here is an example of downloading a file to a file specified by an NSURL:

    https://github.com/dropbox/dropbox-sdk-obj-c#download-style-request

    In that example, the file gets saved to the specified `destination`, which is set to the `outputUrl` variable.

    Did you get any error when running your code?

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 6 hours ago
410 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!