Hey All,
I am trying to replace xlsforms automatically via following python code but it prints the response code 500 can you guys tell me what’s wrong with my code.
import requests
def upload_to_kobo(xlsform,form_number):
files = {
'xls_file': (xlsform, open(xlsform, 'rb')),
}
d = r'https://kc.humanitarianresponse.info/api/v1/forms/' + form_number
response = requests.patch(d, files=files, auth=('ihsan_afghanistan', '***'))
print(response)
upload_to_kobo(r’\agysKtkeMyW8FTForzQP9T.xlsx’, ‘420554’)