It may be desirable for an application to provide for a custom flow to invite users into a workspace. Here is how such a flow could be implemented.
First POST
an invitation request to the workspace resource:
https://api.zenginehq.com/v1/workspace/10001/invitees
With parameters
Where:
Parameter | Description |
---|---|
workspace_id | The id of the workspace |
The deliverable Email address of the user you intend to invite | |
role.id | The id of the access role for the workspace |
notify | False, suppresses automatic email generation |
Would respond with:
The inviteCode return in the response would be programmatically extracted and stored for completing the flow.
Next, you would generate and send your own custom inviation email to the user. The invitateCode would need to be embedded in the body with a link back to your service that will process the invitation if accepted.
For example embedded in a mime, quoted-printable mail body:
=09=09=09=09=09<br><br><a target=3D"_blank" href=3D"https://service= s.something.com?inviteCode=a83b5331fc6dcd93cd9a051f114095e7&workspace.id= =3D10001&email=someone%40example.com" style=3D"color: #fff; text-decorat= ion: none; font-weight: normal; -webkit-border-radius: 2px; -moz-border-rad= ius: 2px; border-radius: 2px; display: inline-block; background-color: #29b= 2e6; margin: 0 10px 0 0; padding: 6px 40px;">Accept Invitation to Join Cust= om Workspace</a>
When you receive the request to accept the invitation in your service, extract the inviteCode. Then POST
a members request to the original workspace resource:
https://api.zenginehq.com/v1/workspace/10001/members
With parameters
Would respond with: