A simple client for the HelpSocial API.
A simple rest client can be created with or without an authenticated user.
The client handles authenticating the requests using the most permissive authentication available. This can be overridden by using your own auth provider.
The RestConnectionClient gives you access direct access to the http verb methods (get, post, put, and delete) which can be used to make any available rest connect api call. Some of the more common tasks are also exposed through simple helper methods.
from client import RestConnectClient
client = RestConnectClient('<your auth_scope>', '<your api_key>')
client.get('<path>')
client.post('<path>')
client.put('<path>')
client.delete('<path>')
from client import RestConnectClient
client = RestConnectClient('<your auth_scope>',
'<your api_key>',
user_token='<user token>')
client.get('<path>')
client.post('<path>')
client.put('<path>')
client.delete('<path>')
For advanced usage see the examples/
directory.
Name | Description |
---|---|
auth.py | Authenticates a user. |
stream.py | Open realtime and historical stream. Available streams: sse, activities, conversations, events |
get_profiles.py | Script to retrieve available network profiles for the authenticated user. |
social.py | Engage with activities through the HelpSocial Connect API. |
launch_conversation.py | Launch the conversation single page application. |
file: auth.py
usage:
python3 auth.py USERNAME
file: stream.py usage:
python3 stream.py sse
file: stream.py
usage:
python3 stream.py activities
python3 stream.py activities bounded 20171024T140000 20171024T200000
file: stream.py usage:
python3 stream.py conversations
python3 stream.py conversations bounded 20171024T140000 20171024T200000
file: stream.py usage:
python3 stream.py events
python3 stream.py events bounded 20171024T140000 20171024T200000
file: social.py
usage:
python3 social.py {facebook|instagram|twitter} reply [ ... ]
file: social.py
usage:
python3 social.py {facebook|instagram|twitter} share [ ... ]
file: social.py
usage:
python3 social.py {facebook|twitter} create [ ... ]
file: launch_conversation.py
usage:
python3 launch_conversation.py single 1