upload_file_s3_2.py 894 B

1234567891011121314151617181920212223242526
  1. def upload_api_call_exec(file_id,file_name,user_id,extension):
  2. """ This function calls the Rest API to upload the file_id and other attributes to DynamoDB
  3. Parameters
  4. file_id : string
  5. The file_id which need to be created in DynamoDB.
  6. file_name : string
  7. The file_name corresponding to the file_id
  8. user_id : string
  9. The user_id corresponding to the file_id
  10. extension : string
  11. The extension of the file
  12. """
  13. try:
  14. apiService_obj = ApiService()
  15. content_api_call = apiService_obj.content_to_api_call(file_id, file_name, user_id, extension)
  16. print("The content api-call is",content_api_call)
  17. response_post_api_call = apiService_obj.post_api_call(content_api_call,cf.constants['post_back_url'])
  18. print("Reached here 4")
  19. print("The response_post_api call is",response_post_api_call)
  20. return response_post_api_call
  21. except:
  22. print("Failure in calling API")
  23. return "failure"