diff --git a/bynder_sdk/client/asset_bank_client.py b/bynder_sdk/client/asset_bank_client.py index 1bb2deb..853ce3b 100644 --- a/bynder_sdk/client/asset_bank_client.py +++ b/bynder_sdk/client/asset_bank_client.py @@ -103,13 +103,25 @@ def delete_usage(self, integration_id, asset_id, query: dict = None): params=query ) - def upload_file(self, file_path, brand_id, media_id: str = '', query: dict = None): + def upload_file(self, file_path: str, brand_id: str, + media_id: str = '', query: dict = None) -> dict: """ Upload file. + Params: + file_path: the local filepath of the file to upload. + brand_id: the brandid of the brand that belong the asset. + query: extra dict parameters of information to add to the + asset. (See api documentation for more information) + Return a dict with the keys: + - success: boolean that indicate the result of the upload call. + - mediaitems: a list of mediaitems created, with at least the + original. + - batchId: the batchId of the upload. + - mediaid: the mediaId update or created. """ if query is None: query = {} query['brandId'] = brand_id - self.upload_client.upload( + return self.upload_client.upload( file_path=file_path, media_id=media_id, upload_data=query diff --git a/bynder_sdk/client/upload_client.py b/bynder_sdk/client/upload_client.py index 3755938..4630194 100644 --- a/bynder_sdk/client/upload_client.py +++ b/bynder_sdk/client/upload_client.py @@ -126,7 +126,7 @@ def _save_media(self, import_id, data, media_id=None): save_endpoint = '/api/v4/media/{}/save/{}/'.format(media_id, import_id) data = {} - save_success = self.bynder_request_handler.post( + return self.bynder_request_handler.post( endpoint=save_endpoint, payload=data )