import requests# The URL for the upload endpointurl ='http://api.knowbase.ai/api/v1/upload'# Replace 'your_access_token_here' with the actual access token you received from the APIheaders ={'access-token':'your_access_token_here'}# Replace 'path_to_your_file' with the actual file path on your systemfiles ={'file': ('filename.pdf',open('path_to_your_file', 'rb'),'application/pdf')}# Make the POST request to upload the fileresponse = requests.post(url, headers=headers, files=files)# Check the responseif response.status_code ==200:print("File uploaded successfully.")print(response.json())# This will print the response which includes the 'file_id'else:print("Failed to upload file.")print(response.json())# This will print the error message# Don't forget to close the file if you're not using a context managerfiles['file'][1].close()