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

Get Job List

 

Get the job list for TASQ

URL:

https://jobapi.tasq.com.au/api/Job/GetJobList?Jsonlogin={CompanyValidateInfo}

Your get job list api url should look like this:

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

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)

 

Return Value:

{
    "ActionCode": null,
    "IsSuccessed": "YES",
    "ErrorMessage": "",
    "ReturnData": [
        {
            "JobTransactionHeaderID": "71cef9e8-2035-4130-815a-95ab205a5a2d",
            "Overdueby": null,
            "ClientID": "aba5a701-bc61-49b3-b38b-54df440180de",
            "ClientName": "1111test0432",
            "ClientEmail": "yange@uniware.com.au",
            "BillingContactEmail": null,
            "ReferenceNo": "JOB00000078",
            "JobStatus": "Order",
            "JobStatusString": "Order",
            "JobType": "Order",
            "Memo": "",
            "DueDate": null,
            "TransactionDate": "2018-11-12T00:00:00",
            "TotalAmount": 0,
            "ClosedDate": null,
            "HasLinkedDoc": false,
            "IsJobCompleted": false,
            "AmountDue": 0
        },
        {
            "JobTransactionHeaderID": "703402d5-455a-418d-9b10-1ed345e6bb01",
            "Overdueby": null,
            "ClientID": "aba5a701-bc61-49b3-b38b-54df440180de",
            "ClientName": "1111test0432",
            "ClientEmail": "yange@uniware.com.au",
            "BillingContactEmail": null,
            "ReferenceNo": "JOB00000077",
            "JobStatus": "Quote",
            "JobStatusString": "Quote",
            "JobType": "Quote",
            "Memo": "",
            "DueDate": null,
            "TransactionDate": "2018-11-12T00:00:00",
            "TotalAmount": 0,
            "ClosedDate": null,
            "HasLinkedDoc": false,
            "IsJobCompleted": false,
            "AmountDue": 0
        },
……
	]
}

C# Sample Code:

public static string GetJobList (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:

Javascript:
  function GetJobList () {
        $.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 GetJobList(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 GetJobList ()
{
    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 = ""
    
    let EncodeAttachedURL = (jasonLoginDeail + attachedURL).addingPercentEncoding(withAllowedCharacters: .urlHostAllowed )! as String
    
    let url : String = UrlString + "Job/GetJobList?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?