Skip to content

Commit a9299b0

Browse files
authored
Update api-access.md
1 parent 2c1981f commit a9299b0

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

Diff for: docs/watsonx-assistant/api-access.md

+19-17
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,46 @@ This page will demonstrate how to access watsonx Assistant via an API call.
1313

1414
1. Access watsonx Assistant from Resource List in the IBM Cloud Account
1515

16-
![test](../assets/api-access/resource.png)
16+
![test](../assets/api-access/resource.png)
1717

1818
2. Get API Key for watsonx Assistant from Launch webpage
19-
![test](../assets/api-access/api.png)
19+
![test](../assets/api-access/api.png)
2020

2121
3. Get Serice Instance URL from Launch webpage
22-
![test](../assets/api-access/url.png)
22+
![test](../assets/api-access/url.png)
2323

2424
4. Get Assistant ID from webpage within the Assistant settings
2525

2626
- Head to the Homepage of your assistant:
27-
![test](../assets/api-access/assistant-page.png)
27+
![test](../assets/api-access/assistant-page.png)
2828

2929
- Access the Assistant Settings on the bottom left corner of the page:
30-
![test](../assets/api-access/assistant-settings.png)
30+
![test](../assets/api-access/assistant-settings.png)
3131

3232
- Select *View details* on the Assistant IDs and API details section of the page:
33-
![test](../assets/api-access/view-details.png)
33+
![test](../assets/api-access/view-details.png)
3434

3535
- Get the required information from this pop-up window:
36-
![test](../assets/api-access/details.png)
36+
![test](../assets/api-access/details.png)
3737

3838
5. Copy the Skill ID from the watsonx Assistant settings
3939

4040
6. Obtain the Session ID from CLI CURL
4141

42-
```{}
43-
curl -X POST -u "apikey:{apikey}" "{url}/v2/assistants/{environment_id}/sessions?version=2021-11-27"
44-
```
42+
```{}
43+
curl -X POST -u "apikey:{apikey}" "{url}/v2/assistants/{environment_id}/sessions?version=2021-11-27"
44+
```
4545
7. Get all parameters from CLI CURL
4646

47-
```{}
48-
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/skills/{skill_id}?version=2021-11-27"
49-
```
47+
```{}
48+
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/skills/{skill_id}?version=2021-11-27"
49+
```
5050

5151
8. Run Query from CLI CURL as API call to watsonx Agent
5252

53-
```{}
54-
curl -X POST -u "apikey:{apikey}" --header "Content-Type:application/json" --data "{\"input\": {\"text\":
55-
\"Hello\"}}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2024-08-25"
56-
```
53+
```{}
54+
curl -X POST -u "apikey:{apikey}" --header "Content-Type:application/json" --data "{\"input\": {\"text\":
55+
\"Hello\"}}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2024-08-25"
56+
```
57+
58+
Cheers! Now you can chat with your watsonx Assistant via API.

0 commit comments

Comments
 (0)