Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Required if your environment does not handle autoloading
- require __DIR__ . '/vendor/autoload.php';
- // Use the REST API Client to make requests to the Twilio REST API
- use TwilioRestClient;
- $id = $_GET['id'];
- // Substitute your Twilio AccountSid and ApiKey details
- $accountSid = 'xxx';
- $apiKeySid = 'xxx';
- $apiKeySecret = 'xxx';
- // Create an Access Token
- $token = new Services_Twilio_AccessToken(
- $accountSid,
- $apiKeySid,
- $apiKeySecret,
- $ttl=3600,
- $identity='user'.$id
- );
- // Grant access to Conversations
- $grant = new Services_Twilio_Auth_ConversationsGrant();
- $grant->setConfigurationProfileSid('configurationProfileSid');
- $token->addGrant($grant);
- // Serialize the token as a JWT
- echo $token->toJWT();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement