All Projects → dropbox → Dropbox Sdk Go Unofficial

dropbox / Dropbox Sdk Go Unofficial

Licence: mit
⚠️ An UNOFFICIAL Dropbox v2 API SDK for Go

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Dropbox Sdk Go Unofficial

Cordova Plugin Googlemaps
Google Maps plugin for Cordova
Stars: ✭ 1,647 (+1012.84%)
Mutual labels:  sdk
Onfido Sdk Ui
The Onfido SDK for Front-end JavaScript
Stars: ✭ 139 (-6.08%)
Mutual labels:  sdk
Pyvcloud
Python SDK for VMware vCloud Director
Stars: ✭ 143 (-3.38%)
Mutual labels:  sdk
Cloudinary ios
Cloudinary iOS SDK
Stars: ✭ 133 (-10.14%)
Mutual labels:  sdk
Alan Sdk Reactnative
Alan React Native SDK adds a voice assistant or chatbot to your app.
Stars: ✭ 138 (-6.76%)
Mutual labels:  sdk
Filestack Android
Official Android SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 140 (-5.41%)
Mutual labels:  sdk
Applicationinsights Dotnet Server
Microsoft Application Insights for .NET Web Applications
Stars: ✭ 130 (-12.16%)
Mutual labels:  sdk
Parse Sdk Android
The Android SDK for the Parse Platform
Stars: ✭ 1,806 (+1120.27%)
Mutual labels:  sdk
Cityengine Sdk
CityEngine is a 3D city modeling software for urban design, visual effects, and VR/AR production. With its C++ SDK you can create plugins and standalone apps capable to execute CityEngine CGA procedural modeling rules.
Stars: ✭ 137 (-7.43%)
Mutual labels:  sdk
Hedera Sdk Java
Hedera™ Hashgraph SDK for Java
Stars: ✭ 143 (-3.38%)
Mutual labels:  sdk
Thinkphp5 Wechat
微信 SDK for thinkphp5, 基于 overtrue/wechat
Stars: ✭ 133 (-10.14%)
Mutual labels:  sdk
Kube Aws Iam Controller
Distribute different AWS IAM credentials to different pods in Kubernetes via secrets.
Stars: ✭ 137 (-7.43%)
Mutual labels:  sdk
Xmind Sdk Js
The XMind SDK for javascript in browser and Node.js.
Stars: ✭ 143 (-3.38%)
Mutual labels:  sdk
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-10.81%)
Mutual labels:  sdk
Java Stellar Sdk
Stars: ✭ 146 (-1.35%)
Mutual labels:  sdk
Amplitude Android
Native Android SDK for Amplitude
Stars: ✭ 129 (-12.84%)
Mutual labels:  sdk
Facebook Js Ads Sdk
[DEPRECATED] OFFICIAL FACEBOOK SDK: https://github.com/facebook/facebook-nodejs-ads-sdk
Stars: ✭ 140 (-5.41%)
Mutual labels:  sdk
Kittik
Create slides in TypeScript and present them in the terminal using ASCII only!
Stars: ✭ 147 (-0.68%)
Mutual labels:  sdk
Auth0.swift
Swift toolkit for Auth0 API
Stars: ✭ 146 (-1.35%)
Mutual labels:  sdk
Gochat
🔥 微信 Go SDK 🚀🚀🚀
Stars: ✭ 141 (-4.73%)
Mutual labels:  sdk

Dropbox SDK for Go [UNOFFICIAL] GoDoc Build Status Go Report Card

An UNOFFICIAL Go SDK for integrating with the Dropbox API v2. Tested with Go 1.11+

⚠️ WARNING: This SDK is NOT yet official. What does this mean?

  • There is no formal Dropbox support for this SDK at this point
  • Bugs may or may not get fixed
  • Not all SDK features may be implemented and implemented features may be buggy or incorrect

Uh OK, so why are you releasing this?

  • the SDK, while unofficial, is usable. See dbxcli for an example application built using the SDK
  • we would like to get feedback from the community and evaluate the level of interest/enthusiasm before investing into official supporting one more SDK

Installation

$ go get github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/...

For most applications, you should just import the relevant namespace(s) only. The SDK exports the following sub-packages:

  • github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/auth
  • github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/files
  • github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/sharing
  • github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/team
  • github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/users

Additionally, the base github.com/dropbox/dropbox-sdk-go-unofficial/dropbox package exports some configuration and helper methods.

Usage

First, you need to register a new "app" to start making API requests. Once you have created an app, you can either use the SDK via an access token (useful for testing) or via the regular OAuth2 flow (recommended for production).

Using OAuth token

Once you've created an app, you can get an access token from the app's console. Note that this token will only work for the Dropbox account the token is associated with.

import "github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
import "github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/users"

func main() {
  config := dropbox.Config{
      Token: token,
      LogLevel: dropbox.LogInfo, // if needed, set the desired logging level. Default is off
  }
  dbx := users.New(config)
  // start making API calls
}

Using OAuth2 flow

For this, you will need your APP_KEY and APP_SECRET from the developers console. Your app will then have to take users though the oauth flow, as part of which users will explicitly grant permissions to your app. At the end of this process, users will get a token that the app can then use for subsequent authentication. See this for an example of oauth2 flow in Go.

Once you have the token, usage is same as above.

Making API calls

Each Dropbox API takes in a request type and returns a response type. For instance, /users/get_account takes as input a GetAccountArg and returns a BasicAccount. The typical pattern for making API calls is:

  • Instantiate the argument via the New* convenience functions in the SDK
  • Invoke the API
  • Process the response (or handle error, as below)

Here's an example:

  arg := users.NewGetAccountArg(accountId)
  if resp, err := dbx.GetAccount(arg); err != nil {
    return err
  } else {
    fmt.Printf("Name: %v", resp.Name)
  }

Error Handling

As described in the API docs, all HTTP errors except 409 are returned as-is to the client (with a helpful text message where possible). In case of a 409, the SDK will return an endpoint-specific error as described in the API. This will be made available as EndpointError member in the error.

Note on using the Teams API

To use the Team API, you will need to create a Dropbox Business App. The OAuth token from this app will only work for the Team API.

Please read the API docs carefully to appropriate secure your apps and tokens when using the Team API.

Code Generation

This SDK is automatically generated using the public Dropbox API spec and Stone. See this README for more details on how code is generated.

Caveats

  • To re-iterate, this is an UNOFFICIAL SDK and thus has no official support from Dropbox
  • Only supports the v2 API. Parts of the v2 API are still in beta, and thus subject to change
  • This SDK itself is in beta, and so interfaces may change at any point
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].