Creating and populating conversations¶
Reference: {#RefCreateAndPopulateConvs}
Author: Matthias Fischmann
This will walk you through creating and populating a conversation using curl commands and the credentials of an ordinary user (member role).
If you have a system for identity management like a SAML IdP, you may be able to use that as a source of user and group information, and write a script or a program based on this document to keep your wire conversations in sync with your groups.
Sidenote: in the future we may implement groups in our SCIM API to handle conversations. For the time being, we hope you consider the approach explained here a decent work-around.
Prerequisites¶
We will talk to the backend using the API that the clients use, so we need a pseudo-user that we can authenticate as. We assume this user has been created by other means. For the sake of testing, you could just use the team admin (but you don’t need admin privileges for this user).
So here is some shell environment we will need:
Now you can login and get a wire token to authenticate all further requests:
This token will be good for 15 minutes; after that, just repeat.
If you don’t want to install jq, you can just call the curl
command and copy the access token into the shell variable manually.
Here is a quick test that you’re logged in:
Contact requests¶
If $WIRE_USER
is in a team, all other team members are implicitly connected to it. So for the users in your team, you don’t have to do anything here.
TODO: contact requests to users not on the team.
Conversations¶
To create a converation with no users (except the pseudo-user creating it):
The users
field can contain UUIDs that need to point to existing wire users (in your team or not), and $WIRE_USER
needs to have an accepted connection with them. You can extract these ids from the corresponding SCIM user records. If in doubt, leave empty.
You can also add and remove users once the converation has been created:
You can also look at one or all conversations:
Finally, conversations can be renamed or deleted:
Advanced topics¶
TODO: pseudo-user leaving the conv, and being added by admin for changes later.