From Curl to Json

Hello,
I’m tryin to use this curl into https request:

curl --location --request POST ‘https://xxxxxx/documents/arretes’ \

–header ‘Is-Gestionnaire: true’ \

–header ‘Email-Gestionnaire: xxx@test.org’ \

–header ‘X-xxxxxx-Api-Key: 014xxxxxxxxxxxxxxxx4’ \

–form ‘fichier=@“NOM DU FICHIER”’ \

–form 'metadonnees="{

"numen": "00A0009140MCA",

"nature": "conges_et_absences/conge_de_maladie_ordinaire",

"format": "numerique"

}"

Looks convertible so what’s d challenge please ?

I had put the uipath as follwing:


image

the end point is right.

the response:

1 Like

Hey @abdel

You need to pass body in a different format as that is a form encoded input data.

Check this once on how to pass form params through HTTP - Cloud API Access - #12 by Nithinkrishna

Thanks
#nK

it does not work for me, in postmann the Json body is a “metadata” :

form 'metadonnees="{

“numen”: “00A0009140MCA”,

“nature”: “conges_et_absences/conge_de_maladie_ordinaire”,

“format”: “numerique”

}"

i had tested the following body:

it does not work:“message”: “upload pdf response {"entity-type":"exception","status":415,"message":"javax.ws.rs.WebApplicationException"}”,
“level”: “Trace”,
“logType”: “User”,
“timeStamp”: “11:28:15”,
“processVersion”: “1.0.1-alpha.1”,
“jobId”: “f5cff798-edf2-4afc-9b6e-9aa2063b02f7”,
“robotName”: “asaket-attended”,
“machineId”: 11,
“organizationUnitId”: 14
}

You need to pass as it was shown in the sample.

Could you please show me your postman request please ?