Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Update docs (#85)
Browse files Browse the repository at this point in the history
Co-authored-by: Working Group Two Maintainers <[email protected]>
  • Loading branch information
norrs and Working Group Two Maintainers authored Jun 4, 2024
1 parent fc86cd4 commit b8b1cb0
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 23 deletions.
4 changes: 2 additions & 2 deletions docs/intro-get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ $ grpcui -protoset wgtwo.bin sandbox.api.wgtwo.com:443

## Production environment

Our production environment is hosted at `api.wgtwo.com`.
Our production environment is hosted at `api.{region}.wgtwo.com`, where all our regions are listed in the [overview of environments](https://v1.docs.wgtwo.com/reference/environments/).

This part of the guide will show you how to create a OAuth 2.0 token and use that to connected to our event stream.

Expand Down Expand Up @@ -125,7 +125,7 @@ the stream will be silent until someone has given consent and sent an SMS.
grpcurl -H "Authorization: Bearer ${ACCESS_TOKEN}" \
-protoset wgtwo.bin \
-d '{ "type": ["SMS_EVENT"] }' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.events.v0.EventsService.Subscribe
```

Expand Down
2 changes: 1 addition & 1 deletion docs/metrics-how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See: [Get client access token](https://docs.wgtwo.com/guide/oauth2/get-client-ac
## Get metrics, curl

```shell script
curl -s --oauth2-bearer $ACCESS_TOKEN https://api.wgtwo.com/metrics/v1
curl -s --oauth2-bearer $ACCESS_TOKEN https://sandbox.api.wgtwo.com/metrics/v1
```

## Get metrics, Prometheus
Expand Down
2 changes: 1 addition & 1 deletion docs/number-lookup-how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ NumberLookupResponse {

### Keep-Alive

The load balancer hosting api.wgtwo.com will silently drop connections if they have been idle for 350 seconds (5m 50s).
The API Gateway hosting api.{region}.wgtwo.com (see [environments](https://v1.docs.wgtwo.com/reference/environments/) for list of regions) will silently drop connections if they have been idle for 350 seconds (5m 50s).

To avoid this, the provider should send a keep-alive message every minute.

Expand Down
2 changes: 1 addition & 1 deletion docs/subscriber-location-how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ roles:
# Get subscriber network information

These APIs allow you to get network information regarding a subscription.
In order to access this API your credentials need to have the `subscription.network:read` rights.
In order to access this API your credentials need to have the `subscription.network_information:read` rights.

## `GetNetworkInfoForSubscriber`

Expand Down
2 changes: 1 addition & 1 deletion examples/config/operator/metrics/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ scrape_configs:

static_configs:
- targets:
- "api.wgtwo.com:443" # Dublin
- "api.shamrock.wgtwo.com:443" # Dublin
- "api.sakura.wgtwo.com:443" # Tokyo
- "api.oak.wgtwo.com:443" # Oregon
3 changes: 2 additions & 1 deletion examples/curl/operator/provision/disable-roaming-data.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Access token must be obtained via the client credentials flow
curl -s \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
Expand All @@ -11,4 +12,4 @@ curl -s \
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
https://sandbox.api.wgtwo.com/provision/v2/update
3 changes: 2 additions & 1 deletion examples/curl/operator/provision/enable-roaming-data.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Access token must be obtained via the client credentials flow
curl -s \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
Expand All @@ -13,4 +14,4 @@ curl -s \
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
https://sandbox.api.wgtwo.com/provision/v2/update
3 changes: 2 additions & 1 deletion examples/curl/operator/provision/get-subscription-info.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# Access token must be obtained via the client credentials flow
curl -s \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
https://api.wgtwo.com/subscription/v2/msisdn/46737678218
https://sandbox.api.wgtwo.com/subscription/v2/msisdn/46737678218
2 changes: 1 addition & 1 deletion examples/go/events/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
}

conn, err := grpc.Dial(
"api.wgtwo.com:443",
"sandbox.api.wgtwo.com:443",
grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")),
grpc.WithPerRPCCredentials(
oauth.TokenSource{
Expand Down
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/events/get-events.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Access token must be obtained via the client credentials flow
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
Expand All @@ -8,5 +9,5 @@ grpcurl \
"type": ["VOICE_EVENT"]
}
' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.events.v0.EventsService.Subscribe
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/forwarding/conditional_to_number.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
-import-path . \
Expand All @@ -9,5 +10,5 @@ grpcurl \
"unavailable": { "e164": "+4672xxxxxxx"}
}
}' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.callforward.v0.CallForwardingService/SetToNumber
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/forwarding/conditional_to_voicemail.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
-import-path . \
Expand All @@ -10,5 +11,5 @@ grpcurl \
"no_reply": { "e164": "+4672xxxxxxx"}
}
}' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.callforward.v0.CallForwardingService/SetToVoicemail
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/forwarding/disable.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
-import-path . \
-proto wgtwo/callforward/v0/callforward.proto \
-d '{
"subscriber": { "e164": "+4672xxxxxxx"}
}' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.callforward.v0.CallForwardingService/Disable
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/forwarding/unconditional_to_number.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
-import-path . \
Expand All @@ -8,5 +9,5 @@ grpcurl \
"forward_to_number": { "e164": "+4672xxxxxxx"}
}
}' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.callforward.v0.CallForwardingService/SetToNumber
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/forwarding/unconditional_to_trunk.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
-import-path . \
Expand All @@ -8,5 +9,5 @@ grpcurl \
"forward_to_trunk": { "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
}
}' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.callforward.v0.CallForwardingService/SetToTrunk
4 changes: 2 additions & 2 deletions examples/grpcurl/thirdpartydev/number-lookup/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ curl -sL 'https://github.com/working-group-two/wgtwoapis/blob/master/image.bin?r

# Access token must be obtained via the client credentials flow
ACCESS_TOKEN=$(
curl -s -u $CLIENT_ID:$CLIENT_SECRET \
curl -s -u "${CLIENT_ID}:${CLIENT_SECRET}" \
--request POST \
--url 'https://id.wgtwo.com/oauth2/token' \
--header 'content-type: application/x-www-form-urlencoded' \
Expand All @@ -31,7 +31,7 @@ grpcurl \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-protoset wgtwo.bin \
-d @ \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.lookup.v0.NumberLookupService/NumberLookup <&3 \
| while IFS= read -r LINE; do
# grpcurl sends output line by line, so we buffer until we have a valid JSON object.
Expand Down
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/sipbreakout/register.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Access token must be obtained via the client credentials flow
grpcurl -protoset wgtwo.bin \
-d '
Expand All @@ -10,4 +11,4 @@ grpcurl -protoset wgtwo.bin \
}
}
' \
api.wgtwo.com:443 wgtwo.sipbreakout.v0.SipBreakoutService/UpsertRegistration
sandbox.api.wgtwo.com:443 wgtwo.sipbreakout.v0.SipBreakoutService/UpsertRegistration
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/sms/send-text-sms.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
-import-path . \
Expand All @@ -7,5 +8,5 @@ grpcurl \
"from_subscriber": { "e164": "+47xxxxxxxx" },
"to_e164": { "e164": "+47xxxxxxxx" }
}' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.sms.v0.SmsService/SendTextFromSubscriber
3 changes: 2 additions & 1 deletion examples/grpcurl/thirdpartydev/webterminal/initiatecall.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Access token must be obtained via the client credentials flow
grpcurl \
-H "Authorization: Bearer ${ACCESS_TOKEN}"\
Expand All @@ -14,5 +15,5 @@ grpcurl \
}
}
' \
api.wgtwo.com:443 \
sandbox.api.wgtwo.com:443 \
wgtwo.webterminal.v0.WebTerminalService/Pipe
2 changes: 1 addition & 1 deletion src/assets/images/number-lookup-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/images/number-lookup.mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sequenceDiagram
```mermaid
flowchart LR
subgraph wg2
C(api.wgtwo.com)
C(api.shamrock.wgtwo.com)
end
subgraph Provider
A(Client)
Expand Down

0 comments on commit b8b1cb0

Please sign in to comment.