-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadd.sh
executable file
·28 lines (22 loc) · 876 Bytes
/
add.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
read -p "email: " email
echo 'password:'
read -s password
curl -s -XPOST "https://prod-nginz-https.wire.com/login" \
-H 'Content-Type: application/json' \
-d '{"email":"'${email}'"
,"password":"'${password}'"}' \
| jq -r ".access_token" > .token
token=$(cat .token)
curl -s -XPOST "https://prod-nginz-https.wire.com/conversations" \
-H 'Content-Type: application/json' \
-H 'Authorization:Bearer '${token}'' \
-d '{"users": [], "name":"Texas Hold''em"}' \
| jq -r '.id' > .conv
service='4a9837f9-b604-4ba4-a3a0-5eef53e7e528'
provider='d39b462f-7e60-4d88-82e1-44d632f94901'
conv=$(cat .conv)
curl -i -XPOST 'https://prod-nginz-https.wire.com/conversations/'${conv}'/bots' \
-H 'Content-Type: application/json' \
-H 'Authorization:Bearer '${token}'' \
-d '{"service": "'${service}'", "provider": "'${provider}'"}'