Skip to content

Commit 463079a

Browse files
committed
fix: Use ACCOUNT_ID for secrets
1 parent 4490e7f commit 463079a

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

.env-example

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Auth / General
2-
VONAGE_API_KEY=a1b2c3d4
3-
VONAGE_API_SECRET=1234567890abcdef
4-
VONAGE_SIGNATURE_SECRET=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz
5-
VONAGE_APPLICATION_ID=aaaaaaaa-bbbb-4ccc-8ddd-0123456789ab
6-
VONAGE_PRIVATE_KEY_PATH=/path/to/aaaaaaaa-bbbb-4ccc-8ddd-0123456789ab_private.key
2+
VONAGE_API_KEY="a1b2c3d4"
3+
VONAGE_API_SECRET="1234567890abcdef"
4+
VONAGE_SIGNATURE_SECRET="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz"
5+
VONAGE_APPLICATION_ID="aaaaaaaa-bbbb-4ccc-8ddd-0123456789ab"
6+
VONAGE_PRIVATE_KEY_PATH="/path/to/aaaaaaaa-bbbb-4ccc-8ddd-0123456789ab_private.key"
7+
VONAGE_PRIVATE_KEY_CONTENTS="-----BEGIN PRIVATE KEY-----\abc123\n...\n-----END PRIVATE KEY"
78
VONAGE_VIRTUAL_NUMBER=447700900000
89

910
# Account
10-
ACCOUNT_ID=f9e8d7c6
11-
ACCOUNT_SECRET=fedcba9876543210
12-
ACCOUNT_SECRET_ID=abcdef09-8765-4321-8cde-0123456789ab
13-
ACCOUNT_SMS_CALLBACK_URL=https://example.org/webhooks/sms-status
11+
ACCOUNT_ID="f9e8d7c6"
12+
ACCOUNT_SECRET="fedcba9876543210"
13+
ACCOUNT_SECRET_ID="abcdef09-8765-4321-8cde-0123456789ab"
14+
ACCOUNT_SMS_CALLBACK_URL="https://example.org/webhooks/sms-status"
1415

1516
# Application
1617
APPLICATION_NAME="My Test Application"
@@ -140,3 +141,4 @@ VOICE_NCCO_URL="https://nexmo-community.github.io/ncco-examples/talk.json"
140141
VOICE_ANSWER_URL="https://nexmo-community.github.io/ncco-examples/transfer.json"
141142
VOICE_STREAM_URL="https://nexmo-community.github.io/ncco-examples/silent-loop.json"
142143
VOICE_RECORDING_URL="https://api.nexmo.com/v1/files/bbbbbbbb-aaaa-cccc-dddd-0123456789ab.wav"
144+
VOICE_EVENT_URL="https://example.org/webhooks/voice/event"

SNIPPETS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,12 +2276,12 @@ val application = client.application.create {
22762276
## Account
22772277
### Revoke Secret
22782278
```kotlin
2279-
client.account.secrets().delete(ACCOUNT_SECRET_ID)
2279+
client.account.secrets(ACCOUNT_ID).delete(ACCOUNT_SECRET_ID)
22802280
```
22812281

22822282
### Create Secret
22832283
```kotlin
2284-
val secret = client.account.secrets().create(ACCOUNT_SECRET)
2284+
val secret = client.account.secrets(ACCOUNT_ID).create(ACCOUNT_SECRET)
22852285
println("ID: ${secret.id} created on: ${secret.created}")
22862286
```
22872287

@@ -2293,13 +2293,13 @@ println("Balance: €${balance.value}")
22932293

22942294
### Get Secret
22952295
```kotlin
2296-
val secret = client.account.secrets().get(ACCOUNT_SECRET_ID)
2296+
val secret = client.account.secrets(ACCOUNT_ID).get(ACCOUNT_SECRET_ID)
22972297
println("ID: ${secret.id} created on: ${secret.created}")
22982298
```
22992299

23002300
### List Secrets
23012301
```kotlin
2302-
val secrets = client.account.secrets().list()
2302+
val secrets = client.account.secrets(ACCOUNT_ID).list()
23032303
for (secret in secrets) {
23042304
println("ID: ${secret.id} created on: ${secret.created}")
23052305
}

src/main/kotlin/com/vonage/quickstart/kt/account/CreateSecret.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ fun main() {
3030
apiSecret(VONAGE_API_SECRET)
3131
}
3232

33-
val secret = client.account.secrets().create(ACCOUNT_SECRET)
33+
val secret = client.account.secrets(ACCOUNT_ID).create(ACCOUNT_SECRET)
3434
println("ID: ${secret.id} created on: ${secret.created}")
3535
}

src/main/kotlin/com/vonage/quickstart/kt/account/GetSecret.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ fun main() {
3030
apiSecret(VONAGE_API_SECRET)
3131
}
3232

33-
val secret = client.account.secrets().get(ACCOUNT_SECRET_ID)
33+
val secret = client.account.secrets(ACCOUNT_ID).get(ACCOUNT_SECRET_ID)
3434
println("ID: ${secret.id} created on: ${secret.created}")
3535
}

src/main/kotlin/com/vonage/quickstart/kt/account/ListSecrets.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fun main() {
3030
apiSecret(VONAGE_API_SECRET)
3131
}
3232

33-
val secrets = client.account.secrets().list()
33+
val secrets = client.account.secrets(ACCOUNT_ID).list()
3434
for (secret in secrets) {
3535
println("ID: ${secret.id} created on: ${secret.created}")
3636
}

src/main/kotlin/com/vonage/quickstart/kt/account/RevokeSecret.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ fun main() {
3030
apiSecret(VONAGE_API_SECRET)
3131
}
3232

33-
client.account.secrets().delete(ACCOUNT_SECRET_ID)
33+
client.account.secrets(ACCOUNT_ID).delete(ACCOUNT_SECRET_ID)
3434
}

0 commit comments

Comments
 (0)