Skip to content

Commit 1c889fd

Browse files
authored
Merge pull request TwilioDevEd#27 from teoreteetik/master
Create Sync Default Service if necessary
2 parents 6d4e450 + 6da3ea3 commit 1c889fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webroot/config-check.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
if (empty($syncServiceSID)) {
1212
$syncServiceSID = 'default';
1313
}
14+
// Ensure that the Sync Default Service is provisioned
15+
if ($syncServiceSID === 'default') {
16+
$client = new Twilio\Rest\Client(getenv('TWILIO_API_KEY'), getenv('TWILIO_API_SECRET'), getenv('TWILIO_ACCOUNT_SID'));
17+
$client->sync->v1->services($syncServiceSID)->fetch();
18+
}
1419

1520
echo json_encode(array(
1621
'TWILIO_ACCOUNT_SID' => getenv('TWILIO_ACCOUNT_SID'),

0 commit comments

Comments
 (0)