Sample code for 30+ languages & platforms
Visual FoxPro

Aruba Fatturazione Elettronica GetTransmissionInfoRequest

See more Aruba Fatturazione Examples

Query the status of a request.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL loJson
LOCAL loResp
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode

lnSuccess = 0

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

loHttp = CreateObject('Chilkat.Http')

* 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('Chilkat.JsonObject')
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('Chilkat.HttpResponse')
lnSuccess = loHttp.HttpJson("POST","https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest",loJson,"application/json",loResp)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loJson
    RELEASE loResp
    CANCEL
ENDIF

loSbResponseBody = CreateObject('Chilkat.StringBuilder')
loResp.GetBodySb(loSbResponseBody)

loJResp = CreateObject('Chilkat.JsonObject')
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = 0

? "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