Sample code for 30+ languages & platforms
Dart

Aruba Fatturazione Elettronica GetTransmissionInfoRequest

See more Aruba Fatturazione Examples

Query the status of a request.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

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

  final http = 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"
  // }

  final json = CkJsonObject();
  json.updateString('userName', 'ARUBA0000');
  json.updateString('password', 'ArubaPwd');
  json.updateString('requestID', 'UYZCDNDYKQ');

  http.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
  http.setRequestHeader('Accept', 'application/json');

  final resp = CkHttpResponse();
  try {
    http.httpJson('POST', 'https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest', json, 'application/json', resp);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  final sbResponseBody = CkStringBuilder();
  resp.getBodySb(sbResponseBody);

  final jResp = CkJsonObject();
  jResp.loadSb(sbResponseBody);
  jResp.emitCompact = false;

  print('Response Body:');
  print(jResp.emit());

  final respStatusCode = resp.statusCode;
  print('Response Status Code = $respStatusCode');
  if (respStatusCode >= 400) {
    print('Response Header:');
    print(resp.header);
    print('Failed.');
  } else {
    print('Success.');
  }
}