File tree Expand file tree Collapse file tree 8 files changed +55
-53
lines changed Expand file tree Collapse file tree 8 files changed +55
-53
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,27 @@ ACCOUNT_SMS_CALLBACK_URL=${ACCOUNT_SMS_CALLBACK_URL:-"https://example.com/inboun
2424
2525# Messages
2626
27+ # Network APIs
28+ VNA_PHONE_NUMBER=${VNA_PHONE_NUMBER:- " " }
29+ VNA_SCOPE=${VNA_SCOPE:- " " }
30+ VNA_STATE=${VNA_STATE:- " " }
31+ VNA_AUTH_REQ_ID=${VNA_AUTH_REQ_ID:- " " }
32+ VNA_ACCESS_TOKEN=${VNA_ACCESS_TOKEN:- " " }
33+
2734# Number Insight
2835INSIGHT_NUMBER=${INSIGHT_NUMBER:- " " }
2936INSIGHT_CALLBACK_URL=${INSIGHT_CALLBACK_URL:- " " }
3037
3138# Number Verification
39+ NV_AUTH_CODE=${NV_AUTH_CODE:- " " }
40+ NV_REDIRECT_URI=${NV_REDIRECT_URI:- " " }
3241
3342# Numbers
3443
3544# Reports
3645
3746# Sim Swap
47+ SIMSWAP_MAX_AGE=${SIMSWAP_MAX_AGE:- " " }
3848
3949# SMS
4050
@@ -178,13 +188,6 @@ VBC_PASSWORD=${VBC_PASSWORD:-""}
178188ROOM_DISPLAY_NAME={ROOM_DISPLAY_NAME:-" " }
179189EXPIRATION_DATE={EXPIRATION_DATE:-" " }
180190
181- # Network APIs
182- PHONE_NUMBER=${PHONE_NUMBER:- " " }
183- MAX_AGE=${MAX_AGE:- " " }
184- AUTH_REQ_ID=${AUTH_REQ_ID:- " " }
185- AUTH_CODE=${AUTH_CODE:- " " }
186- REDIRECT_URI=${REDIRECT_URI:- " " }
187-
188191# Application API
189192USER_ID=${USER_ID:- " " }
190193USER_NAME=${USER_NAME:- " " }
Original file line number Diff line number Diff line change 22
33source " ../../config.sh"
44source " ../../jwt.sh"
5- source " oidc.sh"
65
7- curl -X POST https://api-eu.vonage.com/oauth2/token \
8- -H ' Authorization: Bearer ' $JWT \
9- -H ' Content-Type: application/x-www-form-urlencoded' \
10- -d ' auth_req_id=' " $AUTH_REQ_ID " ' ' \
11- -d ' grant_type=urn:openid:params:grant-type:ciba'
6+ curl https://api-eu.vonage.com/oauth2/token \
7+ --header " Authorization: Bearer $JWT " \
8+ --header " Content-Type: application/x-www-form-urlencoded" \
9+ --data-urlencode " auth_req_id=$VNA_AUTH_REQ_ID " \
10+ --data-urlencode " grant_type=urn:openid:params:grant-type:ciba"
Original file line number Diff line number Diff line change 33source " ../../config.sh"
44source " ../../jwt.sh"
55
6- curl -X POST https://api-eu.vonage.com/oauth2/token \
7- -H ' Authorization: Bearer ' $JWT \
8- -H ' Content-Type: application/x-www-form-urlencoded' \
9- -d ' code=' $AUTH_CODE \
10- -d ' redirect_uri=' $REDIRECT_URI \
11- -d ' grant_type: authorization_code'
6+ curl https://api-eu.vonage.com/oauth2/token \
7+ --header " Authorization: Bearer $JWT " \
8+ --header " Content-Type: application/x-www-form-urlencoded" \
9+ --data-urlencode " code=$AUTH_CODE " \
10+ --data-urlencode " redirect_uri=$REDIRECT_URI " \
11+ --data-urlencode " grant_type: authorization_code"
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ source " ../../config.sh"
34source " ../../jwt.sh"
45
56curl -X POST https://api-eu.vonage.com/oauth2/bc-authorize \
6- -H ' Authorization: Bearer ' $JWT \
7- -H ' Content-Type: application/x-www-form-urlencoded' \
8- -d ' login_hint=' " $PHONE_NUMBER " ' ' \
9- -d ' scope=' $SCOPE
7+ --header " Authorization: Bearer $JWT " \
8+ --header " Content-Type: application/x-www-form-urlencoded" \
9+ --data-urlencode " login_hint=$VNA_PHONE_NUMBER " \
10+ --data-urlencode " scope=$VNA_SCOPE "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ source " ../../config.sh"
4+ source " ../../jwt.sh"
5+
6+ curl -X POST https://api-eu.vonage.com/v0.1/network-enablement \
7+ --header " Authorization: Bearer $JWT " \
8+ --header " Content-Type: application/json" \
9+ --data $' {
10+ "phone_number": "' $VNA_PHONE_NUMBER ' ",
11+ "scopes": ["' $VNA_SCOPE ' "],
12+ "state" : "' $VNA_STATE ' "
13+ }'
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33source " ../../config.sh"
4- source " ../camara-auth/frontend.sh"
5-
64
75curl -X POST https://api-eu.vonage.com/camara/number-verification/v031/verify \
8- -H ' Authorization: Bearer ' $ACCESS_TOKEN \
9- -H ' Content-Type: application/json' \
10- -H ' Accept: application/json' \
11- -d $' {
12- "phoneNumber": "' $PHONE_NUMBER ' ",
13- "maxAge": "' $MAX_AGE ' "
6+ --header " Authorization: Bearer $VNA_ACCESS_TOKEN " \
7+ --header " Content-Type: application/json" \
8+ --data $' {
9+ "phoneNumber": "' $VNA_PHONE_NUMBER ' "
1410 }'
Original file line number Diff line number Diff line change 22
33source " ../../config.sh"
44
5- SCOPE=' openid dpv:FraudPreventionAndDetection#check-sim-swap'
6- source " ../camara-auth/backend.sh"
7-
8-
95curl -X POST https://api-eu.vonage.com/camara/sim-swap/v040/check \
10- -H ' Authorization: Bearer ' $ACCESS_TOKEN \
11- -H ' Content-Type: application/json' \
12- -H ' Accept: application/json' \
13- -d $' {
14- "phoneNumber": "' $PHONE_NUMBER ' ",
15- "maxAge": "' $MAX_AGE ' "
16- }'
6+ --header " Authorization: Bearer $VNA_ACCESS_TOKEN " \
7+ --header " Content-Type: application/json" \
8+ --data $' {
9+ "phoneNumber": "' $VNA_PHONE_NUMBER ' ",
10+ "maxAge": ' $SIMSWAP_MAX_AGE '
11+ }'
Original file line number Diff line number Diff line change 22
33source " ../../config.sh"
44
5- SCOPE=' openid dpv:FraudPreventionAndDetection#retrieve-sim-swap'
6- source " ../camara-auth/backend.sh"
7-
8-
9- curl -X POST https://api-eu.vonage.com/camara/sim-swap/v040/retrieve \
10- -H ' Authorization: Bearer ' $ACCESS_TOKEN \
11- -H ' Content-Type: application/json' \
12- -H ' Accept: application/json' \
13- -d $' {
14- "phoneNumber": "' $PHONE_NUMBER ' ",
15- }'
5+ curl -X POST https://api-eu.vonage.com/camara/sim-swap/v040/retrieve-date \
6+ --header " Authorization: Bearer $VNA_ACCESS_TOKEN " \
7+ --header " Content-Type: application/json" \
8+ --data $' {
9+ "phoneNumber": "' $VNA_PHONE_NUMBER ' "
10+ }'
You can’t perform that action at this time.
0 commit comments