You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Leon_NAM's avatar
Leon_NAM
Helpful | Level 5
4 years ago

API Call using Integromat returns error

Hey there,

 

I want to create an automated API Call to our company's Dropbox that creates a folder with only select user groups having access. To do that I am using the Dropbox "Make an API Call"-module in Integromat and "/share_folder". I have tested it both with a path that is an existing folder and with one that would create a new folder but every time I run the operation I get the error "The operation failed with an error. [401] missing_scope/".

 

I am an absolute beginner with this stuff but after doing some reading on this forum I suspect that the connection to Dropbox is read-only. Especially since API Calls like get_metadata or list_folders work just fine. What I am wondering is: How do I find out what kinds of permissions an app that is authorized within Dropbox has (Integromat in this case)? Should I ditch the pre-made module and just make the call using the generic HTTP modules?

 

Here is the full input I am giving the module:

 

URL: /2/sharing/share_folder (relative to https://api.dropboxapi.com)

Body: {

    "path": "/not a machine cloud/projekte/2021/21012 - casefilm google barklaycard - acht - jm/test",    "acl_update_policy": "editors",

    "force_async": false,

    "member_policy": "team",

    "shared_link_policy": "members",

    "access_inheritance": "inherit"

}

Dropbox API Endpoint: api

Method: POST

Headers:

Key: Content-Type

Value: application/json

Disable Dropbox API Path Root: false

 

Thanks a lot in advance!

Cheers,

Leon

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    Leon_NAM wrote:
    ... I am using the Dropbox "Make an API Call"-module in Integromat and "/share_folder". I have tested it both with a path that is an existing folder and with one that would create a new folder but every time I run the operation I get the error "The operation failed with an error. [401] missing_scope/".

    ...


    Hi Leon_NAM,

    Your call (the 2/sharing/share_folder call) requires "sharing.write" scope enabled to your application. Have you enabled it? 🧐

     


    Leon_NAM wrote:

    .... Especially since API Calls like get_metadata or list_folders work just fine. What I am wondering is: How do I find out what kinds of permissions an app that is authorized within Dropbox has (Integromat in this case)? ...


    Call 2/files/get_metadata required scope is "files.metadata.read". Call 2/sharing/list_folders required scope is "sharing.read". All points you're mentioning have different scopes. You can see those scopes in the documentation (follow the links). According to the described by you, your application has "files.metadata.read" and "sharing.read" scopes, but missing the "sharing.write" one (and probably others too)! Check all your calls required scopes and make sure they are on for the application. 😉

    Hope this helps.

    • Leon_NAM's avatar
      Leon_NAM
      Helpful | Level 5

      Hey there,

       

      thanks for the detailed reply! Now I definetely understand why it's throwing an error. I am not making the app however it is a web-based integration software (https://www.integromat.com/) so it looks like the problem is that their app doesn't request "enough" access when you connect it to Dropbox.

       

      UPDATE: I made some progress. The problem here is that integromat doesn't ask for the extended permissions until it needs them for one of the Dropbox preset modules they offer. As soon as you try to use one of them (e.g. Create Folder) it allows you to update the permissions of the app. It's a bit cumbersome but it might have worked (now I am getting a 409 instead of a 401 error which is probably due to missing permissions my account has)

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        Leon_NAM wrote:
        ... now I am getting a 409 instead of a 401 error which is probably due to missing permissions my account has)

        HTTP status code isn't enough for reason conclusion. Pay attention on error text (as you did within OP)! There you can see the exact error text and probably precise error description (or direction to, at least).