3. REST API
◆REST interface to Yammer resources
◆Before accessing REST API
◆Register an App at Yammer
◆Your App needs to authenticate a Yammer user
through OAuth2
◆Call REST API endpoints with an access
token
4. OAuth 2.0
◆OAuth is an open standard for authorization. OAuth provides client
applications a 'secure delegated access' to server resources on behalf of a
resource owner.
◆It specifies a process for resource owners to authorize third-party access to
their server resources without sharing their credentials.
5. OAuth 2.0 Roles
◆Resource Owner
e.g. User
◆Resource Server
e.g. Yammer
◆Client
e.g. App
◆Authorization Server
e.g. Resource Server or other server
7. REST API - Register a Yammer App
◆App registration
◆You will get
ClientID、 Client Secret
◆ Define a redirect URL
Expected redirect :
http://xxxxxx
8. REST API - Authenticate
◆App Authenticate
https://www.yammer.com/dialog/oauth?client_id=UX4lY378SU70A4w
QrvIYA&redirect_uri=http://www.yammer.com
◆Authorizing the app your redirected
https://www.yammer.com/ltc.tw/?code=MzBrONB4VZYnNCN7WM
NbQ
9. REST API - Authenticate
Get your Access Token
https://www.yammer.com/oauth2/access_token.json?client_id=UX4lY
378SU70A4wQrvIYA&client_secret=FQyQRYB5zNwGGS0AUjHazmyh
9yohyJw95ZGk7hphdo&code=YtrEO1eQ4PjCJYW29obtTg
10. REST API - Authenticate
◆Request your Access Token
https://www.yammer.com/dialog/oauth?client_id=UX4lY378XX70A4w
QrvIYA&redirect_uri=http://www.yammer.com&response_type=token
◆Get access token from redirected URL:
https://www.yammer.com/ltc.tw/#access_token=9wf7lelwPEexzYgpvaewaA
11. REST API
◆Yammer provides a RESTful interface to the resources in the
Yammer web interface e.g. messages, users, groups etc.
◆Once your app has authenticated a Yammer user, it can call a REST
API endpoint using your access token and get the corresponding
resources.
12. REST API - API Requests
◆Making API Requests With a valid access token, your app can make calls to
any Yammer API endpoint by sending the access token as a “Bearer” token
in the “Authorization” request header.