You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -114,7 +115,7 @@ Watson services are migrating to token-based Identity and Access Management (IAM
114
115
115
116
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
116
117
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
117
-
- If you're using a Watson service on ICP, you'll need to authenticate in a [specific way](#icp).
118
+
- If you're using a Watson service on Cloud Pak for Data, you'll need to authenticate in a [specific way](#cloud-pak-for-data).
118
119
119
120
### Getting credentials
120
121
@@ -170,68 +171,56 @@ Some services use token-based Identity and Access Management (IAM) authenticatio
170
171
You supply either an IAM service **API key** or an **access token**:
171
172
172
173
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
173
-
- Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson/getting-started-iam.html). If you want to switch to API key, override your stored IAM credentials with an IAM API key. Then call the `setIamCredentials()` method again.
174
+
- Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson/getting-started-iam.html).
174
175
175
176
176
177
Supplying the IAM API key:
177
178
178
179
```java
179
180
// letting the SDK manage the IAM token
180
-
IamOptions options =newIamOptions.Builder()
181
-
.apiKey("<iam_api_key>")
182
-
.url("<iam_url>") // optional - the default value is https://iam.cloud.ibm.com/identity/token
183
-
.build();
184
-
Discovery service =newDiscovery("2017-11-07", options);
The HTTP client can be configured by using the `configureClient()` method on your service object, passing in an `HttpConfigOptions` object. Currently, the following options are supported:
260
249
- Disabling SSL verification (only do this if you really mean to!) ⚠️
261
250
- Using a proxy (more info here: [OkHTTPClient Proxy authentication how to?](https://stackoverflow.com/a/35567936/456564))
251
+
- Setting HTTP logging verbosity
262
252
263
-
Here's an example of setting both of the above:
253
+
Here's an example of setting the above:
264
254
265
255
```java
266
256
Discovery service =newDiscovery("2017-11-07");
@@ -269,6 +259,7 @@ Discovery service = new Discovery("2017-11-07");
It's possible that you may want to cancel a request you make to a service. For example, you may set some timeout threshold and just want to cancel an asynchronous if it doesn't respond in time. You can do that by calling the `cancel()` method on your `ServiceCall` object. For example:
346
+
347
+
```java
348
+
// time to consider timeout (in ms)
349
+
long timeoutThreshold =3000;
350
+
351
+
// storing ServiceCall object we'll use to list our Assistant v1 workspaces
Copy file name to clipboardExpand all lines: compare-comply/README.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,8 @@
19
19
## Usage
20
20
Use the [Compare and Comply](https://cloud.ibm.com/docs/services/compare-comply/index.html#about) service to enable better and faster document understanding. Below is an example of converting a PDF file into HTML:
21
21
```java
22
-
CompareComply service =newCompareComply("2018-10-15");
Copy file name to clipboardExpand all lines: natural-language-classifier/README.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,8 @@
20
20
Use [Natural Language Classifier](https://cloud.ibm.com/docs/services/natural-language-classifier?topic=natural-language-classifier-natural-language-classifier) service to create a classifier instance by providing a set of representative strings and a set of one or more correct classes for each as training. Then use the trained classifier to classify your new question for best matching answers or to retrieve next actions for your application.
21
21
22
22
```java
23
-
NaturalLanguageClassifier service =newNaturalLanguageClassifier();
The Watson Text to Speech service supports the use of WebSockets as an alternative to the `synthesize()` method, which converts text to speech. Here is an example of using the WebSocket version of the method to get an audio file:
0 commit comments