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=="
}'
Dim rest As New Chilkat.Rest
Dim success As Boolean
// URL: https://testws.fatturazioneelettronica.aruba.it/services/ClientRequest/CreateTransmissionRequest?username=Utente&password=Password
Dim bTls As Boolean
bTls = True
Dim port As Int32
port = 443
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("testws.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect)
If (success <> True) Then
System.DebugLog("ConnectFailReason: " + Str(rest.ConnectFailReason))
System.DebugLog(rest.LastErrorText)
Return
End If
// See the Online Tool for Generating JSON Creation Code
Dim json As New Chilkat.JsonObject
success = json.UpdateString("userName","Utente")
success = json.UpdateString("password","Password")
success = json.UpdateString("userID","Utente")
success = json.UpdateString("comunicationType","LI")
success = json.UpdateString("dataFile","dGVzdA==")
success = rest.AddHeader("Content-Type","application/json;charset=UTF-8")
success = rest.AddHeader("Accept","application/json")
Dim sbRequestBody As New Chilkat.StringBuilder
success = json.EmitSb(sbRequestBody)
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestSb("POST","/services/ClientRequest/CreateTransmissionRequest?username=Utente&password=Password",sbRequestBody,sbResponseBody)
If (success <> True) Then
System.DebugLog(rest.LastErrorText)
Return
End If
Dim respStatusCode As Int32
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
System.DebugLog("Response Status Code = " + Str(respStatusCode))
System.DebugLog("Response Header:")
System.DebugLog(rest.ResponseHeader)
System.DebugLog("Response Body:")
System.DebugLog(sbResponseBody.GetAsString())
Return
End If
Dim jsonResponse As New Chilkat.JsonObject
success = jsonResponse.LoadSb(sbResponseBody)
// See the Online Tool for Generating JSON Parse Code
Dim errorCode As String
Dim errorDescription As String
Dim requestID As String
errorCode = jsonResponse.StringOf("errorCode")
errorDescription = jsonResponse.StringOf("errorDescription")
requestID = jsonResponse.StringOf("requestID")
{
"errorCode": "",
"errorDescription": "",
"requestID": "XADI41PJUFSD3ZA7"
}