|
25 | 25 | 'auth_id auth_token') |
26 | 26 |
|
27 | 27 | PLIVO_API = 'https://api.plivo.com' |
28 | | -PLIVO_API_V1 = '/'.join([PLIVO_API, 'v1']) |
29 | 28 | PLIVO_API_BASE_URI = '/'.join([PLIVO_API, 'v1/Account']) |
30 | 29 |
|
31 | 30 | # Will change these urls before putting this change in production |
@@ -206,10 +205,9 @@ def create_request(self, method, path=None, data=None, **kwargs): |
206 | 205 | if 'is_callinsights_request' in kwargs: |
207 | 206 | url = '/'.join([CALLINSIGHTS_BASE_URL, kwargs['callinsights_request_path']]) |
208 | 207 | req = Request(method, url, **({'params': data} if method == 'GET' else {'json': data})) |
209 | | - elif kwargs.get('plivo_api_v1_base_url', False): |
210 | | - # currently used by lookup API but can be used by other APIs in future |
| 208 | + elif kwargs.get('is_lookup_request', False): |
211 | 209 | path = path or [] |
212 | | - url = '/'.join([PLIVO_API_V1] + list([str(p) for p in path])) |
| 210 | + url = '/'.join(list([str(p) for p in path])) |
213 | 211 | req = Request(method, url, **({'params': data} if method == 'GET' else {'json': data})) |
214 | 212 | else: |
215 | 213 | path = path or [] |
@@ -295,9 +293,9 @@ def request(self, |
295 | 293 | kwargs["is_voice_request"] = True |
296 | 294 | return self.request(method, path, data, **kwargs) |
297 | 295 | return self.process_response(method, response, response_type, objects_type) |
298 | | - elif kwargs.get('plivo_api_v1_base_url', False): |
299 | | - req = self.create_request(method, path, data, plivo_api_v1_base_url=True) |
300 | | - del kwargs['plivo_api_v1_base_url'] |
| 296 | + elif kwargs.get('is_lookup_request', False): |
| 297 | + req = self.create_request(method, path, data, is_lookup_request=True) |
| 298 | + del kwargs['is_lookup_request'] |
301 | 299 | else: |
302 | 300 | req = self.create_request(method, path, data) |
303 | 301 | session = self.session |
|
0 commit comments