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: 

How to create a folder via PowerShell with Dropbox REST API?

How to create a folder via PowerShell with Dropbox REST API?

jbaleta
Explorer | Level 4

Good morning.

 

I have been looking for a way to create a folder via PowerShell in Dropbox with REST API and I have not found a way to do it. I only found the forum http://rest-examples.chilkat.io/dropbox/powershell/chilkat_291.cshtml, but you need to buy a library. Can you help me to have an example using the Url https://api.dropboxapi.com/2/files/create_folder_v2 where you don't have to buy an additional library.


Thank you so much.

 

Cordially,


Jairo Baleta.

4 Replies 4

Greg-DB
Dropbox Staff

We offer official SDKs for accessing the Dropbox API for free: https://www.dropbox.com/developers/documentation#sdks We recommend using one of those whenever possible. For example, there's an official .NET SDK: https://github.com/dropbox/dropbox-sdk-dotnet

 

Otherwise, you can call the HTTPS endpoints for the Dropbox API directly, using whatever HTTPS client you want, such as something provided for free by your platform. For example, you can find the documentation for the /2/files/create_folder_v2 endpoint here: https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder

jbaleta
Explorer | Level 4

Many thanks Greg-DB for the answer.

When trying to install with the Install-Package command Dropbox.Api throws the following error:

PS C:\Windows\system32> Install-Package Dropbox.Api
Install-Package : Dependency loop detected for package 'Dropbox.Api'.
En línea: 1 Carácter: 1
+ Install-Package Dropbox.Api
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : Deadlock detected: (Dropbox.Api:String) [Install-Package], Exception
+ FullyQualifiedErrorId : DependencyLoopDetected,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Windows\system32> Install-Package Dropbox.Api -Force -Verbose
DETALLADO: Uso del proveedor 'Programs' para buscar paquetes.
DETALLADO: Uso del proveedor 'msu' para buscar paquetes.
DETALLADO: Uso del proveedor 'msi' para buscar paquetes.
DETALLADO: Uso del proveedor 'NuGet' para buscar paquetes.
DETALLADO: Uso del proveedor 'PowerShellGet' para buscar paquetes.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Dropbox.Api'' for ''.
DETALLADO: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
DETALLADO: Getting the provider object for the PackageManagement Provider 'NuGet'.
DETALLADO: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
DETALLADO: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Dropbox.Api'' for ''.
DETALLADO: Total package yield:'1' for the specified package 'Dropbox.Api'.
DETALLADO: Total package yield:'0' for the specified package 'Dropbox.Api'.
DETALLADO: Se está realizando la operación "Instalar paquete" en el destino "Paquete 'Dropbox.Api' versión '6.37.0' de 'nugetRepository'.".
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Dropbox.Api'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.CSharp'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='NETStandard.Library'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.NETCore.Platforms'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.InteropServices.RuntimeInformatio...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Reflection'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.NETCore.Targets'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.NETCore.Platforms'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.NETCore.Targets'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Text.Encoding'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Threading.Tasks'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Reflection.Primitives'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Reflection.Extensions'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Resources.ResourceManager'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Globalization'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Threading'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.native.System'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.InteropServices'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.Handles'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Win32.Primitives'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.AppContext'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Collections'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Console'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.NETCore.Targets'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Globalization.Calendars'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO.Compression'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.native.System.IO.Compression'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Buffers'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Diagnostics.Debug'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Diagnostics.Tracing'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.Extensions'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO.Compression.ZipFile'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO.FileSystem'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.IO.FileSystem.Primitives'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Net.Http'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Security.Cryptography.X509Certificates'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Security.Cryptography.Algorithms'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Security.Cryptography.Primitives'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Security.Cryptography.Encoding'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.native.System.Security.Cryptography.Open...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.debian.8-x64.runtime.native.System.Secur...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.debian.9-x64.runtime.native.System.Secur...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.fedora.23-x64.runtime.native.System.Secu...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.fedora.24-x64.runtime.native.System.Secu...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.fedora.27-x64.runtime.native.System.Secu...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.fedora.28-x64.runtime.native.System.Secu...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.opensuse.13.2-x64.runtime.native.System....'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.opensuse.42.1-x64.runtime.native.System....'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.opensuse.42.3-x64.runtime.native.System....'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.osx.10.10-x64.runtime.native.System.Secu...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.rhel.7-x64.runtime.native.System.Securit...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.ubuntu.14.04-x64.runtime.native.System.S...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.ubuntu.16.04-x64.runtime.native.System.S...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.ubuntu.16.10-x64.runtime.native.System.S...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.ubuntu.18.04-x64.runtime.native.System.S...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Collections.Concurrent'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Linq'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.native.System.Security.Cryptography.Appl...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.osx.10.10-x64.runtime.native.System.Secu...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='runtime.native.System.Security.Cryptography.Open...'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.Numerics'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Security.Cryptography.Cng'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Security.Cryptography.Algorithms'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.NETCore.Platforms'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Formats.Asn1'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Buffers'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Memory'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Runtime.CompilerServices.Unsafe'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='System.Numerics.Vectors'' for ''.
DETALLADO: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='NETStandard.Library'' for ''.
Install-Package : Dependency loop detected for package 'Dropbox.Api'.
En línea: 1 Carácter: 1
+ Install-Package Dropbox.Api -Force -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : Deadlock detected: (Dropbox.Api:String) [Install-Package], Exception
+ FullyQualifiedErrorId : DependencyLoopDetected,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Greg-DB
Dropbox Staff

It's not clear why it would be claiming a dependency loop on Dropbox.Api; Dropbox.Api only depends on Newtonsoft.Json (>= 13.0.2), which does not depend on Dropbox.Api.

 

It looks like there's some information on this issue here; otherwise you may want to reach out to Microsoft for support for the installer.

jbaleta
Explorer | Level 4

Many thanks Greg-DB for the answer.

It worked for me using the command:

Install-Package Dropbox.Api -Destination ".\NugetPackages" -Force -Source 'https://www.nuget.org/api/v2' -ProviderName NuGet -SkipDependencies -ErrorAction SilentlyContinue

Need more support?
Who's talking

Top contributors to this post

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