Activity Profiles

Activity profiles help to limit the amount of data that employees can select, such as forms and result codes.

  • If you create an activity profile to assign to individual people, all settings in the profile are applicable.
  • Variances are applied to the adjusted start and stop times of employee activity events only.

Prerequisites

You must create all subordinate profiles before creating activity profiles. Refer to the Hierarchy of Activities entities section in the Guide to Activities overview for more information.

Example

In this example, we create, verify, update, and delete an activity profile.

Create an activity profile

Example request

Call the Create Activity Profile POST /v1/work/activity_profiles operation with the following request payload.

{
    "name": "Example Profile 1",
    "description": "This description describes an activity profile.",
    "trackingStatusType": {
        "id": 0
    },
    "doNotSetSpanOrphaned": false,
    "limitDirect": 1,
    "limitInDirect": 1,
    "formProfile": {
        "id": -2
    },
    "codeProfile": {
        "id": -2
    },
    "queryProfile": {
        "id": -2
    },
    "minDurationAmount": 60000,
    "maxDurationAmount": 86400,
    "version": 1,
    "multiStopVariance": 3,
    "firstActivityVariance": 5,
    "betweenActivityVariance": 5,
    "lastActivityVariance": 5,
    "openActivityLookbackWindow": 32400,
    "timecardValidation": {
        "underAllocation": {
            "enabled": false,
            "maximumVariances": 1,
            "checkFutureActivities": false,
            "allowShiftSaveWithoutActivitiesInThePast": false
        },
        "overAllocation": {
            "enabled": false,
            "checkFutureActivities": false
        },
        "checkOrphanSpanCreation": false,
        "futureValidation": {
            "id": 0
        }
    }
}

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

{
    "id": 1,
    "name": "Example Profile 1",
    "description": "This description describes an activity profile.",
    "trackingStatusType": {
        "id": 0,
        "qualifier": "Start and Stop"
    },
    "doNotSetSpanOrphaned": false,
    "limitDirect": 1,
    "limitInDirect": 1,
    "formProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "codeProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "queryProfile": {
        "id": -2,
        "qualifier": "Default Profile"
    },
    "minDurationAmount": 60000,
    "maxDurationAmount": 86400,
    "version": 1,
    "openActivityLookbackWindow": 32400,
    "timecardValidation": {
        "underAllocation": {
            "enabled": false,
            "maximumVariances": 0,
            "checkFutureActivities": false,
            "allowShiftSaveWithoutActivitiesInThePast": false
        },
        "overAllocation": {
            "enabled": false,
            "checkFutureActivities": false
        },
        "checkOrphanSpanCreation": false,
        "futureValidation": {
            "id": 0,
            "qualifier": "Allow"
        }
    },
    "multiStopVariance": 3,
    "firstActivityVariance": 5,
    "betweenActivityVariance": 5,
    "lastActivityVariance": 5
}

Verify

To verify, call the Retrieve Activity Profile by ID GET /v1/work/activity_profiles/{id} or the Retrieve All Activity Profiles or by Name GET /v1/work/activity_profiles?name={name} operation .

Calling GET /v1/work/activity_profiles/1 or GET /v1/work/activity_profiles?name=Example Profile 1 returns:

{
    "id": 1,
    "name": "Example Profile 1",
    "description": "This description describes an activity profile.",
    "trackingStatusType": {
        "id": 0,
        "qualifier": "Start and Stop"
    },
    "doNotSetSpanOrphaned": false,
    "limitDirect": 1,
    "limitInDirect": 1,
    "formProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "codeProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "queryProfile": {
        "id": -2,
        "qualifier": "Default Profile"
    },
    "minDurationAmount": 60000,
    "maxDurationAmount": 86400,
    "version": 1,
    "openActivityLookbackWindow": 32400,
    "timecardValidation": {
        "underAllocation": {
            "enabled": false,
            "maximumVariances": 0,
            "checkFutureActivities": false,
            "allowShiftSaveWithoutActivitiesInThePast": false
        },
        "overAllocation": {
            "enabled": false,
            "checkFutureActivities": false
        },
        "checkOrphanSpanCreation": false,
        "futureValidation": {
            "id": 0,
            "qualifier": "Allow"
        }
    },
    "multiStopVariance": 3,
    "firstActivityVariance": 5,
    "betweenActivityVariance": 5,
    "lastActivityVariance": 5
}

