Android™ Fatturazione Elettronica Aruba IT: Get Transmission Info Request

Back to Index

Servizio per l’interrogazione dello stato di una richiesta

Documentation: https://fatturazioneelettronica.aruba.it/apidoc/docs.html#_gettransmissioninforequest

CURL Command

curl -X POST  https://demows.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest?username=Utente&password=Password \
-H 'Accept: application/json' \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
  "userName" : "Utente",
  "password" : "Password",
  "requestID" : "Z68Q7T4KZ3"
}'

Android™ Example

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    CkRest rest = new CkRest();
    boolean success;

    //  URL: https://demows.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest?username=Utente&password=Password
    boolean bTls = true;
    int port = 443;
    boolean bAutoReconnect = true;
    success = rest.Connect("demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect);
    if (success != true) {
        Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    //  See the Online Tool for Generating JSON Creation Code
    CkJsonObject json = new CkJsonObject();
    json.UpdateString("userName","Utente");
    json.UpdateString("password","Password");
    json.UpdateString("requestID","Z68Q7T4KZ3");

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

    CkStringBuilder sbRequestBody = new CkStringBuilder();
    json.EmitSb(sbRequestBody);
    CkStringBuilder sbResponseBody = new CkStringBuilder();
    success = rest.FullRequestSb("POST","/services/ClientRequest/GetTransmissionInfoRequest?username=Utente&password=Password",sbRequestBody,sbResponseBody);
    if (success != true) {
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    int respStatusCode = rest.get_ResponseStatusCode();
    if (respStatusCode >= 400) {
        Log.i(TAG, "Response Status Code = " + String.valueOf(respStatusCode));
        Log.i(TAG, "Response Header:");
        Log.i(TAG, rest.responseHeader());
        Log.i(TAG, "Response Body:");
        Log.i(TAG, sbResponseBody.getAsString());
        return;
        }

    CkJsonObject jsonResponse = new CkJsonObject();
    jsonResponse.LoadSb(sbResponseBody);

    //  See the Online Tool for Generating JSON Parse Code
    String result;
    String error;
    String notifyResult;
    String elaboratedResult;
    String receiptTimestamp;
    String fileID;
    String fileName;

    result = jsonResponse.stringOf("result");
    error = jsonResponse.stringOf("error");
    notifyResult = jsonResponse.stringOf("notifyResult");
    elaboratedResult = jsonResponse.stringOf("elaboratedResult");
    receiptTimestamp = jsonResponse.stringOf("receiptTimestamp");
    fileID = jsonResponse.stringOf("fileID");
    fileName = jsonResponse.stringOf("fileName");

  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

Sample JSON Response Body

{
  "result": "SF01",
  "error": "In elaborazione",
  "notifyResult": "",
  "elaboratedResult": "",
  "receiptTimestamp": "2017-04-18 18:30:30",
  "fileID": "0610103456",
  "fileName": "ITAFUMBWJKFGU_LI_0001.xml"
}