local HttpService = game:GetService('HttpService')
local To = 'xxxxxxxxxx'
local Voice = 'The quick brown fox jumps over the lazy dog'
local Url = 'https://api.nexmo.com/v1/calls'
local Data = {
['to'] = {
['type'] = 'phone',
['number'] = To
},
['from'] = {
['type'] = 'phone',
['number'] = To
},
['ncco'] = {
['action'] = 'talk',
['text'] = Voice,
['language'] = 'en-AU',
['style'] = '3',
}
}
local Encoded = HttpService:JSONEncode(Data)
HttpService:PostAsync(Url, Encoded)
I tried to get a notification on my device, this won’t use person’s voice it’s using text to speech.
I have HTTP Requests On.
The HTTP 401 that you’re getting back from the API is your answer, you aren’t authorized to access this, why? Simple, you’re not passing an Authorization header which this API requires. I would assume it’s restricted to anyone with an API key… I recommend consulting the website for the API you’re using.
This is an example I found from the documentation and you can see that an Authorization header is passed in the curl.