curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/red-responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/red-responses"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/red-responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Import a TGSS answer
Imports a file downloaded from SILTRA into its approved month: a Fichero de Respuesta or the month’s Fichero de Cálculos.
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/red-responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/red-responses"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.melso.ai/v1/companies/{company_id}/payroll-runs/{run_id}/red-responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Authorizations
A company API key, mk_live_…, that the company's owner creates in the
Melso app under Settings, Connect your AI, API keys. It works in that
one company with the owner's authority. Test keys (mk_test_…) are not
issued. Keep the key on your servers. See
Authentication.
Headers
A unique key of yours, such as a UUID, that makes a retried create
safe. For 24 hours a retry with the same key and body gets the first
answer again, with Idempotent-Replayed: true. The same key with
another body answers 422 idempotency_key_reused; while the first
request runs, 409 idempotency_key_in_use. A 5xx answer is not
kept, so its retry runs again. See Conventions.
255