Skip to content

⚠️Work in Progress: Unofficial Go Package for the https://bonus.ly rewards platform.

License

Notifications You must be signed in to change notification settings

groundfoghub/bonusly-sdk-go

Repository files navigation

⚠️ Important: This Go package is in very early development. Do not use it in production. Everything about this package might change in the future.


Go Reference

(Unofficial) Bonus.ly SDK for Go

At Groundfog we value employee recognition, which is why we love using Bonus.ly. To help us automate a few things we wanted to create a Go package that we can use to create reports or give our employees automated bonuses.

Since we also love sharing with the community and giving back, we decided to build our SDK in the open and allow others to also build something awesome with it as well.

Table of Contents

📦 Installation

(Back to top)

go get github.com/groundfoghub/bonusly-sdk-go

To update the SDK run the following command:

go get -u github.com/groundfoghub/bonusly-sdk-go

✨ Getting Started

(Back to top)

Before you start with the examples, you need to get a valid access token. To get a token login to Bonus.ly and go to https://bonus.ly/api to create a new access token.

Get all users

config := bonusly.Configuration{Token: "<your-access-token>"}
client := bonusly.New(config)

var users []bonusly.User

paginator := bonusly.NewListUsersPaginator(client, nil)
for paginator.HasMorePages() {
    output, err := paginator.NextPage(context.TODO())
    if err != nil {
        return
    }

    users = append(users, output.Users...)
}

fmt.Printf("Found %d users\n", len(users))

Create a bonus

You need a token that allows write access for this example to work.

config := bonusly.Configuration{Token: "<your-access-token>"}
client := bonusly.New(config)

params := bonusly.CreateBonusInput{
    GiverEmail: "leia@examplecorp.com",
    Receivers:  []string{"luke@examplecorp.com"},
    Reason:     "For destroying the Death Star",
    Amount:     25,
}

_, err := client.CreateBonus(context.TODO(), &params)
if err != nil {
    fmt.Println("create bonus: ", err)
}

✅ Implementation Status

(Back to top)

The SDK does not yet cover all of the Bonus.ly API yet. Based on the official API documentation, the following list provides an overview of all the features and their current implementation status.

At the moment we are working on implementing all the features except SCIM, which will follow later. Current progress can be tracked using the All Non-SCIM Features Implemented milestone.

Legend:

  • ✅ Implemented.
  • ⚠️ Partially implemented or can not be exactly fully implemented.
  • ⛔ Not implemented yet.

Achievements

  • ⛔ List Achievements (Issue: #6)

Analytics

  • ⛔ Trends | Index (Issue: #7)
  • ⛔ Leaderboards | Index (Issue: #8)

API Keys

  • ⛔ List API Keys (Issue: #9)
  • ⛔ Create API Key (Issue: #10)
  • ⛔ Cancel API Key (Issue: #11)

Bonuses

  • ⛔ List Bonuses (Issue: #12)
  • ✅ Create a Bonus
  • ⚠️ Create a Bonus with separate fields fo reason, hashtag, receiver and amount
  • ⛔ Retrieve a Bonus (Issue: #13)
  • ⛔ Update a Bonus (Issue: #14)
  • ⛔ Delete a Bonus (Issue: #15)

Company

  • ⛔ Retrieve a Company (Issue: #16)
  • ⛔ [ADMIN] Update a Company (Issue: #17)

Redemptions

  • ✅ List Redemptions
  • ✅ Retrieve a Redemption

Rewards

  • ✅ List Rewards
  • ✅ Retrieve a Reward

SCIM

  • ⛔ List users
  • ⛔ Retrieve a user
  • ⛔ Create a user
  • ⛔ Update an existing user
  • ⛔ Activate or deactivate a user
  • ⛔ Get metadata about the Bonusly SCIM API
  • ⛔ List the SCIM resource types supported by Bonusly
  • ⛔ List the SCIM schemas supported by Bonusly

Users

  • ✅ List Users
  • ✅ Retrieve a User
  • ⛔ Me (Issue: #18)
  • ⛔ Autocomplete (Issue: #19)
  • ⛔ Bonuses (Issue: #20)
  • ⛔ Achievements (Issue: #21)
  • ⛔ Redemptions (Issue: #22)
  • ⛔ Create a Redemption (Issue: #23)
  • ⛔ [ADMIN] Create a User (Issue: #24)
  • ⛔ [ADMIN] Update a User (Issue: #25)
  • ⛔ [ADMIN] Deactivate a User(Issue: #26)

Webhooks

  • ✅ List Webhooks
  • ✅ Create Webhook
  • ✅ Update Webhook
  • ✅ Remove Webhook

✏️ Documentation

(Back to top)

The official Go package documentation can be found at pkg.go.dev.

💖 Contributing

(Back to top)

If you found a bug, have a feature suggestion or just want to help us build the SDK, feel free to file an issue or create a pull requests. Contributions are welcome.

About

⚠️Work in Progress: Unofficial Go Package for the https://bonus.ly rewards platform.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages