Hello all,
We are trying to create a custom softphone using workspace client java api. We are successfully received authorization OAuth bearer token. When we try to initiate the workspace object we are receiving following error
com.genesys.workspace.common.WorkspaceApiException: initialize failed.
...
Caused by: com.genesys.internal.common.ApiException: java.net.SocketTimeoutException: Read timed out
at com.genesys.internal.common.ApiClient.execute(ApiClient.java:844)
at com.genesys.internal.workspace.api.SessionApi.initializeWorkspaceWithHttpInfo(SessionApi.java:764)
at com.genesys.workspace.WorkspaceApi.initialize(WorkspaceApi.java:298).
import com.genesys.workspace.WorkspaceApi;
import com.genesys.workspace.models.User;
public class Main {
public static void main(String[] args) throws Exception {
try
{
String apiKey = "<apiKey>";
String apiUrl = "<apiUrl>";
//region Create an instance of WorkspaceApi
//First we need to create a new instance of the WorkspaceApi class with the following parameters: **apiKey** (required to submit API requests) and **apiUrl** (base URL that provides access to the PureEngage Cloud APIs). You can get the values for both of these parameters from your PureEngage Cloud representative.
WorkspaceApi api = new WorkspaceApi(apiKey, apiUrl);
//endregion
//region Authorization code grant
//You'll need to use the Authentication API to get an authorization token. See https://github.com/GenesysPureEngage/authorization-code-grant-sample-app for an example of how to do this.
String authorizationToken = "<authorizationToken1>";
//endregion
//region Initialization
//Initialize the Workspace API with the authorization token from the previous step. This returns the current user, which we then print.
User user = api.initialize(authorizationToken);
System.out.println("The workspace api is now successfully initialized");
System.out.println("User data: " + user);
//endregion
api.destroy();
}
catch(Exception ex)
{
}
}
}