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.
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.
https://dev.bandwidth.com/v2-messaging/messaging2Migration.html
The ones I could find are:
Add
applicationIdin 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_idextraction logic.v1has themessage_idin thisLocationheader where it is being extracted from currently as seen here https://github.com/Bandwidth/python-bandwidth/blob/master/bandwidth/messaging/client_module.py#L87v2just returns a JSON like below where we will have to extract it from.Right now we get the
response.json()and fetch themessageas well ascodekeys from it as seen here https://github.com/Bandwidth/python-bandwidth/blob/master/bandwidth/messaging/client_module.py#L72But
v2seems 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 withresponse.json()[0],data['description']andcode=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.