{"id":19037087,"url":"https://github.com/retgits/bitly","last_synced_at":"2025-04-23T19:15:29.986Z","repository":{"id":143785175,"uuid":"179895161","full_name":"retgits/bitly","owner":"retgits","description":"A Go package to interact with the Bitly API","archived":false,"fork":false,"pushed_at":"2020-09-15T14:55:01.000Z","size":13,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T02:41:32.686Z","etag":null,"topics":["bitly","bitly-api","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retgits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-06T22:50:29.000Z","updated_at":"2023-02-08T19:37:39.000Z","dependencies_parsed_at":"2023-06-18T18:47:52.313Z","dependency_job_id":null,"html_url":"https://github.com/retgits/bitly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fbitly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fbitly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fbitly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retgits%2Fbitly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retgits","download_url":"https://codeload.github.com/retgits/bitly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249352148,"owners_count":21255853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitly","bitly-api","golang"],"created_at":"2024-11-08T21:58:37.517Z","updated_at":"2025-04-17T15:31:32.433Z","avatar_url":"https://github.com/retgits.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitly\n\n[![Godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/retgits/bitly)\n\nIf you'd like to use [Bitly](https://bitly.com) to shorten, brand, share, or retrieve data from links using [Go](https://golang.org), this is the right module you're looking for. This lib is a wrapper on top of the [v4 Bitly API](https://dev.bitly.com/v4_documentation.html).\n\n## Why build this?\n\nI think [Bitly](https://bitly.com) is an awesome service, but to interact with it using the API, and marshaling and unmarshalling the data every time was a bit of a mess. Because there wasn't a good Go module available yet, I decided to build my own.\n\n## Usage\n\nTo use the Bitly module, you'll need to create a [Generic Access Token](https://bitly.is/accesstoken). That access token can be used to create the _bitly client_.\n\n```go\nimport (\n\t\"fmt\"\n\n\t\"github.com/retgits/bitly/client\"\n)\n\nfunc main() {\n\tbitly := client.NewClient().WithAccessToken(\"\u003cmyAccessToken\u003e\")\n\tfmt.Println(bitly.AccessToken)\n}\n```\n\nDepending on which type of resource you want to access, you'll need to import one of the services\n\n```go\nimport (\n    \"github.com/retgits/bitly/client/bitlinks\" // If you want to use the bitlinks resource\n    \"github.com/retgits/bitly/client/bsds\" // If you want to use the bsds resource\n    \"github.com/retgits/bitly/client/groups\" // If you want to use the groups resource\n    \"github.com/retgits/bitly/client/organizations\" // If you want to use the organizations\n    \"github.com/retgits/bitly/client/users\" // If you want to use the users resource\n)\n```\n\nFor example, getting the details of the user would be\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/retgits/bitly/client\"\n\t\"github.com/retgits/bitly/client/users\"\n)\n\nfunc main() {\n\t// Generate a new Bitly client\n\tbitly := client.NewClient().WithAccessToken(\"\u003cmyAccessToken\u003e\")\n\t// Create a new users service\n\tusersSvc := users.New(bitly)\n\t// Get the details of your user\n\tme, err := usersSvc.RetrieveUser()\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n    fmt.Printf(\"User details: %+v\\n\", me)\n    // Result\n    // User details: {Created:2018-08-05T22:08:53+0000 Modified:2018-08-05T22:29:42+0000 Login:myOrganization IsActive:true Is2FaEnabled:false Name:John Doe Emails:[{Email:user@example.org IsPrimary:true IsVerified:true}] IsSsoUser:false DefaultGroupGUID:myGuid}\n}\n```\n\n## Contributing\n\nIf something is missing, or if you'd like to suggest new features feel free to [create an issue](https://github.com/retgits/bitly/issues/new) or a [PR](https://github.com/retgits/bitly/compare)! The code is structured as\n\n```text\n├── LICENSE\n├── README.md\n├── client\n│   ├── bitlinks       \u003c-- Bitlinks service\n│   │   ├── api.go     \u003c-- The types and helper methods for the service\n│   │   └── service.go \u003c-- The methods that can be used with this module\n│   ├── bsds           \u003c-- BSDs service\n│   │   ├── api.go\n│   │   └── service.go\n│   ├── groups         \u003c-- Groups service\n│   │   ├── api.go\n│   │   └── service.go\n│   ├── http.go\n│   ├── organizations  \u003c-- Organizations service\n│   │   ├── api.go\n│   │   └── service.go\n│   └── users          \u003c-- Users service\n│       ├── api.go\n│       └── service.go\n└── go.mod\n```\n\n## License\n\nSee the [LICENSE](./LICENSE) file in the repository\n\n## Acknowledgements\n\nA most sincere thanks to the team of [Bitly](https://bitly.com), for building such an awesome service that I enjoy every day!\n\n_This package is not endorsed by Bitly_","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretgits%2Fbitly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretgits%2Fbitly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretgits%2Fbitly/lists"}