Skip to content

Commit 180ef95

Browse files
docs: update slack client usage instructions (#1635)
Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com> Co-authored-by: Florence Njeri <40742916+Florence-Njeri@users.noreply.github.com>
1 parent fc379fd commit 180ef95

File tree

1 file changed

+6
-4
lines changed
  • packages/templates/clients/websocket/python

1 file changed

+6
-4
lines changed

packages/templates/clients/websocket/python/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ To run the Slack Client example, follow the steps above but with 2 exceptions:
2121
2222
You can use our AsyncAPI's credentials to access different set of events produced in AsyncAPI Slack workspace, in the `#generator` channel.
2323

24-
1. Generate an access ticket with an application ID that will enable you to establish a websocket connection. Replace the following bearer token with real token that you can find in `slack-example.md` document added to bookmarks of `#generator` channel in [AsyncAPI Slack workspace](https://www.asyncapi.com/slack-invite):
24+
1. Make sure you are in the `packages/templates/clients/websocket/python` directory.
25+
1. Install Slack client dependencies by running: `pip install -r test/temp/snapshotTestResult/client_slack/requirements.txt`. If this fails, you probably did not run tests that generate the client. Fix this by running `npm run test`.
26+
1. Generate an access ticket with an application ID that will enable you to establish a websocket connection. Such a ticket can be used only once. You need to generate a new one every time you connect to Slack server. Replace the following bearer token with real token that you can find in `slack-example.md` document added to bookmarks of `#generator` channel in [AsyncAPI Slack workspace](https://www.asyncapi.com/slack-invite):
2527
```
2628
curl --location --request POST 'https://slack.com/api/apps.connections.open' \
27-
--header 'Authorization: Bearer xapp-1-A08NKKBFGBD-8768087393844-b85d0215e33ec13272e523e47d96b602d9dc5e57863e5b2df79d81b999da10bc'
29+
--header 'Authorization: Bearer TAKE_XAPP_TOKEN_FROM_BOOKMARKS_DOC_IN_SLACK'
2830
```
2931
>**Note**: Ensure that you do not expose the real token on GitHub or any other public platform because it will be disabled by Slack.
3032
@@ -35,14 +37,14 @@ You can use our AsyncAPI's credentials to access different set of events produce
3537
3638
You can take generated `url` and use with CLI websocket client like `websocat` (first remove excape backslashes):
3739
```
38-
websocat "wss://wss-primary.slack.com/link/?ticket=089a0c38-cdec-409f-99fa-0ca24e216ea4&app_id=00dfdcccb53a2645dd3f1773fcb10fa7b0a598cf333a990a9db12375ef1865dd"
40+
websocat "wss://wss-primary.slack.com/link/?ticket=5ad694c1-2a81-4cfc-a503-057b8e798120&app_id=00dfdcccb53a2645dd3f1773fcb10fa7b0a598cf333a990a9db12375ef1865dd"
3941
```
4042
4143
But that is just for testing. The point is to use the generated Python client.
4244
4345
1. Start the example that uses generated client. Examine events, and modify example as you want:
4446
```
45-
TICKET=089a0c38-cdec-409f-99fa-0ca24e216ea4 APP_ID=00dfdcccb53a2645dd3f1773fcb10fa7b0a598cf333a990a9db12375ef1865dd python example-slack.py
47+
TICKET=6b150bb1-82b4-457f-a09d-6ff0af1fd2d1 APP_ID=00dfdcccb53a2645dd3f1773fcb10fa7b0a598cf333a990a9db12375ef1865dd python example-slack.py
4648
```
4749
Successfully established connection will welcome you with below event:
4850
```

0 commit comments

Comments
 (0)