The purpose of this tutorial is to show you how to connect to the Engagement History API in Java.
The Engagement History API is a REST API that is offered through LivePerson that allows you to pull your chat transcripts without having to manually go through and export them. In order to connect to the API, you will need to get a set of API keys from LivePerson and install them on your account. Once you have done this, you will need to send an OAuth 1 request to the server in order to access your transcripts.
If you are not familiar with OAuth 1, you can read more about it here: http://oauth.net/core/1.0/
So, in your src/main/java folder, you will need to create a new class called EngagementHistory.java. Once the class is created, you will need to add the following code to it:
Basically, we are using Scribe to create our OAuth service, and once we do this we our using our credentials for the API to create and sign our OAuth request. Once this is done, we send the request and print it to the console. Please see the comments in the code for what each line is doing.
You can download the complete code on GitHub from here: https://github.com/scottwestover/LPEngagementHistoryAPIExamples
Summary: This tutorial showed you how to connect to the Engagement History API in Java by using Scribe. You can build upon this tutorial by adding the option to allow the user to input a date range, convert the response into a transcript file that is in a readable format, or even send the responses to a database.
I hope you enjoyed this tutorial. If you have any questions or comments, please feel free to post them below.