Add get and update service inbound api

This commit is contained in:
Ken Tsang
2017-06-20 13:06:46 +01:00
parent 5b54dd53a2
commit d9286b036f

View File

@@ -266,13 +266,21 @@ class ServiceAPIClient(NotifyAdminAPIClient):
'/service/{}/inbound-sms/summary'.format(service_id)
)
def update_service_inbound_api(self, service_id, url, bearer_token, user_id):
def update_service_inbound_api(self, service_id, url, bearer_token, user_id, inbound_api_id):
data = {
"url":url,
"url": url,
"bearer_token": bearer_token,
"updated_by_id": user_id
}
return self.post("/service/{}/inbound-api".format(service_id), data)
update_inbound_api_path = '/{}'.format(inbound_api_id) if inbound_api_id else ''
return self.post("/service/{}/inbound-api{}".format(service_id, update_inbound_api_path), data)
def get_service_inbound_api(self, service_id, inbound_sms_api_id):
return self.get(
"/service/{}/inbound-api/{}".format(
service_id, inbound_sms_api_id
)
)['data']
class ServicesBrowsableItem(BrowsableItem):