def uploadImage(path): with open(path, "rb") as image_file: encoded_string = base64.b64encode(image_file.read()) data = {"file": str(encoded_string)[2:-1], "type": "MMS"} headers = get_headers(base.apiKey, base.apiSecret) return requests.post(base.getUrl("/storage/v1/files"), headers=headers, json=data)
def sendMany(data): return requests.post( base.getUrl("/messages/v4/send-many"), headers=get_headers(base.apiKey, base.apiSecret), json=data, )
def delete(path): return requests.delete(base.getUrl(path), headers=get_headers(base.apiKey, base.apiSecret))
def get(path, headers={}): headers.update(get_headers(base.apiKey, base.apiSecret)) return requests.get(base.getUrl(path), headers=headers)
def put(path, data, headers={}): headers.update(get_headers(base.apiKey, base.apiSecret)) return requests.put(base.getUrl(path), headers=headers, json=data)
def post(path, data): return requests.post( base.getUrl(path), headers=get_headers(base.apiKey, base.apiSecret), json=data, )