API V2 Documentation

Getting started

Welcome

You are viewing the documentation for version 2 of our APIs. Documentation for our version 1 API can be found here. The Edays API provides programmatic access to read and write data to your Edays system. You may find it useful for getting data imported to another system, or performing operations triggered by some other application.

The APIs are RESTful. Where available, the operations will typically provide:

  • GET - Access data. Returns data with a 200 response, notifies data not available with a 404 response
  • POST - Create data. Returns a 200 or 201 response if successful, or a 400 response if unsuccessful
  • PUT - Change data. Returns a 200, 201 or 204 response if successful, or a 400 response if unsuccessful
  • DELETE - Remove data. Returns a 204 response if successful, or a 400 response if unsuccessful

Authentication

The APIs require authorisation using OAuth 2.0. Each API call must include an Authorization header including a valid Bearer Access Token

  • Client Credentials Grant - Create a dedicated user account within Edays, on the Roles tab within the user record select the account type Api Client and you can then generate a Client ID and Client Secret. Please take note of these details and store them securely, as it will not be possible to access these details again. You can however regenerate a new Client Secret at any time, but please note this will replace any existing Client Secret.

    Requesting an authentication token

    A valid Client ID and Client Secret can be used to request an Access Token that can then be supplied in future API calls. A Client Credentials Access Token is valid for one week.

    Token URL:

    	https://YOUR-SYSTEM.e-days.co.uk/token

    Supported HTTP Methods: POST

    Example POST Request:

        POST
        {
            "grant_type": "client_credentials"
            "client_id": "e-days_apiclient@e-days.co.uk",
            "client_secret": "Tg9/y*A5_4cRa&N8}B4kf-X3P7{xtL6="
        }

    Example POST Response:

        [
            {
                "token_type": "bearer",
                "access_token": "C8A1P9FiVo2ZF_HJB8uuaWLUM9NH4pAznLsU4pAJTPtZVMyWlsMlNN_fGa1Y59jquV5kSNqtUnYhWovhBimkDHGftqHfgxXnb91oSrs598BTiLFMaJCbokV42YJDJ1y6wTgke7d5JW7Q5NYWq9XPpsDzTgOG7WF6YXQjRxUvk09_icoRqMsHG0BHaZK_cVC8rmD1hGRyelUIagsKyycTqGqyMQebo06Z5R7YZfjhQNokZZIgyUSOjgN7K2sIlMBA",
                "expires_in": 604799,
                ".issued": "Wed, 18 Oct 2017 14:59:13 GMT",
                ".expires": "Wed, 25 Oct 2017 14:59:13 GMT"
            }
        ]
The Bearer Access Token is now supplied as an Authorization header with each API call, for example a call to access users
	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users

Example GET Request:

    GET /api/v2/users
    Authorization: Bearer C8A1P9FiVo2ZF_HJB8uuaWLUM9NH4pAznLsU4pAJTPtZVMyWlsMlNN_fGa1Y59jquV5kSNqtUnYhWovhBimkDHGftqHfgxXnb91oSrs598BTiLFMaJCbokV42YJDJ1y6wTgke7d5JW7Q5NYWq9XPpsDzTgOG7WF6YXQjRxUvk09_icoRqMsHG0BHaZK_cVC8rmD1hGRyelUIagsKyycTqGqyMQebo06Z5R7YZfjhQNokZZIgyUSOjgN7K2sIlMBA

Paging

A number of endpoint support paging of data. In order to specify the page number and page size of the results you can in "page" and "pageSize" querystring parameters. The endpoints that support paging are marked within this documentation

Example GET Request

	api/v2/absences?page=1&pagesize=10 

The following info is returned in the header of the response in order to allow you to build a paging interface for navigating the returned data

Paging response headers:

    edays-pagination-page: 2
    edays-pagination-page-size: 500
    edays-pagination-returned: 254
    edays-pagination-total: 754 
                

Paging variables:

edays-pagination-page: The current page of the returned data

edays-pagination-page-size: The current page size of the returned data

edays-pagination-returned: The number of records returned within the current page

edays-pagination-total: The total number of records in the resultset


Users

When editing users, fields sent via the API will be set at user level. To have them inherit from template level, you should send NULL or leave out the field entirely in your request.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "EdaysId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "PartnerId": "d.barrett",
            "FirstName": "Dana",
            "LastName": "Barrett",
            "Email": "d.barrett@acme.com",
            "Login": "d.barrett@acme.com",
            "SsoUserId": "",
            "PayrollNumber": "P123",
            "EmployeeNumber": "E123",
            "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
            "PartnerSettingsTemplateId": "USA",
            "IsLeaver": false,
            "Dob": "1973-10-24T00:00:00",
            "HomeAddress": "",
            "HomePhone": "",
            "HomeEmail": "",
            "WorkPhone": "",
            "WorkPhoneExt": "",
            "NextOfKin": "",
            "NextOfKinContactDetails": "",
            "JobTitle": "",
            "AnnualPay": 12000,
            "EmploymentStartDate": null,
            "ContinuousStartDate": null,
            "ClientProvidedId": "User123456",
            "FTE": 1.0000,
            "CalendarYearStartMonth": 1,
            "CalendarYearStartDay": 1,
            "HoursPerDay": 7.5
        }
    ]

Example POST Request:

    POST
    {
        "PartnerId": "w.barrett",
        "FirstName": "Willie",
        "LastName": "Barrett",
        "Email": "w.barrett@acme.com",
        "Login": "w.barrett@acme.com",
        "SsoUserId": "",
        "PayrollNumber": "P321",
        "EmployeeNumber": "E321",
        "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
        "PartnerSettingsTemplateId": "USA",
        "IsLeaver": false,
        "Dob": "1953-06-12T00:00:00",
        "HomeAddress": "",
        "HomePhone": "",
        "HomeEmail": "",
        "WorkPhone": "",
        "WorkPhoneExt": "",
        "NextOfKin": "",
        "NextOfKinContactDetails": "",
        "JobTitle": "",
        "AnnualPay": 12000,
        "EmploymentStartDate": null,
        "ContinuousStartDate": null,
        "ClientProvidedId": "User12345",
        "SetDefaultEntitlement": true,
        "FTE": 1,
        "CalendarYearStartMonth": 1,
        "CalendarYearStartDay": 1,
        "HoursPerDay": 7.5
    }

The PATCH verb can be used to create multiple user records. There is a limit of 500 users per call.

Example PATCH Request:

    PATCH
    [
        {
            "PartnerId": "w.barrett",
            "FirstName": "Willie",
            "LastName": "Barrett",
            "Email": "w.barrett@acme.com",
            "Login": "w.barrett@acme.com",
            "SsoUserId": "",
            "PayrollNumber": "P321",
            "EmployeeNumber": "E321",
            "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
            "PartnerSettingsTemplateId": "USA",
            "IsLeaver": false,
            "Dob": "1953-06-12T00:00:00",
            "HomeAddress": "",
            "HomePhone": "",
            "HomeEmail": "",
            "WorkPhone": "",
            "WorkPhoneExt": "",
            "NextOfKin": "",
            "NextOfKinContactDetails": "",
            "JobTitle": "",
            "AnnualPay": 12000,
            "EmploymentStartDate": null,
            "ContinuousStartDate": null,
            "ClientProvidedId": "User12345",
            "SetDefaultEntitlement": true,
            "FTE": 1,
            "CalendarYearStartMonth": 1,
            "CalendarYearStartDay": 1,
            "HoursPerDay": 7.5,
            "ApplyFteEntitlementChanges": true,
            "FteChangeEffectiveDate": "2018-09-30T00:00:00",
            "FteChangeRoundingPolicy": 2
        },
        {
            "PartnerId": "d.barrett",
            "FirstName": "Dana",
            "LastName": "Barrett",
            "Email": "d.barrett@acme.com",
            "Login": "d.barrett@acme.com",
            "SsoUserId": "",
            "PayrollNumber": "P123",
            "EmployeeNumber": "E123",
            "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
            "PartnerSettingsTemplateId": "USA",
            "IsLeaver": false,
            "Dob": "1973-10-24T00:00:00",
            "HomeAddress": "",
            "HomePhone": "",
            "HomeEmail": "",
            "WorkPhone": "",
            "WorkPhoneExt": "",
            "NextOfKin": "",
            "NextOfKinContactDetails": "",
            "JobTitle": "",
            "AnnualPay": 12000,
            "EmploymentStartDate": null,
            "ContinuousStartDate": null,
            "ClientProvidedId": "User12345",
            "SetDefaultEntitlement": true,
            "FTE": 1,
            "CalendarYearStartMonth": 1,
            "CalendarYearStartDay": 1,
            "HoursPerDay": 7.5,
            "ApplyFteEntitlementChanges": true,
            "FteChangeEffectiveDate": "2018-07-25T00:00:00",
            "FteChangeRoundingPolicy": 2
        }

    ]

