Leave HTTP synchronization

This article deals with the HTTP synchronization which is the generic synchronization solution offers by Figgo webservice.

The HTTP synchronization allows you to send leave information to an external software in case we do not provide a dedicated connector (see available connectors).

 

The message will be sent like below :

  • Verb: POST
  • URl:
    • URL provided by you
  • Header:
    • Authorization
    • X-Version
    • X-Resource-Type
    • X-Event
  • Body:
    • the payload

Synchronized event 

You can decide which events you want to synchronize :

  • all events (pending approval leave, approved leave, deleted leave)
  • approved leave only

 

Header

The header contains the following fields :

Authorization, which is the authorization key you need to provide

Exemple : Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l

X-Version : payload format version (provides by Figgo)

X-Resource-Type : object type (leave is the only object currently available)

X-Event : event type (created, approved, deleted

URL

You need to provide the URL to be called when an event occurs.

Payload

Leave are sent by half days, named leaves.

For a 2 days leave, the payload contains 4 leaves.

Payload example :

{
    "id": "78287-20180424-PM",
    "date": "2018-04-24",
    "isAm": false,
    "owner": {
        "id": 134,
        "name": "Luca Pacioli",
        "email": "luca.paccioli@lucca.fr",
        "employeeNumber": "00001"
    },
    "leaveAccount": {
        "id": 1718,
        "name": "Congés payés 2018",
        "categoryId": 1,
        "categoryName": "Congés payés"
    },
    "isConfirmed": true,
    "confirmationDate": "2018-04-04T22:34:47.797",
    "isCancelled": true,
    "cancellationDate": "2018-04-08T12:05:34.543"
}

Payload value details : 

  • id : unique identifier of the leave

  • date : leave date

  • isAM : half day (AM: true, PM: false)

  • leaveAccount :

    • id : Figgo leave account ID
    • name : Account name
    • categoryId : Account category ID
    • categoryName : Account category name
  • durationInHours : leave duration if the account is in hours (ex: "03:45:00")

  • isConfirmed : approval state of the leave
  • creationDate : creation date

  • isCancelled : cancellation state of the leave
  • cancellationDate : cancellation date

Life cycle of a leave

The following illustration give the status of a leave according to the actions performed in Figgo.

Figgo_Events_-_SYNC_2_.jpg

User interface

Sent events can be followed from the webervice interface in Figgo.

For each event, you can see the message details, force the synchro manually in case of error, or flag the event as "treated".

Failures are displaid in the admin "to do list" dashboard, if the admin has the right to see the webservcie interface.

 

Retry policy

In case of failure, the event is sent in a queue to be retried. First try after 5min, next one after 15min, then 1 hours and then 24h.

Page content

Was this article helpful?
0 out of 0 found this helpful