bandwidth / python-bandwidth Goto Github PK
View Code? Open in Web Editor NEWPublic API for interfacing with Bandwidth from Python
Home Page: http://Bandwidth.com
License: MIT License
Public API for interfacing with Bandwidth from Python
Home Page: http://Bandwidth.com
License: MIT License
PyPI says 4.0 & 4.0.1 are out. Will those releases be published here?
I'm behind a corporate firewall and need to use a proxy for some requests. Since you seem to be using requests behind the scenes, could you add another optional parameter for proxy conf?
https://dev.bandwidth.com/v2-messaging/messaging2Migration.html
The ones I could find are:
Add applicationId
in its payload for v2.
Currently it looks like https://github.com/Bandwidth/python-bandwidth/blob/master/bandwidth/messaging/client_module.py#L197.
Also drop other unwanted params based on version.
message_id
extraction logic.v1
has themessage_id
in this Location
header where it is being extracted from currently as seen here https://github.com/Bandwidth/python-bandwidth/blob/master/bandwidth/messaging/client_module.py#L87
v2
just returns a JSON like below where we will have to extract it from.
{
"id" : "14762070468292kw2fuqty55yp2b2",
"time" : "2016-09-14T18:20:16Z",
"to" : [
"+12345678902",
"+12345678903"
],
"from" : "+12345678901",
"text" : "Hey, check this out!",
"applicationId" : "93de2206-9669-4e07-948d-329f4b722ee2",
"tag" : "test message",
"owner" : "+12345678901",
"direction" : "out",
"segmentCount" : 1
}
Right now we get the response.json()
and fetch the message
as well as code
keys from it as seen here https://github.com/Bandwidth/python-bandwidth/blob/master/bandwidth/messaging/client_module.py#L72
But v2
seems to send back an "array of objects" and the name of the keys also seem to be different. Based on what I was able to gather, looks like we have replace that logic with response.json()[0]
, data['description']
and code=data.get('type'))
.
Are there plans to make an exhaustive list and work on updating the repo to support v2
? Would be happy to help.
ignore
In order to combine an audio request to the Gather, please use the prompt
value of the gather request
This would look something like:
prompt = voice_api.build_sentence(sentence = "Hello from Bandwidth, please press some digits")
gather_id = voice_api.create_call_gather(call_id, prompt = prompt);
Where the voice_api.build_sentence
let's you construct the prompt. If you're using audio playback, there is a similar method build_audio_playback
that would be used for the prompt instead.
See the transfer docs for how an example could look.
It could also be worth adding the prompt
value directly in the param list instead of relying on **kwargs
, no real opinion here.
Thank you for your good work.
I found issue that download media files.
this is the sample media file name to download from bandwidth.
'...Home%281%29-m-m4dh5ymogubeh7i37gsgycq.jpg'
By the way, quote() function change the name such as following
'...Home%25281%2529-m-m4dh5ymogubeh7i37gsgycq.jpg'
and response is as following.
The media resource named '...Home%281%29-m-m4dh5ymogubeh7i37gsgycq.jpg' could not be found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.