I am developing an iOS application with Twilio. We have used TWIML on the server side. I read in one of the threads that Answering machine detection is not possible when using verb. Can i have the server code using twilio rest apis? if yes, please provide some sample code.
The voice url is not called when the call is connected. It calls when the call is ringing.
Whats the best way to solve my problem?
There is now enhanced Answering Machine Detection.
For example, the MachineDetection parameter can be Enable or DetectMessageEnd. Enable returns results as soon as recognition is complete. DetectMessageEnd will wait until after a greeting to return results if an answering machine is detected.
Using new AMD would look like this as seen in the docs:
curl 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXX123456789/Calls.json' -X POST \
--data-urlencode 'To=+1562300000' \
--data-urlencode 'From=+18180000000' \
--data-urlencode 'MachineDetection=Enable' \
--data-urlencode 'Url=https://handler.twilio.com/twiml/EH8ccdbd7f0b8fe34357da8ce87ebe5a16' \
-u ACXXXXXXXXXXXXXXXX123456789:[AuthToken]
Twilio evangelist here.
To configure an outgoing call to use AMD, you add the ifMachine parameter to your API request. Here is some more information about AMD:
https://www.twilio.com/docs/api/rest/making-calls#post-parameters-optional
Hope that helps.
Related
Truly grateful for any help here:
Trying to trigger a Twilio Studio flow from Zapier but with no luck so far.
Here is the Twilio guidance on how to trigger an execution: https://www.twilio.com/docs/studio/rest-api/v2/execution
Here, for example, is how the required data looks as CURL (those phone numbers are not real don't worry):
curl -X POST https://studio.twilio.com/v2/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Executions \
--data-urlencode "To=+15558675310" \
--data-urlencode "From=+15017122661" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
The required data is: To and From as well as the TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN authentication.
I would also like to pass through some data under Parameters as shown in this bit.
So the first step was the auth: Zapier was saying: "The app returned Authentication Error - No credentials provided".
Based on some other info, I have got past this (I think) by putting the Account SID and Auth token in the URL itself like this:
https://TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN#studio.twilio.com/v2/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXX/Executions
(Maybe better/neater to put with the parameters, let me know)
But after the problem is now passing in the To, From and Parameters.
"The app returned Missing required parameter To in the post body".
Here is how my Webhook Zap currently looks
Thanks you for any help!
You need to use Form as Payload Type:
For the basic authentication to work make sure to use a | to separate the username and password:
Good day. I first work with Shinken and similar products in general.So do not judge strictly.
The question is how to get the data through Shinken Livestatus API.
Shinken is installed and running. Livestatus is configured and running on the localhost:50000. Ping is coming.
But I can not understand how to ask something, get some data. The documentation did not shed much light on my question. And whether it is possible through this API to receive metrics which sends CollecD to mod-collectd
After experimenting and studying the source code, I came to this conclusion. In the livestatus module, you can open a port or unixsocket, this is understandable. But here you can refer to it from the commands found in the source code mapping.py in the dictionary livestatus_attribute_map.
The main thing after the request is to put two line breaks !!!
Example thru HTTP:
curl -i -X POST http://host:50000/query -H "Content-Type: text/xml" --data-binary "#/path_to_query/query"
query - this is file, with command.
Example: cat query
----------------------
GET hosts
----------------------
The main thing is not to forget about the transfer line!
I am basically trying to implement a User authentication system that POSTs information to an API/Web Service to cross-reference credentials, therefore rejecting them or allowing them to login.
I am not sure if I understand how this whole system works exactly, but I have been researching a lot on Authentication using Devise and APIs, and do not understand how none of the examples refer to the actual URI of the API at all.
For example, when I first began this process, I made sure to be able to connect to the web service through cURL:
curl -H "Content-Type: application/json" -d '{"RuntimeEnvironment":1,"Email":"someone#example.com","Password":"Pa$$worD"}' -X POST http://blahblah/WebService/AuthenticateLogin
However in every single blog post / tutorial / guide / StackOverflow question I have been on, literally none of them specifically refer to the http://blahblah/WebService/AuthenticateLogin as I did in my cURL request.
Am I searching for the wrong thing?
Or is it actually there and I'm just not understanding?
Also how do tokens factor into this scenario?
The web service I am using does not require/return a token.
I write an app for broadcasting to twitch.tv using C++. For that streaming I need to know the user stream key, usually an user gets that key from the page,
http://www.twitch.tv/user_name/dashboard/streamkey
But I would like get it via my app by using the user name/password.
Any ideas?
You will get it here (change "yourtwitch" by your twitch nickname")
http://www.twitch.tv/yourtwitch/dashboard/streamkey
The link simply moved. You can get this link on the main page of twitch.tv, click on your name then "Dashboard".
This may be an old thread but I came across it and figured that I would give a final answer.
The twitch api is json based and to recieve your stream key you need to authorize your app for use with the api. You do so under the connections tab within your profile on twitch.tv itself.. Down the bottom of said tab there is "register your app" or something similar. Register it and you'll get a client-id header for your get requests.
Now you need to attach your Oauthv2 key to your headers or as a param during the query to the following get request.
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth ' \
-X GET https://api.twitch.tv/kraken/channel
documentataion here
As you can see in the documentation above, if you've done these two things, your stream key will be made available to you.
As I said - Sorry for the bump but some people do find it hard to read the twitch* api.
Hope that helps somebody in the future.
You may obtain the stream key via the API:
https://github.com/justintv/twitch-api
As of January 2018 the url is https://www.twitch.tv/username/dashboard/settings/streamkey
It appears that you can only do this with the REST API but not with the Twiml keyword.
Generally speaking, you don't make outbound interactive calls at all using TwiML. You can certainly use the Dial verb to connect a caller to another party, (http://www.twilio.com/docs/api/twiml/dial), but you aren't interacting with the caller/callee for the duration of that dialed call (i.e., you can't Say, Gather, etc...). The interaction picks up only after the Dial-ed call ends.
In short, initiate the call using the REST API, and then you can continue the interaction using TwiML as desired.
It is done via the REST API.
For example, the MachineDetection parameter can be Enable or DetectMessageEnd. Enable returns results as soon as recognition is complete. DetectMessageEnd will wait until after a greeting to return results if an answering machine is detected.
Using new AMD looks like this:
curl 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXX123456789/Calls.json' -X POST \
--data-urlencode 'To=+1562300000' \
--data-urlencode 'From=+18180000000' \
--data-urlencode 'MachineDetection=Enable' \
--data-urlencode 'Url=https://handler.twilio.com/twiml/EH8ccdbd7f0b8fe34357da8ce87ebe5a16' \
-u ACXXXXXXXXXXXXXXXX123456789:[AuthToken]