{"id":36741443,"url":"https://github.com/devodev/go-office365","last_synced_at":"2026-01-12T12:29:08.146Z","repository":{"id":57521775,"uuid":"249822330","full_name":"devodev/go-office365","owner":"devodev","description":"A CLI written in Go for interacting with the Microsoft Office365 Management Activity API","archived":false,"fork":false,"pushed_at":"2020-04-18T00:12:57.000Z","size":252,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T03:48:10.254Z","etag":null,"topics":["cli","go","golang","microsoft","office365"],"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/devodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-24T21:30:15.000Z","updated_at":"2024-02-23T20:00:41.000Z","dependencies_parsed_at":"2022-08-26T20:23:45.257Z","dependency_job_id":null,"html_url":"https://github.com/devodev/go-office365","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/devodev/go-office365","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fgo-office365","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fgo-office365/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fgo-office365/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fgo-office365/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devodev","download_url":"https://codeload.github.com/devodev/go-office365/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fgo-office365/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","go","golang","microsoft","office365"],"created_at":"2026-01-12T12:29:08.086Z","updated_at":"2026-01-12T12:29:08.140Z","avatar_url":"https://github.com/devodev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/devodev/go-office365\"\u003e\n    \u003cimg alt=\"go-office365\" src=\"assets/go-office365-logo.png\" width=\"500\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  A CLI as well as a library to interact with the Microsoft Office365 Management Activity API.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/golang/go/wiki/Modules\"\u003e\n        \u003cimg alt=\"GitHub go.mod Go version\" src=\"https://img.shields.io/github/go-mod/go-version/devodev/go-office365\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/mod/github.com/devodev/go-office365\"\u003e\n        \u003cimg alt=\"go.dev reference\" src=\"https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/devodev/go-office365\"\u003e\n        \u003cimg alt=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/devodev/go-office365\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/devodev/go-office365/releases\"\u003e\n        \u003cimg alt=\"Release\" src=\"https://github.com/devodev/go-office365/workflows/Release/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/devodev/go-office365/tags\"\u003e\n        \u003cimg alt=\"GitHub tag (latest SemVer)\" src=\"https://img.shields.io/github/v/tag/devodev/go-office365?sort=semver\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/devodev/go-office365/blob/master/LICENSE.txt\"\u003e\n        \u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/github/license/devodev/go-office365?style=flat\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Overview\n`go-office365` provides a client library for the `Microsoft Office365 Management Activity API` written in [Go](https://golang.org/). It follows the Microsoft API Reference available [here](https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-reference).\n\n`go-office365` is also a CLI application with everything you need to interact with the API on the command line.\n\nCurrently, **`go-office365` requires Go version 1.13 or greater**.\n\n#### Supported Architectures\nWe provide pre-built go-office365 binaries for Windows, Linux and macOS (Darwin) architectures, in both 386/amd64 flavors.\u003c/br\u003e\nPlease see the release section [here](https://github.com/devodev/go-office365/releases).\n\n## Table of Contents\n\n- [Overview](#overview)\n  - [Supported Architectures](#supported-architectures)\n- [Get Started](#get-started)\n  - [Build](#build)\n- [CLI](#cli)\n  - [Usage](#usage)\n  - [Configuration file](#configuration-file)\n  - [Interval flags](#interval-flags)\n  - [Watcher](#watcher)\n    - [How it works](#how-it-works)\n  - [Extended Schemas](#extended-schemas)\n- [Roadmap](#roadmap)\n  - [CLI Commands](#cli-commands)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Get Started\n`go-office365` uses Go Modules introduced in Go 1.11 for dependency management.\n\n### Build\nBuild the CLI for a target platform (Go cross-compiling feature), for example linux, by executing:\n```\n$ mkdir $HOME/src\n$ cd $HOME/src\n$ git clone https://github.com/devodev/go-office365.git\n$ cd go-office365\n$ env GOOS=linux go build -o go_office365_linux ./cmd/go-office365\n```\nIf you are a Windows user, substitute the $HOME environment variable above with %USERPROFILE%.\n\n## CLI\n### Usage\n\u003e Auto-generated documentation for each command can be found [here](./docs/go-office365.md).\n```\nInteract with the Microsoft Office365 Management Activity API.\n\nUsage:\n  go-office365 [command]\n\nAvailable Commands:\n  audit         Query audit records for the provided audit-id.\n  content       Query content for the provided content-type.\n  content-types List content types accepted by the Microsoft API.\n  fetch         Query audit records for the provided content-type.\n  gendoc        Generate markdown documentation for the go-office365 CLI.\n  help          Help about any command\n  start-sub     Start a subscription for the provided Content Type.\n  stop-sub      Stop a subscription for the provided Content Type.\n  subscriptions List current subscriptions.\n  watch         Query audit records at regular intervals.\n\nFlags:\n  -h, --help   help for go-office365\n\nUse \"go-office365 [command] --help\" for more information about a command.\n```\n\n### Configuration file\nCommands that need to interact with the API require credentials to be provided using a YAML configuration file.\u003c/br\u003e\nThe following locations are looked into if the --config flag is not provided:\n```\n$HOME/.go-office365.yaml\n$CWD/.go-office365.yaml\n```\n\nThe following is the current schema used.\n\n\u003e Identifier is provided on all queries to the Microsoft API as the `PublisherIdentifier` query param and is(was?) used to compute quotas. When empty, the param is not sent.\n\n\u003eCredentials can be found in `Azure Active Directory`, under: `Installed apps`.\u003c/br\u003e\n\n```\n---\nGlobal:\n  Identifier: some-id\nCredentials:\n  ClientID: 00000000-0000-0000-0000-000000000000\n  ClientSecret: 00000000000000000000000000000000\n  TenantID: 00000000-0000-0000-0000-000000000000\n  TenantDomain: some-company.onmicrosoft.com\n```\n\n### Interval flags\nCommands that need to use a fixed interval will offer flags to set the start and end times.\u003c/br\u003e\nHere are the guidelines to follow when providing those flags.\n\n```\n- Both or neither of start/end time must be provided.\n- When not provided, a 24 hour interval is used.\n- Start and end time interval must be between 1 minute and 24 hours.\n- Start time must not be earlier than 7 days behind the current time.\n- Time format must match one of: 2006-01-02, 2006-01-02T15:04, 2006-01-02T15:04:05\n```\n\n### Watcher\nThe `watch` command provides a daemon like process for retrieving audit records at regular intervals.\u003c/br\u003e\nIt uses a minimum amount of resources and a lot of useful flags can be provided.\u003c/br\u003e\n\u003e For more details on what flags can be used, see the command documentation [here](./docs/go-office365_watch.md).\n\n#### How it works\n- Upon starting, a data structure is initialized to retain the last request time and the last content creation time. A statefile location can be provided for persisting state between restarts.\u003c/br\u003e\n- Following, a resource handler is spawned. It is responsible for receiving, formatting and sending records to the selected output.\u003c/br\u003e\n- Then, for each each Microsoft content type, a data pipeline is spawned. When triggered, it will query and relay audit records to the resource handler.\u003c/br\u003e\n- At fixed intervals, a subscription worker is spawned. It will query the content subscriptions currently enabled and will trigger the appropriate data pipelines.\u003c/br\u003e\n\n### Extended Schemas\nBy default, audit events are retrieved and stored using the AuditRecord type. An option is available to\nadd remaining fields, when present, depending on the RecordType provided in the Record.\u003c/br\u003e\nWhenever an extended schema assigned to a RecordType fails to parse the remaining fields, the base AuditRecord is returned.\n\n## Roadmap\n### CLI Commands\n- `start-sub`: Add flag to provide a webhook object definition\n\n## Contributing\n\u003e This is my first contribution to the open source community, so please feel free to open issues and discuss how you would improve the current code. I am eager to read you and learn from the community. Thanks!\u003c/br\u003e`@devodev`\n\nThis repository is under heavy development and is subject to change in the near future.\u003c/br\u003e\nVersioning will be locked and a proper contributing section will be created in a timely manner, when code is stabilized.\u003c/br\u003e\n\n## License\n`go-office365` is released under the MIT license. See [LICENSE.txt](LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevodev%2Fgo-office365","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevodev%2Fgo-office365","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevodev%2Fgo-office365/lists"}