API Documentation

In-depth reference documentation for iQmetrix API's.

NAV

OVERVIEW

The Punch Clock API allows you to retrieve Punch Clock entries from your RQ database.

ENDPOINTS

Sandbox: https://punchclockdemo.iqmetrix.net/v1
Production: https://punchclock.iqmetrix.net/v1

RESOURCES

PunchEntry

An instance of a clock punch for an employee at a location, with a punch-in time and (optionally) a punch-out time.

[
    {
        "Id": 1953,
        "CreatedDateUtc": "2015-09-23T15:41:59.403",
        "EmployeeVerified": false,
        "EmployeeSpecialId": "1002",
        "LastUpdateDateUtc": "2015-09-23T15:55:09.927",
        "LocationCode": "CWW",
        "LocationId": 14202,
        "ManagerVerified": false,
        "PunchInComments": "IN - FingerPrint/HomeConsole",
        "PunchOutComments": "OUT - HomeConsole",
        "TimeInAtStore": "2015-09-23T09:41:52.653",
        "TimeOutAtStore": "2015-09-23T09:55:03.973",
        "UserId": 2576,
        "Version": 1
    }
]
Name Description  
Id (Integer) Unique Identifier  
CreatedDateUtc (DateTime) Created date and time, in UTC  
EmployeeVerified (Boolean) A flag to indicate if the employee has verified the PunchEntry  
EmployeeSpecialId (String) Special identifier for Employee in RQ  
LastUpdateDateUtc (DateTime) Time of the last update, in UTC  
LocationCode (String(100)) An identifier for the Location in an external system  
LocationId (Integer) Identifier for the Location  
ManagerVerified (Boolean) A flag to indicate if the manager has verified the PunchEntry  
PunchInComments (String(100)) Punch in comments  
PunchOutComments (String(100)) Punch out comments  
TimeInAtStore (DateTime) Punch in time (local time at store), in UTC  
TimeOutAtStore (DateTime) Punch out time (local time at store), in UTC  
UserId (Integer) Identifier for a User  
Version (Integer) Latest revision number  
RQPunchId (Integer) Reserved for internal use  

REQUESTS

GET All Punch Entries

By default, the sorting order of the response to this request will be descending order by LastUpdateDateUtc.

Don't forget $filter= in the request!

Request

GET /Companies({CompanyId})/PunchEntries?$filter=LastUpdateDateUtc ge datetime'{StartDate}' and LastUpdateDateUtc le datetime'{EndDate}'&$skip={Skip}&$top={Top}

Example Request

GET /Companies(14146)/PunchEntries?$filter=LastUpdateDateUtc ge datetime'2015-01-01T06:00:00.000Z' and LastUpdateDateUtc le datetime'2016-01-01T05:59:59.000Z'&$skip=1&$top=10
Authorization: Bearer (Access Token)
Accept: application/hal+json

curl -X GET "https://punchclockdemo.iqmetrix.net/v1/Companies(14146)/PunchEntries?$filter=LastUpdateDateUtc ge datetime'2015-01-01T06:00:00.000Z' and LastUpdateDateUtc le datetime'2016-01-01T05:59:59.000Z'&$skip=1&$top=10" -H "Authorization: Bearer (Access Token)" -H "Accept: application/hal+json"
static IRestResponse GettingAllPunchEntries()
{
    var client = new RestClient("https://punchclockdemo.iqmetrix.net/v1/Companies(14146)/PunchEntries?$filter=LastUpdateDateUtc ge datetime'2015-01-01T06:00:00.000Z' and LastUpdateDateUtc le datetime'2016-01-01T05:59:59.000Z'&$skip=1&$top=10");
    var request = new RestRequest(Method.GET);
     
    request.AddHeader("Authorization", "Bearer (Access Token)"); 
    request.AddHeader("Accept", "application/hal+json"); 

    

    return client.Execute(request);
}

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;

public static CloseableHttpResponse GettingAllPunchEntries() throws IOException {
    CloseableHttpClient httpClient = HttpClients.createDefault();
    HttpGet request = new HttpGet("https://punchclockdemo.iqmetrix.net/v1/Companies(14146)/PunchEntries?$filter=LastUpdateDateUtc ge datetime'2015-01-01T06:00:00.000Z' and LastUpdateDateUtc le datetime'2016-01-01T05:59:59.000Z'&$skip=1&$top=10");
     
    request.addHeader("Authorization", "Bearer (Access Token)"); 
    request.addHeader("Accept", "application/hal+json"); 
    
    return httpClient.execute(request);
}
require 'rest-client'



response = RestClient.get 'https://punchclockdemo.iqmetrix.net/v1/Companies(14146)/PunchEntries?$filter=LastUpdateDateUtc ge datetime'2015-01-01T06:00:00.000Z' and LastUpdateDateUtc le datetime'2016-01-01T05:59:59.000Z'&$skip=1&$top=10', {
     :'Authorization' => 'Bearer (Access Token)',
     :'Accept' => 'application/hal+json',
    } 

puts response

URI Parameters

Response Parameters

Example Response

HTTP 200 Content-Type: application/hal+json
{
    "_links": {
        "prev": null,
        "self": {
            "href": "v1/Companies(14146)/PunchEntries?$filter=ransactionDateUTC ge datetime'2015-01-01T00:00:00.000' and TransactionDateUTC le datetime'2015-12-31T23:59:59.000'&$skip=0&$top=10",
            "templated": false
        },
        "next": null
    },
    "_embedded": {
        "self": [
            {
                "_links": {
                    "self": {
                        "href": "v1/Companies(14146)/PunchEntries(15)",
                        "templated": false
                    }
                },
                "_embedded": {},
                "Id": 1953,
                "CreatedDateUtc": "2015-09-23T15:41:59.403",
                "EmployeeVerified": false,
                "EmployeeSpecialId": 1002,
                "LastUpdateDateUtc": "2015-09-23T15:55:09.927",
                "LocationCode": "CWW",
                "LocationId": 14202,
                "ManagerVerified": false,
                "PunchInComments": "IN - FingerPrint/HomeConsole",
                "PunchOutComments": "OUT - HomeConsole",
                "TimeInAtStore": "2015-09-23T09:41:52.653",
                "TimeOutAtStore": "2015-09-23T09:55:03.973",
                "UserId": 2576,
                "Version": 1
            }
        ]
    }
}

PAGINATION

The Punch Clock API supports pagination of collections of resources for some requests.

Query Parameters

Pagination is done through the use of $skip and $top query string parameters.

$skip denotes the number of items to skip from the entire set of results. If a value less than 0 is specified, the URI is considered malformed.

$top denotes the maximum number of items to include in the response. This value defaults to 50 if a $skip value but no $top value is specified. Acceptable values are in the range [0-100].

Pagination-enabled requests include links for ‘self’, ‘prev’ and ‘next’ in the response data.

These links are relative, they do not include the base endpoint. It is the responsibility of the client to prepend the appropriate endpoint.

Example
{
    "_links": {
        "prev": null,
        "self": "v1/Companies(14146)/PunchEntries?$skip=0&$top=5",
        "next": "v1/Companies(14146)/PunchEntries?$skip=5&$top=5"
    },
    "_metadata": {
        "count": 15,
        "skip": 0,
        "top": 5
    }
}

In the example above, the _links section is included in the data returned from an API call to Getting All Punch Entries, where $skip=0 and $top=5.

The self.href value is the relative version of the API call that returned these results.

The next.href refers to a resource containing a page with the next 5 items.

The prev.href refers to a resource containing a page with the previous 5 items.

Was this page helpful?