Example PATCH Response:


    
    [
        {
        "Request": 
            {
                "PartnerId": "w.barrett",
                "FirstName": "Willie",
                "LastName": "Barrett",
                "Email": "w.barrett@acme.com",
                "Login": "w.barrett@acme.com",
                "SsoUserId": "",
                "PayrollNumber": "P321",
                "EmployeeNumber": "E321",
                "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
                "PartnerSettingsTemplateId": "USA",
                "IsLeaver": false,
                "Dob": "1953-06-12T00:00:00",
                "HomeAddress": "",
                "HomePhone": "",
                "HomeEmail": "",
                "WorkPhone": "",
                "WorkPhoneExt": "",
                "NextOfKin": "",
                "NextOfKinContactDetails": "",
                "JobTitle": "",
                "AnnualPay": 12000,
                "EmploymentStartDate": null,
                "ContinuousStartDate": null,
                "ClientProvidedId": "User12345",
                "SetDefaultEntitlement": true,
                "FTE": 1
            },
        "Response":
            {                
                "StatusCode": 201,
                "Message": "resource created"
            }
        },
        {
        "Request": 
            {
                "PartnerId": "d.barrett",
                "FirstName": "Dana",
                "LastName": "Barrett",
                "Email": "d.barrett@acme.com",
                "Login": "d.barrett@acme.com",
                "SsoUserId": "",
                "PayrollNumber": "P123",
                "EmployeeNumber": "E123",
                "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
                "PartnerSettingsTemplateId": "USA",
                "IsLeaver": false,
                "Dob": "1973-10-24T00:00:00",
                "HomeAddress": "",
                "HomePhone": "",
                "HomeEmail": "",
                "WorkPhone": "",
                "WorkPhoneExt": "",
                "NextOfKin": "",
                "NextOfKinContactDetails": "",
                "JobTitle": "",
                "AnnualPay": 12000,
                "EmploymentStartDate": null,
                "ContinuousStartDate": null,
                "ClientProvidedId": "User12345",
                "SetDefaultEntitlement": true,
                "FTE": 1
            },
        "Response":
            {                
                "StatusCode": 400,
                "Message": "The user with the PartnerId 'd.barrett' already exists"
            }
        }
    ]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}

Supported HTTP Methods: GET, PUT, PATCH, DELETE

Example GET Response:


    {
        "PartnerId": "d.barrett",
        "FirstName": "Dana",
        "LastName": "Barrett",
        "Email": "d.barrett@acme.com",
        "Login": "d.barrett@acme.com",
        "SsoUserId": "",
        "PayrollNumber": "P123",
        "EmployeeNumber": "E123",
        "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
        "PartnerSettingsTemplateId": "USA",
        "IsLeaver": false,
        "Dob": "1973-10-24T00:00:00",
        "HomeAddress": "",
        "HomePhone": "",
        "HomeEmail": "",
        "WorkPhone": "",
        "WorkPhoneExt": "",
        "NextOfKin": "",
        "NextOfKinContactDetails": "",
        "JobTitle": "",
        "AnnualPay": 12000,
        "EmploymentStartDate": null,
        "ContinuousStartDate": null,
        "ClientProvidedId": "User12345",
        "FTE": 1.0000,
        "CalendarYearStartDay": 1,
        "CalendarYearStartMonth": 4,
        "HoursPerDay": 7.5
    }

Example PUT Request:

    PUT
    {
        "PartnerId": "d.barrett",
        "FirstName": "Dana",
        "LastName": "Barrett",
        "Email": "d.barrett@acme.com",
        "Login": "d.barrett@acme.com",
        "SsoUserId": "",
        "PayrollNumber": "P123",
        "EmployeeNumber": "E123",
        "SettingsTemplateId": "521c3811-38cc-e111-833b-00155d000918",
        "PartnerSettingsTemplateId": "USA",
        "IsLeaver": false,
        "Dob": "1973-10-24T00:00:00",
        "HomeAddress": "",
        "HomePhone": "",
        "HomeEmail": "",
        "WorkPhone": "",
        "WorkPhoneExt": "",
        "NextOfKin": "",
        "NextOfKinContactDetails": "",
        "JobTitle": "",
        "AnnualPay": 12000,
        "EmploymentStartDate": "2017-10-19T00:00:00",
        "ContinuousStartDate": "2018-04-19T00:00:00",
        "ClientProvidedId": "User12345",
        "SetDefaultEntitlement": true,
        "FTE": 1,
        "ApplyFteEntitlementChanges": true,
        "FteChangeEffectiveDate": "2018-07-25T00:00:00",
        "FteChangeRoundingPolicy": 2,
        "CalendarYearStartDay": 1,
        "CalendarYearStartMonth": 4,
        "HoursPerDay": 7.5
    }

Records can be patched by using the JSON Patch format, see jsonpatch.com for more details

Example PATCH Request:

    PATCH
    [
        { "op": "replace", "path": "/Email", "value": "newemail@acme.com" },
    ]

User System Settings

Settings are inherited from the global and user template levels if null. Please see the relevant lists for appropriate values for Language, Timezone, Date Format, Date Seperator, Reportee Descendant Levels, Override Time Unit, User Views and Custom User Views

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/settings

Supported HTTP Methods: GET, PUT, PATCH

Example GET Response:

    {
        "Language": null,
        "Timezone": null,
        "DateFormat": null,
        "DateSeparator": null,
        "AdminUserView": null,
        "AdminCustomUserView": null,
        "StaffRecordsUserView": null,
        "StaffRecordsCustomUserView": null,
        "CalendarUserView": null,
        "CalendarCustomUserView": null,
        "ReportingUserView": null,
        "ReportingCustomUserView": null,
        "ReporteesIncludesDescendants": null,
        "ReporteeDescendantLevels": null,
        "AllowManualDayCalculationByAuthoriser": null,
        "AllowManualDayCalculationByUser": null,
        "OpenAbsenceAlertEmail": null,
        "AllowUserToChangePassword": null,
        "AllowPlannedEntitlementTransfers": null,
        "AllowUnplannedEntitlementTransfers": null,
        "AllowOvertimeEntitlementTransfers": null,
        "OverrideDisplayTimeUnit": null,
        "HideTimesForDayBookings": null,
        "BradfordFactorAlias": null,
        "ShowBradfordFactorToManagers": null,
        "ShowBradfordFactorToUsers": null,
        "ShowBradfordFactorOccurenceDetail": null,
        "ShowBradfordFactorMeter": null,
        "BradfordFactorWarningLevel": null
    }

