Skip to content

Commit f8ba833

Browse files
authored
Merge pull request #26 from Nexmo/reporting-building-blocks
Add reporting building blocks
2 parents dfbc7aa + 04a753d commit f8ba833

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

config.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ WEBHOOK_URL=${WEBHOOK_URL:-""}
4040
US_SHORT_CODE=${US_SHORT_CODE:-""}
4141
IMG_URL=${IMG_URL:-""}
4242

43+
# Reporting
44+
REPORT_PRODUCT=${REPORT_PRODUCT:-""}
45+
REPORT_ID=${REPORT_ID:-""}
46+
REPORT=${REPORT_URL:-""}
47+
4348
# If we have a local config, override using that
4449
CONFIG_DIR=$(dirname "${BASH_SOURCE[0]}")
4550
if [ -f "$CONFIG_DIR/config.local.sh" ]; then

reporting/check-report-status.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
source "../config.sh"
4+
5+
curl "https://api.nexmo.com/v1/reports/$REPORT_ID?api_key=$NEXMO_API_KEY&api_secret=$NEXMO_API_SECRET"

reporting/create-report.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
source "../config.sh"
4+
5+
curl -X "POST" "https://api.nexmo.com/v1/reports?api_key=$NEXMO_API_KEY&api_secret=$NEXMO_API_SECRET" \
6+
-H "Content-Type: application/json"\
7+
-d '{"product": "'$REPORT_PRODUCT'"}'

reporting/download-report.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
source "../config.sh"
4+
5+
curl -o ./report.zip "$REPORT_URL?api_key=$NEXMO_API_KEY&api_secret=$NEXMO_API_SECRET"

0 commit comments

Comments
 (0)