Skip to content
Allash edited this page Jan 5, 2016 · 8 revisions

##Get all absences

GET publicApi/users/absent/2015-01-01/2016-01-01?apiKey=<apiKey here>

Returns an array of absences associated with your company.

[
  {
    "_id": "548ec921f9fddaf8055f8048",
    "name": "Max Mustermann",
    "firstName": "Max",
    "lastName": "Mustermann",
    "email": "max.mustermann@company.com",
    "avatar": "4f5e2bc7-a665-484a-8675-7ett6a0bfb5b",
    "absences": [
       {
            "start": "2014-12-15T00:00:00.000Z",
            "end": "2015-01-04T12:00:00.000Z",
            "status": 2
       },
       {
            "start": "2015-01-26T00:00:00.000Z",
            "end": "2015-01-27T00:00:00.000Z",
            "status": 2
       },
     ]
  },
  {
    "_id": "548ec921f9fddaf8055f8049",
    ...
  },
  ...
]

####Absences can be filtered by the following parameters:

parameter type default

####You can expect to get the following response:

parameter type default
_id string
name string
firstName string
lastName string
email string
avatar string
absences array

##absences array

parameter type comment
start date
end date
status int 1 = open request, 2 = approved

Get User's Absences By Email

POST publicApi/user/absences/2015-01-01/2015-10-01?apiKey=<apiKey here>

Body : { email : email@mail.com }

Returns an array of absences associated with user.

[
  {
    "_id": "54a6a32f68503d020097e828",
    "start": "2015-01-07T00:00:00.000Z",
    "end": "2015-01-08T00:00:00.000Z",
    "assignedTo": {
      "_id": "000000000000000000000003",
      "name": "Aleksander Penne",
      "email": "aleksander.penne@absence.io",
      "avatar": "d70d0139-8bb7-460d-9733-6e9c9228eb8e"
    },
    "confirmedBy": {},
    "reason": {
      "_id": "5363f7ce1f9599cf03f9877d",
      "__v": 0,
      "color": "000000000000500000000000",
      "company": "100000000000000000000000",
      "name": "Vacation",
      "allowanceType": "5567487e8e3c265c4a601476",
      "allowanceEntries": [],
      "isPublic": false,
      "emailList": [
        "nrohany@mantro.net"
      ],
      "deleted": false,
      "reducesDays": true,
      "requiresApproval": true
    },
    "commentary": "",
    "daysCount": 1,
    "deleteRequest": false,
    "startType": "PM",
    "endType": "AM"
  },
  {
    "_id": "548ec921f9fddaf8055f8049",
    ...
  },
  ...
]

####You can expect to get the following response:

parameter type default
_id string
start date
end date
reason object
daysCount int
assignedTo object
commentary string
confirmedBy array
startType string
endType string

reason object

parameter type comment
_id string
color string
company string
name string
allowanceType string
allowanceEntries array
isPublic bool
emailList array ["someemail@mail.com"]
deleted bool
reducesDays bool
requiresApproval bool

assignedTo object

parameter type comment
_id string
name string
email string
avatar string