Example PUT Request:

    PUT
    {
        "Language": "en-gb",
        "Timezone": null,
        "DateFormat": null,
        "DateSeparator": null,
        "AdminUserView": null,
        "AdminCustomUserView": null,
        "StaffRecordsUserView": null,
        "StaffRecordsCustomUserView": null,
        "CalendarUserView": null,
        "CalendarCustomUserView": null,
        "ReportingUserView": null,
        "ReportingCustomUserView": null,
        "ReporteesIncludesDescendants": null,
        "ReporteeDescendantLevels": null,
        "AllowManualDayCalculationByAuthoriser": null,
        "AllowManualDayCalculationByUser": null,
        "OpenAbsenceAlertEmail": null,
        "AllowUserToChangePassword": null,
        "AllowPlannedEntitlementTransfers": null,
        "AllowUnplannedEntitlementTransfers": null,
        "AllowOvertimeEntitlementTransfers": null,
        "OverrideDisplayTimeUnit": null,
        "HideTimesForDayBookings": null,
        "BradfordFactorAlias": null,
        "ShowBradfordFactorToManagers": null,
        "ShowBradfordFactorToUsers": null,
        "ShowBradfordFactorOccurenceDetail": null,
        "ShowBradfordFactorMeter": null,
        "BradfordFactorWarningLevel": null
    }

Records can be PATCHed by using the JSON Patch format, see jsonpatch.com for more details

Example PATCH Request:

    PATCH
    [
        { "op": "replace", "path": "/DateFormat", "value": "MMMM dd, yyyy" },
    ]

User Groups

User Groups are the Groups that a user is a member of.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/groups

Supported HTTP Methods: GET, PUT, PATCH

Example GET Response:

    [
        {
            "GroupEdaysId" : "00000000-0000-0000-0000-000000000000",
            "GroupPartnerId": "team-programming",
            "GroupName": "Programming",
        },
        {
            "GroupEdaysId" : "00000000-0000-0000-0000-000000000000",
            "GroupPartnerId": "location-california",
            "GroupName": "California",
        }
    ]    

Example PUT Request:

    PUT
    [
        {

            "GroupPartnerId": "team-programming",
        },
        {
            "GroupPartnerId" : "location-nottingham",
        }
    ]



    

Email Notifications

Please see the relevant lists for appropriate values for Email Notification Type, Record Type Discriminator, Record Types, Record Status

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/emailnotifications

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Id": 1,
            "EmailNotificationType": 0,
            "EmailAddress": "test@e-days.co.uk",
            "RecordTypeDiscriminator": 2,
            "RecordTypes": [
                15
            ],
            "RecordStatus": [
                4
            ]
        }
    ]

Example POST Request:

    POST
    {
        "EmailNotificationType": 0,
        "EmailAddress": "sicknessalerts@e-days.co.uk",
        "RecordTypeDiscriminator": 2,
        "RecordTypes": [
            15
        ],
        "RecordStatus": [
            1, 2
        ]
    

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/emailnotifications/{emailNotificationId}

Supported HTTP Methods: GET, PUT, DELETE

Example GET Response:

    {
        "EmailNotificationType": 0,
        "EmailAddress": "sicknessalerts@e-days.co.uk",
        "RecordTypeDiscriminator": 2,
        "RecordTypes": [
            15
        ],
        "RecordStatus": [
            1, 2
    ]
}

Example PUT Request:

    {
        "EmailNotificationType": 0,
        "EmailAddress": "test@e-days.co.uk",
        "RecordTypeDiscriminator": 2,
        "RecordTypes": [
            15
        ],
        "RecordStatus": [
            1, 2
        ]
    }

Mark As Leaver

LeftDate can be set to a current, past or future date

LockOption can be used to immediately lock an account with a future dated LeftDate. Please see the list for appropriate values for the Leaver Lock Option

Please see the list for appropriate values for the Cancel Future Records Option

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/markasleaver

Supported HTTP Methods: POST

Example POST Request:

    POST
    {
        "LeftDate": "2020-01-01",
        "LockOption": 0,
        "CancelFutureRecordsOption": 0
    }
    

Reinstate a user

This will cause a user who has been marked as left to be reinstated (needs a spare license), or a user due to leave to no longer be scheduled to leave.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/reinstateuser

Supported HTTP Methods: POST

Example POST Request:

    POST
    {
    }
    

Rotas

Please see the relevant lists for appropriate values for Rota

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/rotas

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Rota": 1,
            "StartDate": "2020-10-24T00:00:00"
        }
    ]

Example POST Request:

    POST
    {
        "Rota": 2,
        "StartDate": "2020-10-24T00:00:00"
    }

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/rotas/{rotaId}

Supported HTTP Methods: DELETE

Apply Rotas to Users

This method will apply the assigned rotas for the supplied list of users. A rota application will add the rota to the users calendar from the StartDate

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/applyRotaToUsers

Optional: updateAbsences can be passed in as a query string parameter with a value of true or false.

If using updateAbsences with a value of true, the absences of the users included in the supplied list of users will have their days and hours off updated to reflect their new rota.

Resource URL using updateAbsences:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/applyRotaToUsers?updateAbsences=true

Supported HTTP Methods: POST

Example POST Request:

    POST
    
       [
	    "d.barret",
	    "w.barret"
       ]
     

User Absences

Retrieves absences for a specific user

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/absences?recordtype=1&absencetype=1&datestart=20180301&dateend=20180320&page=1&pagesize=50

Supported HTTP Methods: GET (Supports paging)

Filters:

recordtype: The specific record types of the absences. The values for this filter can be found in the Record Type Discriminators endpoint under the "lists" section but for quick reference, planned absences = 1, unplanned = 2. If no type id is supplied, all types are returned

absencetype: The specific absence type id. The values for these ids can be found in the Absence Type endpoint. If no type id is supplied, all types are returned

datestart: The start of a date range to filter the results by. Must be supplied in the format "YYYYMMDD"

dateend: The end of a date range to filter the results by. Must be supplied in the format "YYYYMMDD"

page: The page number of the response. This number starts at and defaults to 1

pagesize: The number of records per page. This number defaults to 50

Example GET Response:

    [
        {
            "Id": "EEBDC36D-C744-42A8-99BE-001A2F2A24DE",
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "FirstName": "Dana",
            "LastName": "Barret",
            "AbsenceTypeId": 1,
            "Status": "Pending",
            "StartTime": "2017-04-13 09:00",
            "EndTime": "2017-04-13 17:30",
            "DurationInDays": 1,
            "DurationInMinutes": 480,
            "DateCreated": "2017-04-12 09:00",
            "IsOpen": false
        }
    ]

Public Holidays

Please see the relevant lists for appropriate values for Public Holiday

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/publicholidays

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Pattern": 1
        }
    ]

Example POST Request:

    POST
    {
        "Pattern": 2
    }

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/publicholidays/{patternId}

Supported HTTP Methods: DELETE

Custom Days

Please see the relevant lists for appropriate values for Custom Day

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/customdays

Supported HTTP Methods: GET, POST

Example GET Response:

    {
        [
            "Pattern": 3
        ]
    }

Example POST Request:

    POST
    {
        "Pattern": 4
    }

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/customdays/{patternId}

Supported HTTP Methods: DELETE

Deducting Entitlements

Deducting entitlements are those that deduct time used from an existing total entitlement. The value of entitlement decreases. Examples of absence types that affect deducting entitlements are vacation, working from home, training

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/entitlements/deducting

Supported HTTP Methods: GET

Example GET Response:

    [
        {
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "Login": "DBarret",
            "ElementId": 1,
            "ElementName": "Annual Entitlement",
            "BookingPeriod": 2,
            "AnnualEntitlement": 20,
            "Transfers": 5,
            "PendingApproval": 2,
            "TotalBooked": 5,
            "Taken": 3,
            "Untaken": 2,
            "Remaining": 19,
            "TimeUnit": 1,
            "EntitlementPotId": 1,
            "EntitlementIsEnabled": true
        },
        {
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "Login": "DBarret",
            "ElementId": 2,
            "ElementName": "Sickness",
            "BookingPeriod": 2,
            "AnnualEntitlement": 20,
            "Transfers": 5,
            "PendingApproval": 2,
            "TotalBooked": 5,
            "Taken": 3,
            "Untaken": 2,
            "Remaining": 19,
            "TimeUnit": 1,
            "EntitlementPotId": 2,
            "EntitlementIsEnabled": true
        }
    ]

