Skip to content

Commit 3dc80ef

Browse files
authored
Merge pull request #12 from totalvoice/VIS-2014/atualizar-novo-endereco-lib-python
Alterado novo endereço e adicionado User-Agent
2 parents 15be0e0 + 91b1c0e commit 3dc80ef

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $ pip install totalvoice
1212
## Como utilizar (how to)
1313

1414
Segue abaixo a forma de utilização dos métodos da API da totalvoice!
15-
15+
###### Lembrete: A partir a versão `1.7.0` não é possível informar o `HOST` ao instanciar o Cliente.
1616
### Chamadas
1717
Módulo responsável por criação de chamadas, relatórios de chamadas, url da gravação, etc.
1818

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# 15.10 Date based release
3838
# 23 Serial release
3939

40-
version='1.6.0',
40+
version='1.7.0',
4141

4242
description='Biblioteca da Totalvoice em python',
4343
long_description=long_description,

totalvoice/cliente/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
class Cliente(object):
66

7-
def __init__(self, access_token, host):
7+
def __init__(self, access_token, host = None):
88
self.access_token = access_token
9-
self.host = utils.build_host(host)
9+
self.host = utils.build_host()
1010
self._api = None
1111

1212
@property

totalvoice/cliente/api/helper/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ def build_header(access_token):
66
header.update({'Content-Type' :'application/json' })
77
header.update({'Accept' :'application/json' })
88
header.update({'Access-Token' : access_token })
9+
header.update({'User-Agent': 'lib-python/1.7.0' })
910
return header
1011

11-
def build_host(host):
12-
if "http" not in host:
13-
return "https://"+host
14-
return host
12+
def build_host():
13+
return 'https://voice-api.zenvia.com'

0 commit comments

Comments
 (0)