Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

3.17.0

The Timecard REST API is used to retrieve all of the time entry records of a specific timecard period for a given work center. The REST API is also used to change the status of a timecard for a specific user.

The TimeCardID is in the format of yyyyww where yyyy represents the 4 digit year and ww represents the current week of the year left padded with zeros. e.g. The TimeCardID for the first week of 2016 would be 201601.

Resource URL Summary

Retrieve a list of Time Card records for a specific Work Center

GET /seiapi/v3/Timecard/${TimecardID}?workcenter=${WorkcenterID}

Retrieve a list of Time Card records that have a specific Status for a specific Work Center

GET /seiapi/v3/Timecard/${TimecardID}?workcenter=${WorkCenterID}&status=${StatusID}

Insert or Update the status of a Time Card for a specific User

PUT /seiapi/v3/Timecard/status/${TimecardID}?userid=${UserID}

Insert or Update the status of a Time Card for a group of Users

PUT /seiapi/v3/Timecard/status/${TimecardID}

URL Parameters

ParameterDescription
${StatusID}

Specifies the status of the timecard.

Valid values are controlled by the Time Card Status system category

${TimecardID}

Identifies the specific timecard
${UserID}Identifies the REST Object Definitions User Related Objects User Object.
${WorkCenterID}Identifies the REST Object Definitions Account Location Related Objects Work Center Object.

HTTP Headers

This API uses the default ServiceMobility HTTP Headers.

 


API Specifics

Retrieve a list of Time Card records for a specific Work Center

This API will return a list of all of the Time Card records for all Users for the Work Center with the specified ID, from the system. The Work Center with the specified ID must already exist in the system.

URL

 GET /seiapi/v3/Timecard/${TimecardID}?workcenter=${WorkcenterID}

HTTP Request Body

This request does not require a request body. 

HTTP Response Body

On success, HTTP response code of 200 will be returned, and the response body will contain a JSON array of Time Entry Objects.

(warning) It is possible for the returned array to be empty if there are no matching records.

[
	{
		// Time Entry Object
	},
		.
		.
]

Retrieve a list of Time Card records that have a specific Status for a specific Work Center

This API will return all of the individual time entry records for all users of the specified work center that have the specified status. This is API can be used to return all approved time cards or to report on time cards that are still open (have not been submitted by the mobile worker).  If there are no matching records then an empty array will be returned (e.g. [ ]).

URL

GET /seiapi/v3/Timecard/${TimecardID}?workcenter=${WorkcenterID}&status=${statusID}

HTTP Request Body

This request does not require a request body. 

HTTP Response Body

On success, HTTP response code of 200, this API will return a JSON array of Time Entry Objects

[
	{
		// Time Entry Object
	},
		.
		.
]

Insert or Update the status of a Time Card for a specific User

This API will update the status of a timecard for a specific user. Any status changes will automatically be sent to the mobile worker.

URL

PUT /seiapi/v3/Timecard/status/${TimecardID}?userid=${UserID}

HTTP Request Body

The request body must contain a valid REST Object Definitions Time Entry Related Objects Timecard Status Object

JSON Format
{
    "TimecardID": "",
    "Status": "",
	"Users" : [],
    "Alert": {
		"Module" : "Timecard",
        "Msg" : "",
		"Args" : {
				"TimecardID" : ""
			}
        }
    }
}

HTTP Response

On success an HTTP response code of 200 will be returned. 

Insert or Update the status of a Time Card for a group of Users

This API will update the status of a timecard for a group of mobile workers. The HTTP request body must include the Users property, which is an array containing a list of user IDs to be updated. 

Status changes will automatically be sent to the mobile worker.

URL

PUT /seiapi/v3/Timecard/status/${TimecardID}

HTTP Request Body

The request body must contain a valid REST Object Definitions Time Entry Related Objects Timecard Status Object

(warning) The Users property of the Timecard Status object must be populated with the list of user IDs to be updated. 

JSON Format
{
    "TimecardID": "",
    "Status": "",
	"Users" : [],
    "Alert": {
		"Module" : "Timecard",
        "Msg" : "",
		"Args" : {
				"TimecardID" : ""
			}
        }
    }
}

HTTP Response

On success an HTTP response code of 200 will be returned. 

  • No labels