Adjusting Entitlements

You can manage the balance of a user's entitlement in Edays by making adjustments to the entitlement elements within an entitlement pot. The balance of the targeted entitlement element wll be set to the amount specified.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/entitlements

Supported HTTP Methods: POST

Example POST Request:

    POST
    {
        "ElementId": 1,
        "BookingPeriod": 2,
        "AnnualEntitlement": 5,
        "TimeUnit": 0
    }

Summing Entitlements

Summing entitlements are those that keep the balance of time used only. The value of the entitlement increases. Examples of absence types that affect summing entitlements are sickness, lateness, compationate leave

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/entitlements/summing

Supported HTTP Methods: GET

Example GET Response:

    [
        {
            "EntitlementPotId": 2,
            "EntitlementName": "Sickness",
            "YearToDate": 4,
            "Last6Months": 3,
            "Last3Months": 2,
            "Last30Days": 1

        },
        {
            "EntitlementPotId": 2,
            "EntitlementName": "Sickness",
            "YearToDate": 10,
            "Last6Months": 2,
            "Last3Months": 2,
            "Last30Days": 1
        }
    ]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/entitlements/{entitlementId}

Supported HTTP Methods: GET

Example GET Response:

    [
        {
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "Login": "DBarret",
            "ElementId": 1,
            "ElementName": "Annual Entitlement",
            "BookingPeriod": 2,
            "AnnualEntitlement": 20,
            "Transfers": 5,
            "PendingApproval": 2,
            "TotalBooked": 5,
            "Taken": 3,
            "Untaken": 2,
            "Remaining": 19,
            "TimeUnit": 1,
            "EntitlementPotId": 1,
            "EntitlementIsEnabled": true
        },
        {
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "Login": "DBarret",
            "ElementId": 1,
            "ElementName": "Annual Entitlement",
            "BookingPeriod": 3,
            "AnnualEntitlement": 20,
            "Transfers": 5,
            "PendingApproval": 2,
            "TotalBooked": 5,
            "Taken": 3,
            "Untaken": 2,
            "Remaining": 19,
            "TimeUnit": 1,
            "EntitlementPotId": 1,
            "EntitlementIsEnabled": true
        }
    ]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/entitlements/pots

Supported HTTP Methods: GET

Example GET Response:

    [
        {
            "PotId": 1,
            "Description": "Holiday",
            "RecordType": 1,
            "EntitlementIsEnabled": true
        },
        {
            "PotId": 2,
            "Description": "Sickness",
            "RecordType": 2,
            "EntitlementIsEnabled": true
        }
    ]

Authorisation

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/authorisation

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "UserPartnerId": "John.Smith",
            "StepOneAuthoriserPartnerId": "Joe.Bloggs",
            "StepOneAltAuthoriserPartnerIds": ["Phil Jones","Bill Bailey"],
            "StepTwoAuthoriserPartnerId": "Joe.Joyce",
            "StepTwoAltAuthoriserPartnerIds": ["Phil Jones","Bill Bailey"]
        }
    ]

Example POST Request:


    {
        "UserPartnerId": "John.Smith",
        "StepOneAuthoriserPartnerId": "Joe.Bloggs",
        "StepOneAltAuthoriserPartnerIds": ["Phil Jones","Bill Bailey"],
        "StepTwoAuthoriserPartnerId": "Joe.Joyce",
        "StepTwoAltAuthoriserPartnerIds": ["Phil Jones","Bill Bailey"]
    }
    

The PATCH verb can be used to create multiple user authorisation hierarchies. There is a limit of 500 users per call.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/authorisation

Example PATCH Request:

    PATCH
    [
        {
            "UserPartnerId": "John.Smith",
            "StepOneAuthoriserPartnerId": "Joe.Bloggs",
            "StepOneAltAuthoriserPartnerIds": ["Phil.Jones","Bill.Bailey"],
            "StepTwoAuthoriserPartnerId": "Joe.Joyce",
            "StepTwoAltAuthoriserPartnerIds": ["Phil.Jones","Bill.Bailey"]
        },
        {
            "UserPartnerId": "Phil.Jones",
            "StepOneAuthoriserPartnerId": "Joe.Bloggs",
            "StepOneAltAuthoriserPartnerIds": [],
            "StepTwoAuthoriserPartnerId": ,
            "StepTwoAltAuthoriserPartnerIds": []
        }

    ]

Roles

Please see the relevant lists for appropriate values for Role

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/roles

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Role": 1
        },
        {
            "Role": 2
        }
    ]

Example POST Request:

    POST
    {
        "Role": 3
    }

We also support a batch method to set roles for up to 500 users.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/bulkuserroles

Supported HTTP Methods: POST

Example POST Response:

    [
        {
            "PartnerId": "user-id-1",
            "Roles": [
                "role-id-1", 
                "role-id-2"
            ],
        },
        {
            "PartnerId": "user-id-2",
            "Roles": [
                "group-partner-id-1"
            ]
        }
    ]    

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/{partnerUserId}/roles/{roleId}

Supported HTTP Methods: DELETE

Auto authoriser setup

This endpoint can be used to add all users who have reportees to the authoriser role. This should be called after the authorisation has been added for each user.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/autosetupauthorisers

Supported HTTP Methods: GET

Recalculate authorisation hierarchy

This endpoint can be used to ensure that all changes to authorisation hierarchies have been updated in Edays and all pending requests are with the correct authoriser.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/users/recalculateauthorisationhierarchy

Supported HTTP Methods: GET

User Templates

User Templates are used within Edays as a way of applying features and settings to all Users within the template. It is then possible to override this at a User level if necessary.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates

Supported HTTP Methods: GET, POST

Example GET Response:

	[
		{
			"PartnerId": "default-template",
			"Id": "521c3811-38cc-e111-833b-00155d000918",
			"Name": "Default"
		},
		{
			"PartnerId": "home-workers",
			"Id": "d3247294-47d7-e611-93fc-72228baf5f68",
			"Name": "Home Workers"
		}
	]

Example POST Request:

	POST
	{
            "PartnerId": "Ove",
            "Name": "Overseas"
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}

Supported HTTP Methods: GET, PUT, DELETE

Example GET Response:

	{
		"PartnerId": "home-workers",
		"Id": "d3247294-47d7-e611-93fc-72228baf5f68",
		"Name": "Home Workers"
	}

Example PUT Request:

		PUT
		{
			"PartnerId": "part-time-home-workers",
			"Name": "Part Time Home Workers"
		}

Settings

Settings are inherited from the global level if null, and can be overridden at a user level. Please see the relevant lists for appropriate values for Language, Timezone, Date Format, Date Seperator, Reportee Descendant Levels, Override Time Unit, User Views and Custom User Views

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/settings

Supported HTTP Methods: GET, PUT

Example GET Response:

	{
		"Language": null,
		"Timezone": null,
		"DateFormat": null,
		"DateSeparator": null,
		"CalendarYearDay": 1,
		"CalendarYearMonth": 4,
		"HoursPerDay": 0,
		"AdminUserView": null,
		"AdminCustomUserView": null,
		"StaffRecordsUserView": null,
		"StaffRecordsCustomUserView": null,
		"CalendarUserView": null,
		"CalendarCustomUserView": null,
		"ReportingUserView": null,
		"ReportingCustomUserView": null,
		"ReporteesIncludesDescendants": null,
		"ReporteeDescendantLevels": null,
		"AllowManualDayCalculationByAuthoriser": null,
		"AllowManualDayCalculationByUser": null,
		"OpenAbsenceAlertEmail": null,
		"AllowUserToChangePassword": null,
		"AllowPlannedEntitlementTransfers": null,
		"AllowUnplannedEntitlementTransfers": null,
		"AllowOvertimeEntitlementTransfers": null,
		"OverrideDisplayTimeUnit": null,
		"HideTimesForDayBookings": null,
		"BradfordFactorAlias": null,
		"ShowBradfordFactorToManagers": null,
		"ShowBradfordFactorToUsers": null,
		"ShowBradfordFactorOccurenceDetail": null,
		"ShowBradfordFactorMeter": null,
		"BradfordFactorWarningLevel": null
	}

