Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simayosi/rb-msgraph-client
Simple Microsoft Graph client gem
https://github.com/simayosi/rb-msgraph-client
Last synced: about 1 month ago
JSON representation
Simple Microsoft Graph client gem
- Host: GitHub
- URL: https://github.com/simayosi/rb-msgraph-client
- Owner: simayosi
- License: mit
- Created: 2022-01-18T09:53:42.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-18T14:48:57.000Z (almost 3 years ago)
- Last Synced: 2024-09-14T14:38:12.784Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MSGraph::Client
[![Gem Version](https://badge.fury.io/rb/msgraph-client.svg)](https://badge.fury.io/rb/msgraph-client)
![Ruby](https://github.com/simayosi/rb-msgraph-client/actions/workflows/test.yml/badge.svg)A simple client library for Microsoft Graph.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'msgraph-client'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install msgraph-client
## Getting started
To call Graph API using this library, you need an access token.
A choice for aquiring the access token is
[MSIDP::Endpoint](https://github.com/simayosi/rb-msidp-endpoint).### Usage example
```ruby
require 'msgraph/client'client = MSGraph::Client.new
# Aquire an access token and set it to `token`
endpoint = "/v1.0/users?$filter=startswith(givenName, 'J')&$top=5"
# For paging
while endpoint
response = client.request(:get, endpoint, token)
response[:value].each do |user|
# do something
end
# Next page
endpoint = response[MSGraph::NEXT_LINK_KEY]
end
```## API Reference
[RubyDoc.info](https://rubydoc.info/gems/msgraph-client)## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).