Note: The Retrieve All Activity Profiles or by Name GET /v1/work/activity_profiles?name=Example Profile 1 operation returns the object above enclosed in an array, since omitting the name query parameter returns all activity profiles in the system.

Update the profile

To update the activity profile with a new minimum duration amount of 70,000 and an open activity lookback window of 22,400, call the Update Activity Profile by ID PUT /v1/work/activity_profiles/1 operation with the following request payload.

Example request

{
    "id": 1,
    "name": "Example Profile 1",
    "description": "This description describes an activity profile.",
    "trackingStatusType": {
        "id": 0,
        "qualifier": "Start and Stop"
    },
    "doNotSetSpanOrphaned": false,
    "limitDirect": 1,
    "limitInDirect": 1,
    "formProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "codeProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "queryProfile": {
        "id": -2,
        "qualifier": "Default Profile"
    },
    "minDurationAmount": 70000,
    "maxDurationAmount": 86400,
    "version": 1,
    "openActivityLookbackWindow": 22400,
    "timecardValidation": {
        "underAllocation": {
            "enabled": false,
            "maximumVariances": 0,
            "checkFutureActivities": false,
            "allowShiftSaveWithoutActivitiesInThePast": false
        },
        "overAllocation": {
            "enabled": false,
            "checkFutureActivities": false
        },
        "checkOrphanSpanCreation": false,
        "futureValidation": {
            "id": 0,
            "qualifier": "Allow"
        }
    },
    "multiStopVariance": 3,
    "firstActivityVariance": 5,
    "betweenActivityVariance": 5,
    "lastActivityVariance": 5
}

Example response

{
    "id": 1,
    "name": "Example Profile 1",
    "description": "This description describes an activity profile.",
    "trackingStatusType": {
        "id": 0,
        "qualifier": "Start and Stop"
    },
    "doNotSetSpanOrphaned": false,
    "limitDirect": 1,
    "limitInDirect": 1,
    "formProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "codeProfile": {
        "id": -2,
        "qualifier": "Empty Profile"
    },
    "queryProfile": {
        "id": -2,
        "qualifier": "Default Profile"
    },
    "minDurationAmount": 70000,
    "maxDurationAmount": 86400,
    "version": 2,
    "openActivityLookbackWindow": 22400,
    "timecardValidation": {
        "underAllocation": {
            "enabled": false,
            "maximumVariances": 0,
            "checkFutureActivities": false,
            "allowShiftSaveWithoutActivitiesInThePast": false
        },
        "overAllocation": {
            "enabled": false,
            "checkFutureActivities": false
        },
        "checkOrphanSpanCreation": false,
        "futureValidation": {
            "id": 0,
            "qualifier": "Allow"
        }
    },
    "multiStopVariance": 3,
    "firstActivityVariance": 5,
    "betweenActivityVariance": 5,
    "lastActivityVariance": 5
}

Note that the version is automatically incremented to 2. To successfully update this profile again, you must pass version 2 in the request body.

Delete the profile

To delete this activity profile, call the Delete Activity Profile by ID DELETE /v1/work/activity_profiles/1 operation.

The system returns HTTP status 204 with an empty response body.

Assign activity profiles

Use operations against the Persons API resource to assign Activity profiles to a person.

Refer to the assign activity profiles topic for more information about assigning activity profiles.

Refer to A Guide to People Information for more information about the Persons API resource and the assignment API resources.