Package: robin.io-py
Robin.io-pyTable of contentsTable of ContentsIntroductionPrerequisitesGetting StartedSending your first messageLicenseView Documentation HereIntroductionRobin.io-py is a Python SDK built to communicate with theRobinapp API. Now you can integrateRobin.iowith minimal effort and quickly setup a real-time messaging platform in your Web application.PrerequisitesThe following packages are required to use the sdk:RequestsWebsocket-ClientGetting startedStep 1: Create a Robinapp accountA Robinapp account comprises everything required in a chat service including users, message, and api-keys. To create an application:Go to theRobinapp Dashboardand enter your email and password, and create a new account.Navigate toApi Configand copy yourAPI keyNote: All the data is limited to the scope of a single user account, thus the users in different Robinapp accounts are unable to chat with each other.Step 2: Install the Chat SDK## PIP

  pip3 install robin.io-pySending your first messageFollow the step-by-step instructions below to authenticate and send your first message.AuthenticationTo use the features of the Chat SDK in your client app, arobininstance must be initiated in each client app before user authentication with Robin server. These instances communicate and interact with the server based on an authenticated user account, allowing for the client app to use the Chat SDK features.Step 1: Initialize the Chat SDKTo initialize aRobininstance, pass theAPI keyas the first argument to in theRobin()method, You can find your API key in the API Configuration tab in yourRobin Account.Thentrueorfalsefor as the second parameter as it tells the sdk whether to load with ssl or not.Note: It is recommended to initialize the Chat SDK at the top of your Python file.robin=Robin("<api_key>",True)Step 2: Connect to Robin serverYou'll need aUSER_TOKENto connect to the Robin server.A. Create User TokenCreate user tokenresponse=robin.create_user_token(data={"meta_data":{"name":"Samuel 0.",}})Connect to the Robin server using theUSER_TOKENyou just created.robin.connect(user_token="<api_key>")Step 3: ChannelsAll messages sent via Robin are sent through channels, you can consider channels as tunnels that relay messages to all connected clients.Step 4: Create a conversationBefore we can send a message to a channel we first need to create a converstion.response=robin.create_conversation(sender_token="<sender_token>",sender_name="<sender_name>",receiver_token="<reciever_token>",receiver_name="<reciever_name>")Step 5: Send a message to a conversationFinally, send a message to a conversation.robin.send_conversation_message(msg={},channel="<channel_id>",conversation_id="<conversation_id>",sender_token="<sender_token>")OptionsThe following are general attributes used in Robin:AttributeTypeDefaultDescriptionConnWebSocketnullWebsocket opbject returned after calling robin.connect()sender_nameString''Name of the person sending the messagesender_tokenString''USER_TOKEN of the person sending the messagereceiver_nameString''Name of the person receiving the messagereceiver_tokenString''USER_TOKEN of the person receiving the messagemsgObject{}Json serializable object containing the messageIf you have any comments or questions regarding bugs and feature requests, visitRobinapp community.View Documentation Here.LicenseDistributed under the MIT License. SeeLICENSEfor more information.