Sample code for 30+ languages & platforms
Lianja

Aruba Fatturazione Elettronica GetTransmissionInfoRequest

See more Aruba Fatturazione Examples

Query the status of a request.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loHttp = createobject("CkHttp")

// Implements the following CURL command:

// curl -X POST https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest \
//   -H "Accept: application/json" \
//   -H "Content-Type: application/json;charset=UTF-8" \
//   -d '{
//   "userName" : "ARUBA0000",
//   "password" : "ArubaPwd",
//   "requestID" : "UYZCDNDYKQ"
// }'

// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code

// Use this online tool to generate code from sample JSON:
// Generate Code to Create JSON

// The following JSON is sent in the request body.

// {
//   "userName": "ARUBA0000",
//   "password": "ArubaPwd",
//   "requestID": "UYZCDNDYKQ"
// }

loJson = createobject("CkJsonObject")
loJson.UpdateString("userName","ARUBA0000")
loJson.UpdateString("password","ArubaPwd")
loJson.UpdateString("requestID","UYZCDNDYKQ")

loHttp.SetRequestHeader("Content-Type","application/json;charset=UTF-8")
loHttp.SetRequestHeader("Accept","application/json")

loResp = createobject("CkHttpResponse")
llSuccess = loHttp.HttpJson("POST","https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest",loJson,"application/json",loResp)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loJson
    release loResp
    return
endif

loSbResponseBody = createobject("CkStringBuilder")
loResp.GetBodySb(loSbResponseBody)

loJResp = createobject("CkJsonObject")
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = .F.

? "Response Body:"
? loJResp.Emit()

lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + str(lnRespStatusCode)
if (lnRespStatusCode >= 400) then
    ? "Response Header:"
    ? loResp.Header
    ? "Failed."
else
    ? "Success."
endif



release loHttp
release loJson
release loResp
release loSbResponseBody
release loJResp