Skip to content

Commit a46b1a1

Browse files
author
Tony Bedford
committed
Fixed and tested Member.
1 parent 62eb892 commit a46b1a1

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

conversation/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ Create a new User before proceeding. Make sure you update `config.local.sh`.
5252

5353
### Member
5454

55-
Create a Member
56-
List Members
57-
Get a Member
58-
Update a Member
59-
Delete a Member
55+
1. Create a Member - this will invite a user into a conversation. Add the `MEMBER_ID` to your `config.local.sh`.
56+
2. List Members
57+
3. Get a Member
58+
4. Update a Member - this will change the member from `invited` to `joined`. Use get member to confirm.
59+
5. Delete a Member - Use list members to confirm deletion - the User will have a state `LEFT` as the mebership has been dissolved.
60+
61+
Create a new Member before proceeding. Make sure you update `config.local.sh`.
62+
63+
At this point you will have two members (with same `USER_ID`), one with status `LEFT` and one with `invited`.
6064

6165
### Event
6266

conversation/member/create-member.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/bash
22

3-
source "../config.sh"
3+
source "../../config.sh"
4+
source "../../jwt.sh"
45

56
curl -X "POST" "https://api.nexmo.com/beta/conversations/$CONVERSATION_ID/members" \
67
-H 'Authorization: Bearer '$JWT\
78
-H 'Content-Type: application/json' \
89
-d $'{
9-
"user_id": "$USER_ID",
10+
"user_id": "'$USER_ID'",
1011
"action": "invite",
1112
"channel": {
1213
"type": "app"

conversation/member/delete-member.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
source "../config.sh"
3+
source "../../config.sh"
4+
source "../../jwt.sh"
45

56
curl -X "DELETE" "https://api.nexmo.com/beta/conversations/$CONVERSATION_ID/members/$MEMBER_ID" \
67
-H 'Authorization: Bearer '$JWT\

conversation/member/get-member.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
source "../config.sh"
3+
source "../../config.sh"
4+
source "../../jwt.sh"
45

56
curl "https://api.nexmo.com/beta/conversations/$CONVERSATION_ID/members/$MEMBER_ID" \
67
-H 'Authorization: Bearer '$JWT\

conversation/member/list-members.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
source "../config.sh"
3+
source "../../config.sh"
4+
source "../../jwt.sh"
45

56
curl "https://api.nexmo.com/beta/conversations/$CONVERSATION_ID/members" \
67
-H 'Authorization: Bearer '$JWT\

conversation/member/update-member.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/bash
22

3-
source "../config.sh"
3+
source "../../config.sh"
4+
source "../../jwt.sh"
45

56
curl -X "PUT" "https://api.nexmo.com/beta/conversations/$CONVERSATION_ID/members/$MEMBER_ID" \
67
-H 'Authorization: Bearer '$JWT\
78
-H 'Content-Type: application/json' \
89
-d $'{
9-
"user_id": "$USER_ID",
10+
"user_id": "'$USER_ID'",
1011
"action": "join",
1112
"channel": {
1213
"type": "app"

0 commit comments

Comments
 (0)