Example PUT Request:

	PUT
	{
		"Language": "en-gb",
		"Timezone": null,
		"DateFormat": 1,
		"DateSeparator": 2,
		"CalendarYearDay": 1,
		"CalendarYearMonth": 4,
		"HoursPerDay": 0,
		"AdminUserView": null,
		"AdminCustomUserView": null,
		"StaffRecordsUserView": null,
		"StaffRecordsCustomUserView": null,
		"CalendarUserView": null,
		"CalendarCustomUserView": null,
		"ReportingUserView": null,
		"ReportingCustomUserView": null,
		"ReporteesIncludesDescendants": null,
		"ReporteeDescendantLevels": null,
		"AllowManualDayCalculationByAuthoriser": null,
		"AllowManualDayCalculationByUser": null,
		"OpenAbsenceAlertEmail": null,
		"AllowUserToChangePassword": null,
		"AllowPlannedEntitlementTransfers": null,
		"AllowUnplannedEntitlementTransfers": null,
		"AllowOvertimeEntitlementTransfers": null,
		"OverrideDisplayTimeUnit": null,
		"HideTimesForDayBookings": null,
		"BradfordFactorAlias": null,
		"ShowBradfordFactorToManagers": null,
		"ShowBradfordFactorToUsers": null,
		"ShowBradfordFactorOccurenceDetail": null,
		"ShowBradfordFactorMeter": null,
		"BradfordFactorWarningLevel": null
	}

Email Notifications

Please see the relevant lists for appropriate values for Email Notification Type, Record Type Discriminator, Record Types, Record Status

Resource URL:

https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/emailnotifications

Supported HTTP Methods: GET, POST

Example GET Response:

	[
		{
			"Id": 1,
			"EmailNotificationType": 0,
			"EmailAddress": "test@e-days.co.uk",
			"RecordTypeDiscriminator": 2,
			"RecordTypes": [
				15
			],
			"RecordStatus": [
				4
			]
		}
	]

Example POST Request:

	POST
	{
		"EmailNotificationType": 0,
		"EmailAddress": "sicknessalerts@e-days.co.uk",
		"RecordTypeDiscriminator": 2,
		"RecordTypes": [
			15
		],
		"RecordStatus": [
			1, 2
		]
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/emailnotifications/{emailNotificationId}

Supported HTTP Methods: GET, PUT, DELETE

Example GET Response:

	{
		"EmailNotificationType": 0,
		"EmailAddress": "sicknessalerts@e-days.co.uk",
		"RecordTypeDiscriminator": 2,
		"RecordTypes": [
			15
		],
		"RecordStatus": [
			1, 2
		]
	}

Example PUT Request:

	{
		"EmailNotificationType": 0,
		"EmailAddress": "test@e-days.co.uk",
		"RecordTypeDiscriminator": 2,
		"RecordTypes": [
			15
		],
		"RecordStatus": [
			1, 2
		]
	}

Roles

Please see the relevant lists for appropriate values for Role

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/roles

Supported HTTP Methods: GET, POST

Example GET Response:

[
        {
            "Role": 1
        },
        {
            "Role": 2
        }
    ]

Example POST Request:

	POST
	{
		"Role": 3
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/roles/{roleId}

Supported HTTP Methods: DELETE

Rotas

Please see the relevant lists for appropriate values for Rota

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/rotas

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Rota": 1,
            "StartDate": "2020-10-24T00:00:00"
        }
    ]

Example POST Request:

    POST
    {
        "Rota": 2
    }

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/rotas/{rotaId}

Supported HTTP Methods: DELETE

Public Holidays

Please see the relevant lists for appropriate values for Public Holiday

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/publicholidays

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Pattern": 1
        }
    ]

Example POST Request:

    POST
    {
        "Pattern": 2
    }
                    

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/publicholidays/{patternId}

Supported HTTP Methods: DELETE

Custom Days

Please see the relevant lists for appropriate values for Custom Day

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/customdays

Supported HTTP Methods: GET, POST

Example GET Response:

    [
        {
            "Pattern": 3
        }
    ]

Example POST Request:

    POST
    {
        "Pattern": 4
    }

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/customdays/{patternId}

Supported HTTP Methods: DELETE

Absence Types

Please see the relevant lists for appropriate values for Record Type Discriminator

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/absencetypes

Supported HTTP Methods: GET

Example GET Response:

    [
        {
            "Id": 1,
            "Name": "Holiday",
            "RecordTypeDiscriminator": 1,
            "CanBookOwn": true,
            "CanBookReportees": true,
            "CanBookOthers": false,
            "CanViewInCalendarOwn": true,
            "CanViewInCalendarReportees": true,
            "CanViewInCalendarOthers": false,
        },
        {
            "Id": 2,
            "Name": "Sickness",
            "RecordTypeDiscriminator": 2,
            "CanBookOwn": false,
            "CanBookReportees": true,
            "CanBookOthers": false,
            "CanViewInCalendarOwn": true,
            "CanViewInCalendarReportees": true,
            "CanViewInCalendarOthers": false,
        }
    ]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/absencetypes/{absenceTypeId}

Supported HTTP Methods: GET, PUT

Example GET Response:

	{
		"Id": 2,
		"Name": "Sickness",
		"RecordTypeDiscriminator": 2,
		"CanBookOwn": false,
		"CanBookReportees": true,
		"CanBookOthers": false,
		"CanViewInCalendarOwn": true,
		"CanViewInCalendarReportees": true,
		"CanViewInCalendarOthers": false,
	}

Example PUT Request:

	PUT
	{
		"Name": "Sickness",
		"RecordTypeDiscriminator": 2,
		"CanBookOwn": true,
		"CanBookReportees": true,
		"CanBookOthers": false,
		"CanViewInCalendarOwn": true,
		"CanViewInCalendarReportees": true,
		"CanViewInCalendarOthers": false,
	}

Overtime Types

