twilio / twilio-ruby

A Ruby gem for communicating with the Twilio API and generating TwiML
MIT License
1.35k stars 462 forks source link

Ruby 3.2.2 with twilio 6.3.1 @client has no tokens method! #670

Closed paradisaeidae closed 1 year ago

paradisaeidae commented 1 year ago

Issue Summary

https://www.twilio.com/docs/stun-turn/api The Ruby api endpoint as described: token = @client.tokens.create(ttl: 3600) 'tokens' is no longer a method.

Steps to Reproduce

  1. Make example as per the stated example.

Code Snippet

require 'rubygems'
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)
token = @client.tokens.create(ttl: 3600)
puts token.username

Exception/Log

eval error: undefined method `tokens' for #<Twilio::REST::Client:0x00007f0c3721dca8 

Technical details:

paradisaeidae commented 1 year ago

So I've found the token here: For instance to gain some ice_servers: icy_one = @client.api.account.tokens.create.ice_servers