It is possible to automate the process of tracking user activity in a stream. The following script will automate this process via a configuration file, plus some work with the authentication keys, a Service Account and a StreamID.
Note: This script uses Python, please install this before attempting to run the script.
Note: This script takes an optional since argument (epoch timestamp) to search within a given timeframe. The script by default searches the last 7 days of stream activity.
Note: This is an unsupported script which has been developed for users as a guideline to adapt accordingly.
1. Install the Python SDK file (Figure 1):
Figure 1 Pip command
2. You are required to have the following items which are passed through to the script to ensure it is executed successfully:
-
RSA key pair.
-
config.yaml.
3. The RSA key pair must be obtained from your internal IT team as Symphony do not administer your pod. Alternatively, you may be able to create an RSA key pair here.
4. The config.yaml is required in the following format (Figure 2):
host: companyabc.symphony.com # your own pod host name
bot:
username: BOT-USERNAME # your service account username
privateKey:
path: /path/to/bot/rsa-private-key.pem # your bot RSA private key
Figure 2 Config.yaml format
Note: Where companyabc is the name of your pod.
Note: Further information on BDK configuration can be found here.
5. Navigate to the working directory and run the following command (Figure 3):
python streamactivity.py --config /path/to/config.yaml --stream "stream_id"
Figure 3 Execute command
Note: A stream/conversationID will need to be URL Safe Base64 encoded for the APIs in the script to function. Further information about this can be found here.
Note: The full script can be viewed and downloaded from repository located here.
6. If a specific timeframe is required, the following command can be used accordingly (Figure 4):
python streamactivity.py --config /path/to/config.yaml --since epoch_timestamp --stream "stream_id"
Figure 4 Timeframe command
7. Configuring logging is an optional step to run this script, but it can be useful for debugging purposes. If you wish to do this, uncomment lines 13-15 in streamactivity.py and create the following file and directory within the working directory (Figure 5):
Figure 5 File