Java / WAC API / Read Control Account
        
        Back to Collection Items
        import com.chilkatsoft.*;
public class ChilkatExample {
  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }
  public static void main(String argv[])
  {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.
    CkHttp http = new CkHttp();
    boolean success;
    http.SetRequestHeader("Authorization","{{WACApiKey}}");
    CkStringBuilder sbResponseBody = new CkStringBuilder();
    success = http.QuickGetSb("https://domain.com/v1/control-account",sbResponseBody);
    if (success == false) {
        System.out.println(http.lastErrorText());
        return;
        }
    System.out.println("Response status code = " + http.get_LastStatus());
    System.out.println(sbResponseBody.getAsString());
  }
}
        Curl Command
        curl -X GET
	ERROR: non-default apikey header name not found
	-H "Authorization: {{WACApiKey}}"
https://domain.com/v1/control-account
            ERROR detected in Curl command.
        Postman Collection Item JSON
        {
  "name": "Read Control Account",
  "protocolProfileBehavior": {
    "disableBodyPruning": true
  },
  "request": {
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "key": "value",
          "value": "",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "{{WACApiKey}}",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": ""
    },
    "url": {
      "raw": "{{baseURL}}/v1/control-account",
      "host": [
        "{{baseURL}}"
      ],
      "path": [
        "v1",
        "control-account"
      ]
    }
  },
  "response": [
  ]
}