Creazione di una nuova richiesta per la trasmissione di tipo “Comunicazioni Finanziarie” (invio richiesta file singolo).
curl -X POST https://testws.fatturazioneelettronica.aruba.it/services/ClientRequest/CreateTransmissionRequest?username=Utente&password=Password \
-H 'Accept: application/json' \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"userName" : "Utente",
"password" : "Password",
"userID" : "Utente",
"comunicationType" : "LI",
"dataFile" : "dGVzdA=="
}'
Chilkat.Rest rest = new Chilkat.Rest();
bool success;
// URL: https://testws.fatturazioneelettronica.aruba.it/services/ClientRequest/CreateTransmissionRequest?username=Utente&password=Password
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = await rest.ConnectAsync("testws.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect);
if (success != true) {
Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
Debug.WriteLine(rest.LastErrorText);
return;
}
// See the Online Tool for Generating JSON Creation Code
Chilkat.JsonObject json = new Chilkat.JsonObject();
json.UpdateString("userName","Utente");
json.UpdateString("password","Password");
json.UpdateString("userID","Utente");
json.UpdateString("comunicationType","LI");
json.UpdateString("dataFile","dGVzdA==");
rest.AddHeader("Content-Type","application/json;charset=UTF-8");
rest.AddHeader("Accept","application/json");
Chilkat.StringBuilder sbRequestBody = new Chilkat.StringBuilder();
json.EmitSb(sbRequestBody);
Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
success = await rest.FullRequestSbAsync("POST","/services/ClientRequest/CreateTransmissionRequest?username=Utente&password=Password",sbRequestBody,sbResponseBody);
if (success != true) {
Debug.WriteLine(rest.LastErrorText);
return;
}
int respStatusCode = rest.ResponseStatusCode;
if (respStatusCode >= 400) {
Debug.WriteLine("Response Status Code = " + Convert.ToString(respStatusCode));
Debug.WriteLine("Response Header:");
Debug.WriteLine(rest.ResponseHeader);
Debug.WriteLine("Response Body:");
Debug.WriteLine(sbResponseBody.GetAsString());
return;
}
Chilkat.JsonObject jsonResponse = new Chilkat.JsonObject();
jsonResponse.LoadSb(sbResponseBody);
// See the Online Tool for Generating JSON Parse Code
string errorCode;
string errorDescription;
string requestID;
errorCode = jsonResponse.StringOf("errorCode");
errorDescription = jsonResponse.StringOf("errorDescription");
requestID = jsonResponse.StringOf("requestID");
{
"errorCode": "",
"errorDescription": "",
"requestID": "XADI41PJUFSD3ZA7"
}