Please see the relevant lists for appropriate values for Record Type Discriminator

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/overtimetypes

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Overtime",
			"RecordTypeDiscriminator": 3,
			"CanBookOwn": true,
			"CanBookReportees": true,
			"CanBookOthers": true
		},
		{
			"Id": 2,
			"Name": "TOIL",
			"RecordTypeDiscriminator": 3,
			"CanBookOwn": true,
			"CanBookReportees": true,
			"CanBookOthers": true
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/overtimetypes/{overtimeTypeId}

Supported HTTP Methods: GET, PUT

Example GET Response:

	{
		"Id": 1,
		"Name": "Overtime",
		"RecordTypeDiscriminator": 3,
		"CanBookOwn": true,
		"CanBookReportees": true,
		"CanBookOthers": true
	}

Example PUT Request:

	PUT
	{
		"Name": "Overtime",
		"RecordTypeDiscriminator": 3,
		"CanBookOwn": true,
		"CanBookReportees": true,
		"CanBookOthers": false
	}

Entitlement Request Types

Please see the relevant lists for appropriate values for Record Type Discriminator

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/entitlementrequesttypes

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Buy Holiday",
			"RecordTypeDiscriminator": 10,
			"CanBookOwn": true,
			"CanBookReportees": true,
			"CanBookOthers": true
		},
		{
			"Id": 2,
			"Name": "Sell Holiday",
			"RecordTypeDiscriminator": 10,
			"CanBookOwn": true,
			"CanBookReportees": true,
			"CanBookOthers": true
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/entitlementrequesttypes/{entitlementRequestTypeId}

Supported HTTP Methods: GET, PUT

Example GET Response:

	{
		"Id": 1,
		"Name": "Buy Holiday",
		"RecordTypeDiscriminator": 10,
		"CanBookOwn": true,
		"CanBookReportees": true,
		"CanBookOthers": true
	}

Example PUT Request:

	PUT
	{
		"Name": "Buy Holiday",
		"RecordTypeDiscriminator": 10,
		"CanBookOwn": true,
		"CanBookReportees": false,
		"CanBookOthers": false
	}

Entitlements

Entitlements may be subdivided into Entitlement Elements

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/entitlements

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Annual Leave",
			"Enabled": true
		},
		{
			"Id": 2,
			"Name": "Sickness",
			"Enabled": true
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/entitlements/{entitlementId}

Supported HTTP Methods: PUT

Example PUT Request:

	PUT
	{
		"Name": "Sickness",
		"Enabled": false
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/entitlements/{entitlementId}/entitlementelements	

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Annual Entitlement",
			"Enabled": true
		},
		{
			"Id": 3,
			"Name": "Long Service Award",
			"Enabled": false
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usertemplates/{partnerUserTemplateId}/entitlements/{entitlementId}/entitlementelements/{elementId}

Supported HTTP Methods: PUT

Example PUT Request:

	PUT
	{
		"Name": "Long Service Award",
		"Enabled": true
	}

Groups

Groups are used within Edays as containers to organise users. Group items are held within Group Types

Group Types

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/grouptypes

Supported HTTP Methods: GET, POST

Example GET Response:

	[
		{
			"Id": 1,
			"GroupTypePartnerId": "cou",
			"Name": "Country",
			"Priority": 1,
			"RequiredField": false,
			"AllowMultipleSelections": false
		},
		{
			"Id": 2,
			"GroupTypePartnerId": "loc",
			"Name": "Location",
			"Priority": 2,
			"RequiredField": true,
			"AllowMultipleSelections": false
		},
		{
			"Id": 3,
			"GroupTypePartnerId": "tea",
			"Name": "Team",
			"Priority": 3,
			"RequiredField": false,
			"AllowMultipleSelections": false
		}
	]

Example POST Request:

	POST
	{
		"GroupTypePartnerId": "dep",
		"Name": "Department",
		"Priority": 4,
		"RequiredField": false,
		"AllowMultipleSelections": true
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/grouptypes/{groupTypePartnerId}

Supported HTTP Methods: GET, PUT, PATCH, DELETE

Example GET Response:

	{
		"GroupTypePartnerId": "cou",
		"Name": "Country",
		"Priority": 1,
		"RequiredField": false,
		"AllowMultipleSelections": false
	}

Example PUT Request:

		PUT
		{
			"GroupTypePartnerId": "loc",
			"Name": "Location",
			"Priority": 2,
			"RequiredField": true,
			"AllowMultipleSelections": true
		}

Records can be PATCHed by using the JSON Patch format, see jsonpatch.com for more details

Example PATCH Request:

    PATCH
    [
        { "op": "replace", "path": "/Name", "value": "New Location" },
    ]

Groups

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/grouptypes/{groupTypePartnerId}/groups

Supported HTTP Methods: GET, POST

Example GET Response:

	[
		{
			"Id": "521c3811-38cc-e111-833b-00155d000918",
			"GroupPartnerId": "eng",
			"Name": "England",
			"Priority": 0,
			"MinimumStaffingLevel": 0
		},
		{
			"Id": "24aa360b-63a2-e511-93f7-72228baf5f68",
			"GroupPartnerId": "ire",
			"Name": "Ireland",
			"Priority": 0,
			"MinimumStaffingLevel": 0
		},
		{
			"Id": "f3a9360b-63a2-e511-93f7-72228baf5f68",
			"GroupPartnerId": "sco",
			"Name": "Scotland",
			"Priority": 0,
			"MinimumStaffingLevel": 0
		}
	]

Example POST Request:

	POST
	{
		"GroupPartnerId": "wal",
		"Name": "Wales",
		"Priority": 0,
		"MinimumStaffingLevel": 0
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/grouptypes/{groupTypePartnerId}/groups/{groupPartnerId}

Supported HTTP Methods: GET, PUT, DELETE

Example GET Response:

	{
		"GroupPartnerId": "eng",
		"Name": "England",
		"Priority": 0,
		"MinimumStaffingLevel": 0
	}

Example PUT Request:

	PUT
	{
		"GroupPartnerId": "eng",
		"Name": "England",
		"Priority": 0,
		"MinimumStaffingLevel": 5
	}

User Group Membership

Allows access to the group membership for each user. Please be aware that the PUT and DELETE verbs will remove all existing user group membership information. This endpoint returns paged data, at 500 items per page. Paging information can be found in the response headers. The page can be specified in the request url. To access the groups of a specific user use the /users/groups endpoint

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/usergroups?page=x

Supported HTTP Methods: GET, POST, PUT, DELETE

Example GET Response:


    [
        {
            "PartnerId": "user-id-1",
            "Groups": [
                "group-partner-id-1", 
                "group-partner-id-2"
            ],
        },
        {
            "PartnerId": "user-id-2",
            "Groups": [
                "group-partner-id-11", 
                "group-partner-id-27", 
                "group-partner-id-33"
            ]
        }
    ]    

Paging response headers:

    edays-pagination-page: 2
    edays-pagination-page-size: 500
    edays-pagination-returned: 254
    edays-pagination-total: 754 
                

Example POST Request:

POST
[
    {
        "PartnerId": "user-id-1",
        "Groups": [
            "group-partner-id-1", 
            "group-partner-id-2"
        ],
    },
    {
        "PartnerId": "user-id-2",
        "Groups": [
            "group-partner-id-11", 
            "group-partner-id-27", 
            "group-partner-id-33"
        ]
    }
]   
                

Entitlements

Entitlements may be subdivided into Entitlement Elements. These settings govern the global level, this may be overridden at a User Template or User level

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/entitlements

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Annual Leave",
			"Enabled": true
		},
		{
			"Id": 2,
			"Name": "Sickness",
			"Enabled": true
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/entitlements/{entitlementId}

Supported HTTP Methods: PUT

Example GET Response:

	PUT
	{
		"Name": "Sickness",
		"Enabled": false
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/entitlements/{entitlementId}/userbalances

Supported HTTP Methods: GET

Note that this endpoint is restricted to 150 results. You may find entitlement for individual users here, or use paged results in our V3 API.

Example GET Response:

    [
        {
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "FirstName": "Dana",
            "LastName": "Barrett",
            "ValueInDays": 0,
            "ValueInHours": 0,
            "FormattedValue": "0  days"
        },
        {
            "UserId": "178f82c7-a181-e711-9406-72228baf5f68",
            "FirstName": "Robbie",
            "LastName": "Bank",
            "ValueInDays": 0,
            "ValueInHours": 0,
            "FormattedValue": "0:00 hours",
        }
    ]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/entitlements/{entitlementId}/entitlementelements

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Annual Entitlement",
			"Enabled": true
		},
		{
			"Id": 3,
			"Name": "Long Service Award",
			"Enabled": false
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/entitlements/{entitlementId}/entitlementelements/{entitlementElementId}

Supported HTTP Methods: PUT

Example GET Response:

	PUT
	{
		"Name": "Long Service Award",
		"Enabled": true
	}

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/entitlements/{entitlementId}/entitlementelements/{entitlementElementId}/userbalances

Supported HTTP Methods: GET

Note that this endpoint is restricted to 150 results. You may find entitlement for individual users here, or use paged results in our V3 API.

Example GET Response:

	[
		{
			"UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
			"FirstName": "Dana",
			"LastName": "Barrett",
			"ValueInDays": 0,
			"ValueInHours": 0,
			"FormattedValue": "0  days"
		},
		{
			"UserId": "178f82c7-a181-e711-9406-72228baf5f68",
			"FirstName": "Robbie",
			"LastName": "Bank",
			"ValueInDays": 0,
			"ValueInHours": 0,
			"FormattedValue": "0:00 hours"
		}
	]

Absence Types

Absences are categorised by Absence Types. Absence type settings are set here at a global level and can be overridden at a User Template or User level

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/absencetypes

Supported HTTP Methods: GET

Example GET Response:

	[
		{
			"Id": 1,
			"Name": "Holiday",
			"RecordTypeDiscriminator": 1,
			"CanBookOwn": true,
			"CanBookReportees": true,
			"CanBookOthers": false,
			"CanViewInCalendarOwn": true,
			"CanViewInCalendarReportees": true,
			"CanViewInCalendarOthers": false,
		},
		{
			"Id": 2,
			"Name": "Sickness",
			"RecordTypeDiscriminator": 2,
			"CanBookOwn": false,
			"CanBookReportees": true,
			"CanBookOthers": false,
			"CanViewInCalendarOwn": true,
			"CanViewInCalendarReportees": true,
			"CanViewInCalendarOthers": false,
		}
	]

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/absencetypes/{absenceTypeId}

Supported HTTP Methods: GET

Example GET Response:

	{
		"Id": 1,
		"Name": "Holiday",
		"RecordTypeDiscriminator": 1,
		"CanBookOwn": true,
		"CanBookReportees": true,
		"CanBookOthers": false,
		"CanViewInCalendarOwn": true,
		"CanViewInCalendarReportees": true,
		"CanViewInCalendarOthers": false,
	}

Absences

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/absences?recordtype=1&absencetype=1&datestart=20180301&dateend=20180320&page=1&pagesize=50

Supported HTTP Methods: GET (Supports paging)

Filters:

recordtype: The specific record types of the absences. The values for this filter can be found in the Record Type Discriminators endpoint under the "lists" section but for quick reference, planned absences = 1, unplanned = 2. If no type id is supplied, all types are returned

absencetype: The specific absence type id. The values for these ids can be found in the Absence Type endpoint. If no type id is supplied, all types are returned

datestart: The start of a date range to filter the results by. Must be supplied in the format "YYYYMMDD"

dateend: The end of a date range to filter the results by. Must be supplied in the format "YYYYMMDD"

page: The page number of the response. This number starts at and defaults to 1

pagesize: The number of records per page. This number defaults to 50

userId: Filter records to those for the userId provided

dateCreated: Filter out records created before the dateCreated

dateModified: Filter out records modified before the dateModified

groupId:Records where the records user is in a group that matches the groupId provided. The groupId can be used to filterby location since groups represent locations as well as other types such as team etc

Example GET Response:


    [
        {
            "Id": "EEBDC36D-C744-42A8-99BE-001A2F2A24DE",
            "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
            "FirstName": "Dana",
            "LastName": "Barret",
            "PayrollNumber": "P123",
            "EmployeeNumber": "E123",
            "AbsenceTypeId": 1,
            "Status": "Pending",
            "StartTime": "2017-04-13 09:00",
            "EndTime": "2017-04-13 17:30",
            "DurationInDays": 1,
            "DurationInMinutes": 480,
            "DateCreated": "2017-04-12 09:00",
            "DateModified": "2017-05-12 09:00",
            "IsOpen": false,
            "BookedInTimeUnit": "Days"
        }
    ]
                

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/absences

Supported HTTP Methods: POST

Example POST Request:


	
	{
		"UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
		"AbsenceTypeId": 1,
		"Details": "Holiday in Paris"
		"Status": "Pending",
		"StartTime": "2017-04-13 09:00",
		"EndTime": "2017-04-13 17:30",
		"IsOpen": false
	}
	

Managing Absences

You can use the API to update the properties, such as start/end times, absence type, status of an existing absence record or delete a specified absence record in the Edays application.

Resource URL:

	https://your-system.e-days.co.uk/api/v2/absences/{AbsenceId}

Supported HTTP Methods: GET, PUT, DELETE

Example GET Response:


    {
        "Id": "EEBDC36D-C744-42A8-99BE-001A2F2A24DE",
        "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
        "FirstName": "Dana",
        "LastName": "Barret",
        "PayrollNumber": "P123",
        "EmployeeNumber": "E123",
        "AbsenceTypeId": 1,
        "Status": "Pending",
        "StartTime": "2017-04-13 09:00",
        "EndTime": "2017-04-13 17:30",
        "DurationInDays": 1,
        "DurationInMinutes": 480,
        "DateCreated": "2017-04-12 09:00",
        "DateModified": "2017-05-12 09:00",
        "IsOpen": false,
        "BookedInTimeUnit": "Days"
    }


Example PUT Request:

    PUT	
    {
        "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
        "AbsenceTypeId": 1,
        "Details": "Holiday in Paris"
        "Status": "Pending",
        "StartTime": "2017-04-13 09:00",
        "EndTime": "2017-04-13 17:30",
        "IsOpen": false
    }

Note that if you wish to book an absence where the absence type is recorded in days, and your user has a days-based rota pattern, you should use midnight to midnight. For example, the following request lasts two full days:

    PUT	
    {
        "UserId": "8fec44e8-f7c6-4d78-9ce6-c63cb3395042",
        "AbsenceTypeId": 1,
        "Details": "2 days off"
        "Status": "Pending",
        "StartTime": "2017-04-13 00:00",
        "EndTime": "2017-04-15 00:00",
        "IsOpen": false
    }

SSO Certificates

Your public certificates to be used during the sso process can be managed using this endpoint. A certificate object consists of a name and the certificate's content serialised as a Base64 encoded string. When settings up single sign-on you should create your certificates first using this endpoint and then refer to the certificates in your SSO configuration, which is detailed below.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/sso/certificates

Supported HTTP Methods: GET, POST

Example GET Response:

    [
		{
			"Name": "Company1SigningCert2018",
			"Value": "MDphc3NlcnRpb24iPmh0dHA6Ly9mZWQtc3J2....",
		},
		{
			"Name": "Company1SigningCert2019",
			"Value": "nNmb3Jtcz48ZHM6VHJhbnNmb3JtIEFsZ....",
		}
    ]

	

Example POST Request:

	POST
	
		{
			"Name": "Company1SigningCert2018",
			"Value": "MDphc3NlcnRpb24iPmh0dHA6Ly9mZWQtc3J2....",
    	}
	

Resource URL:

	https://your-system.e-days.co.uk/api/v2/sso/certificates/{certificateName}

Supported HTTP Methods: DELETE


SSO IDP Configuration

Your sso identity provider configuration can be managed using this endpoint.

Resource URL:

	https://your-system.e-days.co.uk/api/v2/sso/idpconfig

Supported HTTP Methods: GET, PUT

Object parameters

EntityId: This parameter identities your application

SsoServiceUrl: This is the url to the identity provider service that Edays should direct authentication requests to.

SigningCertificateName: The name of the public certificate to use during signing of the authenticatino response. These certificates can be managed using the certificates endpoint.

Authority: This optional parameter identities the type of identity provider you are using e.g ADFS, Google, Facebook. If you are using a custom IDP this can be left blank.

Enabled: Can be used to enable/disable the sso process.

Example GET Response:


		{
			"EntityId": "Company1",
			"SsoServiceUrl": "https://adfs.company.local/adfs/ls/",
			"SigningCertificateName": "Company1SigningCert",
			"Authority": "ADFS",
			"Enabled": false,
		}
	

Example PUT Request:

    PUT
	
    {
        "EntityId": "Company1",
        "SsoServiceUrl": "https://adfs.company.local/adfs/ls/",
        "SigningCertificateName": "Company1SigningCert",
        "Authority": "ADFS",
        "Enabled": false,
    }
	

Lists

Languages

Languages Edays supports, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/languages

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": "en-gb",
			"Text": "English"
		},
		{
			"Value": "es-es",
			"Text": "Español"
		}
	]

Time zones

Time zones Edays supports, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/timezones

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": "UTC",
			"Text": "(GMT) Coordinated Universal Time"
		},
		{
			"Value": "Morocco Standard Time",
			"Text": "(GMT+00:00) Casablanca"
		},
		{
			"Value": "GMT Standard Time",
			"Text": "(GMT+00:00) Dublin, Edinburgh, Lisbon, London"
		}
	]

Time Units

Resource URL:

	https://your-system.e-days.co.uk/api/v2/lists/timeunits

Supported HTTP Methods: GET

Example Response:

    [
        {
            "Key": 0,
            "Value": "Days"
        },
        {
            "Key": 1,
            "Value": "Minutes"
        },
        {
            "Key": 2,
            "Value": "Hours"
        },
        {
            "Key": -1,
            "Value": "Inherited"
        }
    ]

Booking Periods

Entitlement totals correspond to specific booking periods, this endpoint lists the underlying values of these

Resource URL:

	https://your-system.e-days.co.uk/api/v2/lists/bookingperiods

Supported HTTP Methods: GET

Example Response:

    [
        {
            "Key": 0,
            "Value": "Any"
        },
        {
            "Key": 1,
            "Value": "LastTwelveMonths"
        },
        {
            "Key": 2,
            "Value": "Current"
        },
        {
            "Key": 3,
            "Value": "MinusOne"
        },
        {
            "Key": 4,
            "Value": "MinusTwo"
        },
        {
            "Key": 5,
            "Value": "MinusThree"
        },
        {
            "Key": 6,
            "Value": "PlusOne"
        },
        {
            "Key": 7,
            "Value": "PlusTwo"
        },
        {
            "Key": 8,
            "Value": "PlusThree"
        },
        {
            "Key": 9,
            "Value": "OutOfRange"
        }
    ]

Date Formats

Date Formats Edays supports, the Value is supplied for Users and User Templates

Resource URL:

	https://your-system.e-days.co.uk/api/v2/lists/dateformats

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "Day - Month - Year"
		},
		{
			"Value": 1,
			"Text": "Month - Day - Year"
		},
		{
			"Value": 2,
			"Text": "Year - Month - Day"
		}
	]

