1. Home
  2. Docs
  3. API Overview
  4. Documents – Client
  5. Get Client List

Get Client List

Get the client list from TASQ.

URL:

https://jobapi.tasq.com.au/api/Job/GetClientList?Jsonlogin={CompanyValidateInfo}&IsLoadInactive=true

Your get client list api url should look like this:

https://jobapi.tasq.com.au/api/Job/GetClientList?Jsonlogin={“LoginName”:”testapi@tasq.com.au”,”ClientIP”:null,”Password”:”test123.”,”MobileDeviceToken”:null,”WebApiTOKEN”:”b3b777b0-c7af-458d-be64-b3d6d760177f”}&IsLoadInactive=true

Supports:

GET

Attribute Details:

Company Validate Info (object) must
Login Name (string)  
Client IP (string)  
Password (string)  
Mobile Device Token (string)  
Web Api TOKEN (Guid)  
Is Load Inactive (bool) must

JSON Return Value:

{
    "ActionCode": null,
    "IsSuccessed": "YES",
    "ErrorMessage": "",
    "ReturnData": {
        "ClientList": [
            {
                "ClientID": "c97d2273-33a0-49eb-ba1a-3283be5a8cd0",
                "ClientName": "111112222",
                "JobContactTitle": "",
                "JobContactFirstName": "",
                "JobContactLastName": "",
                "JobContactPhone": "",
                "JobContactMobile": "",
                "JobContactFax": "",
                "JobContactEmail": "",
                "IsSameAsJobContact": false,
                "BillingContactTitle": "",
                "BillingContactFirstName": "wulong",
                "BillingContactLastName": "yang",
                "BillingContactPhone": "03 8804 0804",
                "BillingContactMobile": "0411208787",
                "BillingContactFax": "",
                "BillingContactEmail": "yange@uniware.com.au",
                "Memos": "",
                "JobAddress": "",
                "JobAddressLine2": "",
                "JobCity": "",
                "JobState": "",
                "JobPostalCode": "",
                "JobCountry": "Australia",
                "IsSameAsJobAddress": false,
                "BillingAddress": "",
                "BillingAddressLine2": "",
                "BillingCity": "",
                "BillingState": "ACT",
                "BillingPostalCode": "",
                "BillingCountry": "Australia",
                "ABN": "",
                "DefaultSalesDiscount": null,
                "BSBNumber": "",
                "BankAccountNumber": "",
                "BankAccountName": "",
                "StatementText": "",
                "PaymentMemos": "",
                "DefaultSalesTaxCodeID": null,
                "DefaultSalesTaxCodeName": "",
                "DefaultSalesTaxCodeRate": 0,
                "IsInactive": false,
                "CreateDate": "2018-10-23T13:20:01.117",
                "HasExportedToQ6": false,
                "Type": "Client"
            },
            {
                "ClientID": "f8ec9a3c-a76e-4447-9bc6-7a5a9fe42c52",
                "ClientName": "1111122221",
                "JobContactTitle": "",
                "JobContactFirstName": "",
                "JobContactLastName": "",
                "JobContactPhone": "",
                "JobContactMobile": "",
                "JobContactFax": "",
                "JobContactEmail": "",
                "IsSameAsJobContact": false,
                "BillingContactTitle": "",
                "BillingContactFirstName": "",
                "BillingContactLastName": "",
                "BillingContactPhone": "03 8804 0804",
                "BillingContactMobile": "",
                "BillingContactFax": "",
                "BillingContactEmail": "yange@uniware.com.au",
                "Memos": "",
                "JobAddress": "",
                "JobAddressLine2": "",
                "JobCity": "",
                "JobState": "",
                "JobPostalCode": "",
                "JobCountry": "Australia",
                "IsSameAsJobAddress": false,
                "BillingAddress": "",
                "BillingAddressLine2": "",
                "BillingCity": "",
                "BillingState": "ACT",
                "BillingPostalCode": "",
                "BillingCountry": "Australia",
                "ABN": "",
                "DefaultSalesDiscount": null,
                "BSBNumber": "",
                "BankAccountNumber": "",
                "BankAccountName": "",
                "StatementText": "",
                "PaymentMemos": "",
                "DefaultSalesTaxCodeID": null,
                "DefaultSalesTaxCodeName": "",
                "DefaultSalesTaxCodeRate": 0,
                "IsInactive": false,
                "CreateDate": "2018-10-23T13:20:01.417",
                "HasExportedToQ6": false,
                "Type": "Client"
            },
		……
	],
"PageCount": 1,
    "DataCount": 171,
    "PageIndex": 0
}

C# Sample Code:

public static string GetClientList (string Url)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
            request.Method = "GET";
            request.ContentType = "application/json";

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream myResponseStream = response.GetResponseStream();
            StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.UTF8);
            string retString = myStreamReader.ReadToEnd();

            myStreamReader.Close();
            myResponseStream.Close();

            if (response != null)
            {
                response.Close();
            }
            if (request != null)
            {
                request.Abort();
            }

            return retString;
        }

Javascript:

  function GetClientList () {
        $.ajax({
            type: "Get",
            url: Url,
            dataType: "json",
            success: function (data) {
                console.dir(data)
            },
            error: function (e) {
                console.dir(e)
            }
        });
}

Java Sample Code:

private static void GetClientList(String path){
    try {
        URL url = new URL(path);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
            InputStreamReader in = new InputStreamReader(connection.getInputStream());
            BufferedReader reader = new BufferedReader(in);
            String line = "";
            StringBuilder result = new StringBuilder();
            while ((line = reader.readLine()) != null) {
                result.append(line);
            }
            reader.close();
            connection.disconnect();
            System.out.println(result);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}

Swift Sample Code:

func GetClientList ()
{
    let loginDetail: LoginDetail = LoginDetail()
    let UrlString = TASQSampleCommonLibrary.TASQApiUrl
    var arrayData = [String: AnyObject]()
    
    arrayData ["WebApiTOKEN"] = TASQSampleCommonLibrary.TASQApiTOKEN as AnyObject?
    arrayData ["LoginName"] = loginDetail.LoginEmail! as AnyObject?
    arrayData ["Password"] = loginDetail.LoginPassword! as AnyObject?
    arrayData ["ClientIP"] = TASQSampleCommonLibrary.getIPAddresses() as AnyObject?
    arrayData ["MobileDeviceToken"] = TASQSampleCommonLibrary.getMobileDeviceToken() as AnyObject?
    
    let jasonLoginDeail = TASQSampleCommonLibrary.convertDictionaryToJSONData(dicData: arrayData as [String : AnyObject])
    
    let attachedURL: String = "&IsLoadInactive=true"
    
    let EncodeAttachedURL = (jasonLoginDeail + attachedURL).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed )! as String
    
    let url : String = UrlString + "Item/GetClientList?Jsonlogin="  + EncodeAttachedURL

    let replacedUrlString = url.replacingOccurrences(of: "\\", with:"" )
    
    let request = NSMutableURLRequest(url: NSURL(string: replacedUrlString)! as URL, cachePolicy: NSURLRequest.CachePolicy.reloadIgnoringLocalCacheData, timeoutInterval: 300)
    request.httpMethod = "GET"
    request.setValue("application/json", forHTTPHeaderField: "Content-Type")
    do {
        let config = URLSessionConfiguration.default
        let session = URLSession(configuration: config)
        let task = session.dataTask(with: request as URLRequest, completionHandler: {
            (data, response, error)  in
        })
        task.resume()
    }
}

How can we help?