Hi All, SAS version: SAS Viya LTS 2023.9 I am trying to make an API call to upload a file and create a table. I am using this link as a reference: https://developer.sas.com/rest-apis/dataTables/createTableFromMultipart. I am doing this through Postman for testing purposes, here is code in Python: import requests
url = "https://*****.com.au/dataTables/dataSources/Compute~fs~be7240bc-96e9-4eff-b3f9-ba9e23d7d3b2~fs~WORK/tables"
payload = {'tableRequest': '{
"sourceArguments": {
"delimiter": ",",
"firstRowHasColumnNames": true
},
"targetArguments": {
"tableName": "IMPORT_TEST_NONADMITTED_TEST",
"replace": true,
"columnDefinitions": [
{ "name": "RecordID", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "T2Clinicv7", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "fundingsource", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "STATE", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "indstat", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "bir_date", "type": "date", "informat": "DDMMYY8.", "format": "DDMMYY8." },
{ "name": "service_date", "type": "date", "informat": "DDMMYY8.", "format": "DDMMYY8." },
{ "name": "Postcode", "type": "character", "length": 6 },
{ "name": "SA2", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "pat_multiprov_flag", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "est_eligible_paed_flag", "type": "numeric", "informat": "BEST32.", "format": "BEST12." },
{ "name": "estabid", "type": "character", "length": 9 }
]
}
}'}
files=[
('file',('test_data_non_admitted.csv',open('/C:/****/test_data_non_admitted.csv','rb'),'text/csv'))
]
headers = {
'Content-Item-Type': 'application/vnd.sas.data.table.cas.delimited.request+json',
'Content-Type': 'multipart/form-data',
'Authorization': '***********',
'Cookie': '***********'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text) Thi is the response I am receiving: {
"httpStatusCode": 503,
"errorCode": 11916,
"message": "The provider for the source \"Compute~fs~be7240bc-96e9-4eff-b3f9-ba9e23d7d3b2~fs~WORK\" is not available, or it is currently starting up.",
"details": [
"path: /dataTables/dataSources/Compute~fs~be7240bc-96e9-4eff-b3f9-ba9e23d7d3b2~fs~WORK/tables",
"correlator: 65510512-b779-484e-8c1a-eef71fa7bac9"
]
} Any ideas of how to make this work will be appreciated. Thanks! Pablo
... View more