Date Separators

Date Separators Edays supports, the Value is supplied for Users and User Templates

Resource URL:

	https://your-system.e-days.co.uk/api/v2/lists/dateseparators

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "Dot (.)"
		},
		{
			"Value": 1,
			"Text": "Dash (-)"
		},
		{
			"Value": 2,
			"Text": "Slash (/)"
		}
	]

Reportee Grandfathering Levels

Governs the number of levels to include within reportee grandfathering, the Value is supplied for Users and User Templates

Resource URL:

	https://your-system.e-days.co.uk/api/v2/lists/reporteegrandfatheringlevels

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "Don't Override"
		},
		{
			"Value": 1,
			"Text": "days"
		},
		{
			"Value": 2,
			"Text": "Hours"
		}
	]

User View Options

User View Options Edays supports, the Value is supplied for Users and User Templates

Resource URL:

	https://your-system.e-days.co.uk/api/v2/lists/userviewoptions

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "MyRecord"
		},
		{
			"Value": 1,
			"Text": "Reportees"
		},
		{
			"Value": 2,
			"Text": "Everyone"
		},
		{
			"Value": 3,
			"Text": "Custom"
		},
		{
			"Value": 4,
			"Text": "DirectReportees"
		}
	]

Custom User Views

The Custom User Views held in the system, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/customuserviews

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "England"
		},
		{
			"Value": 2,
			"Text": "My Own Country"
		}
	]

