/go-digits

DEPRECATED, Google acquired Digits from Twitter and shut it down Sep. 30th 2017

Primary LanguageGoMIT LicenseMIT

go-digits Build Status GoDoc

go-digits is a Go client library for the Digits API. Check the usage section or the examples to learn how to access the Digits API.

Features

  • AccountService for getting Digits accounts
  • Get verified user phone numbers and email addresses
  • ContactService for finding matching contacts ("friends")
  • Digits API Client accepts any OAuth1 http.Client

Install

go get github.com/dghubble/go-digits/digits

Docs

Read GoDoc

Usage

The digits package provides a Client for accessing the Digits API. Here is an example request for a Digit user's Account.

import (
    "github.com/dghubble/go-digits/digits"
    "github.com/dghubble/oauth1"
)

config := oauth1.NewConfig("consumerKey", "consumerSecret")
token := oauth1.NewToken("accessToken", "accessSecret")
// OAuth1 http.Client will automatically authorize Requests
httpClient := config.Client(oauth1.NoContext, token)

// Digits client
client := digits.NewClient(httpClient)
// get current user's Digits Account
account, resp, err := client.Accounts.Account()

Authentication

The API client accepts any http.Client capable of signing OAuth1 requests to handle authorization. See the OAuth1 package dghubble/oauth1 for details and examples.

To implement Login with Digits for web or mobile, see the gologin package and examples.

Contributing

See the Contributing Guide.

License

MIT License