Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

IBM Think Session 3249 Watson Work Services Java SDK

412 views

Published on

Session at IBM Think 2018 on Watson Work Services Java SDK

Published in: Software
  • Be the first to comment

  • Be the first to like this

IBM Think Session 3249 Watson Work Services Java SDK

  1. 1. 3249 DEVELOPING WITH WATSON WORK SERVICES JAVA SDK Paul Withers, Intec Systems Ltd Think 2018 #IBMThink
  2. 2. Paul Withers ICS Developer, Intec Systems OpenNTF Board Member Lifetime IBM Champion Co-developer Watson Work Services Java SDK Notes Developer XPages Developer Java Developer Watson Work Services Developer
  3. 3. Agenda* Introduction App Pre-Requisites and Basics Watson Work Services Watson Work Services Java SDK * Powered by Watson Workspace Emoticons
  4. 4. So You Want To… Build apps Integrate with Watson Workspace / Work Services Code in Java
  5. 5. APP PRE-REQUISITES AND BASICS
  6. 6. Setup Workspace App Create app at https://workspace.ibm.com/developer/apps Make a note of appId and appSecret All code will need them! Secret is only shown when app is created Can now be regenerated!
  7. 7. OAuth 2.0 Your Java Application Watson Workspace Request Authorisation Code https://api.watsonwork.ibm.com/oauth/authorize Use Token in Subsequent Requests Return Authorisation Code Request Authentication Token https://api.watsonwork.ibm.com/oauth/token Return Authentication Token
  8. 8. Development scope=ibmid redirecturi just needs to be accessible to browser Webhooks need externally accessible URL • Use ngrok
  9. 9. IDEs Bring Your Own IDE - Eclipse - IntelliJ - Domino Designer Bring Your Own REST Client - Postman - REST Client plugin for Firefox
  10. 10. Watson Work Services
  11. 11. Watson Work Services APIs REST API Endpoints GET /oauth/authorize, /oauth/token POST /v1/spaces/{spaceId}/files POST /photos POST /v1/focus GraphQL Endpoint POST /graphql
  12. 12. GraphQL Explorer You could create / parse JSON manually in Java
  13. 13. Watson Work Services Java SDK
  14. 14. Watson Work Services Java SDK
  15. 15. XPages packaged plugin on OpenNTF Download jar from OpenNTF / Maven Central Maven Using The SDK <dependency> <groupId>org.opencode4workspace.watson-work-services</groupId> <artifactId>wws.parent</artifactId> <version>0.8.1</version> <type>pom</type> </dependency> <dependency> <groupId>org.opencode4workspace.watson-work-services</groupId> <artifactId>wws-api</artifactId> <version>0.8.1</version> </dependency>
  16. 16. Using the SDK Efficiently Source code on Stash (inc. Junit, integration tests) Latest documentation on OpenNTF Wiki, Javadoc
  17. 17. Using the SDK WWClient authentication as application/user Builder pattern for easy generation and compile-time validation of queries Methods to output query and response as strings for debugging Gson for conversion of response to objects Methods to parse error responses
  18. 18. Basic Sample
  19. 19. More Complex Example
  20. 20. Speed Test Notifications from Domino to Watson Workspace
  21. 21. Solving a Real World Problem
  22. 22. Demo
  23. 23. Links Demo Watson Work Service Java SDK Documentation OpenNTF Project Watson Workspace Documentation Watson Work Services Explorer Questions?
  24. 24. Paul Withers ICS Developer, Intec System Ltd http://www.intec.co.uk/blog @paulswithers https://watsonwork.me/pwithers@intec.co.uk

×