/sendbird

A golang library for the sendbird.com Server API

Primary LanguageGo

Golang Sendbird Server API Client

Build Status Coverage Status Go Report Card GoDoc

You can view the Sendbird Server API docs here: https://sendbird.gitbooks.io/sendbird-server-api/content/en/

Usage

  1. Create a Sendbird Application at https://dashboard.sendbird.com/ to get an APP_ID and an API_TOKEN
  2. Run go get github.com/ippy04/sendbird
import "github.com/ippy04/sendbird"

sb := sendbird.NewClient(SENDBIRD_APP_ID, SENDBIRD_API_TOKEN, nil)

Examples

To create a new user:

import "github.com/ippy04/sendbird"

func createUser() {
	sb := sendbird.NewClient(SENDBIRD_APP_ID, SENDBIRD_API_TOKEN, nil)

	params := sendbird.UserRequest{
		Id:               "123456",
		Nickname:         "nickname",
		ImageUrl:         "http://sendbird.com/picture_url",
		IssueAccessToken: true,
	}

	user, _, err := sb.User.Create(params)
	if err != nil {
		log.Fatal("User not created")
	}
}

See tests for more examples