diff --git a/invites/README.md b/invites/README.md index 36c407c..76a60ec 100644 --- a/invites/README.md +++ b/invites/README.md @@ -1,40 +1,6 @@ +Manage and send user and group invites + # Invites Service -The invites services allows you to create and manage invites. Example usage: +The invites services allows you to create and manage invites for users and groups by providing invite codes. -```bash -> micro invites create --group_id=myawesomegroup --email=john@doe.com -{ - "invite": { - "id": "fb3a3552-3c7b-4a18-a1f8-08ab56940862", - "group_id": "myawesomegroup", - "email": "john@doe.com", - "code": "86285587" - } -} - -> micro invites list --group_id=fb3a3552-3c7b-4a18-a1f8-08ab56940862 -{ - "invites": [ - { - "id": "fb3a3552-3c7b-4a18-a1f8-08ab56940862", - "group_id": "myawesomegroup", - "email": "john@doe.com", - "code": "86285587" - } - ] -} - -> micro invites read --code=86285587 -{ - "invite": { - "id": "fb3a3552-3c7b-4a18-a1f8-08ab56940862", - "group_id": "myawesomegroup", - "email": "john@doe.com", - "code": "86285587" - } -} - -> micro invites delete --id=fb3a3552-3c7b-4a18-a1f8-08ab56940862 -{} -``` diff --git a/invites/examples.json b/invites/examples.json new file mode 100644 index 0000000..68d966b --- /dev/null +++ b/invites/examples.json @@ -0,0 +1,49 @@ + +{ + "create": [{ + "title": "Create an invite", + "description": "Create an invite for a user for a group", + "request": { + "group_id": "mygroup", + "email": "john@doe.com" + }, + "response": { + "invite": { + "id": "fb3a3552-3c7b-4a18-a1f8-08ab56940862", + "group_id": "mygroup", + "email": "john@doe.com", + "code": "86285587" + } + } + }], + "read": [{ + "title": "Read an invite", + "description": "Read an invite by code", + "request": { + "code": "86285587" + }, + "response": { + "invite": { + "id": "fb3a3552-3c7b-4a18-a1f8-08ab56940862", + "group_id": "mygroup", + "email": "john@doe.com", + "code": "86285587" + } + } + }], + "list": [{ + "title": "List invites", + "description": "List invites for a group by id", + "request": { + "group_id": "mygroup" + }, + "response": { + "invites": [{ + "id": "fb3a3552-3c7b-4a18-a1f8-08ab56940862", + "group_id": "myawesomegroup", + "email": "john@doe.com", + "code": "86285587" + }] + } + }] +}