Additional Email Notification Types

Additional Email Notification Types Edays supports, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/additionalemailnotificationtype

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "AuthorisableRecord"
		},
		{
			"Value": 1,
			"Text": "PasswordChange"
		},
		{
			"Value": 2,
			"Text": "DetailsChange"
		}
	]

Record Type Discriminators

Record Type Discriminators Edays supports, the Value is supplied for Absences and Absence Types

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/recordtypediscriminators

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "Planned"
		},
		{
			"Value": 2,
			"Text": "Unplanned"
		}
	]

Record Types

Record Types Edays held in the system, the Value is supplied for Absences and Absence Types

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/recordtypes

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "Holiday",
			"RecordTypeDiscriminator": 1
		},
		{
			"Value": 2,
			"Text": "Sickness",
			"RecordTypeDiscriminator": 2
		}
	]

Record Status

Record Status Edays supports, the Value is supplied for Absences and Absence Types

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/recordstatus

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "Pending"
		},
		{
			"Value": 2,
			"Text": "Approved"
		},
		{
			"Value": 3,
			"Text": "Rejected"
		},
		{
			"Value": 4,
			"Text": "CancellationPending"
		},
		{
			"Value": 5,
			"Text": "Cancelled"
		},
		{
			"Value": 6,
			"Text": "Taken"
		},
		{
			"Value": 7,
			"Text": "CancellationRejected"
		}
	]

Roles

Roles held in the system, the Value is supplied for Users

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/roles

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "Standard User"
		},
		{
			"Value": 2,
			"Text": "Standard Authoriser"
		},
		{
			"Value": 3,
			"Text": "Standard Administrator"
		}
	]

Rotas

Rotas held in the system, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/rotas

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "Mon/Tue/Wed/Thur/Fri"
		}
	]

Public Holidays

Public Holidays held in the system, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/publicholidays

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "UK Public Holidays"
		}
	]

Custom Days

Custom Days held in the system, the Value is supplied for Users and User Templates

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/customdays

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 1,
			"Text": "Christmas Shutdown"
		}
	]

Cancel Future Records Options

When marking a user as a leaver, a Cancel Future Records option is supplied, allowing none, pending or all future records to be cancelled

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/cancelfuturerecords

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "None"
		},
        {
			"Value": 1,
			"Text": "CancelPending"
		},
        {
			"Value": 2,
			"Text": "CancelAll"
		}
	]

Leaver Lock Options

When marking a user as a leaver, a Leaver Lock option is supplied. When setting a left date in the future, you can select for the account to be locked now, or when the left date is reached

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/leaverlockoptions

Supported HTTP Methods: GET

Example Response:

	[
		{
			"Value": 0,
			"Text": "LockNow"
		},
        {
			"Value": 1,
			"Text": "LockUponReachingLeftDate"
		}
	]

Rounding Policies

When updating a user's FTE, the rounding policy will be used to calculate the new, pro-rated entitlement balance.

Resource URL:

	https://YOUR-SYSTEM.e-days.co.uk/api/v2/lists/roundingpolicies

Supported HTTP Methods: GET

Example Response:

        [
            {
                "Value": 0,
                "Text": "None"
            },
            {
                "Value": 1,
                "Text": "OneDecimalPlace"
            },
            {
                "Value": 2,
                "Text": "TwoDecimalPlaces"
            },
            {
                "Value": 3,
                "Text": "FourDecimalPlaces"
            },
            {
                "Value": 4,
                "Text": "UpToNearestHalf"
            },
            {
                "Value": 5,
                "Text": "UpToNearestWhole"
            },
            {
                "Value": 6,
                "Text": "DownToNearestHalf"
            },
            {
                "Value": 7,
                "Text": "DownToNearestWhole"
            },
            {
                "Value": 8,
                "Text": "AwayFromZero"
            },
            {
                "Value": 9,
                "Text": "TowardsZero"
            },
            {
                "Value": 10,
                "Text": "NearestHalf"
            }
        ]