Download the PHP package celpax/dailypulse without Composer
On this page you can find all versions of the php package celpax/dailypulse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package dailypulse
DailyPulse Client API
This is the Celpax's PHP DailyPulse Client API. Note that:
It matches pretty much the NodeJS API Client.
API Client Architecture
- The client connects to the server using JSON/REST web services.
- All requests run over HTTPS and the URI is signed with a timestamped cryptographic token implemented using HMAC-SHA512.
- The client uses internally Guzzle to send the REST requests and parse the received JSON.
- A Response object encapsulates the downloaded JSON, HTTP Status and exception information from either client or server side.
Installation
The PHP DailyPulse client is distributed as a composer package.
You can either include the a dependency in your composer.json
file or use composer to download the code to your project.
To install the package to your project do
That will download the package and all the dependencies in to the vendor directory. Remember to:
If you also use composer, you just need to add the dependency to your composer.json
as
Check the Composer Package Manager for additional information.
Instanciate the client
In order to instanciate the dailypulse client and start making request you need to do:
You can download your access and secret api keys from DailyPulse dashboard.
Get your sites
DailyPulse can be deployed on one or more company sites. In either case you will need to know the Site ID before you can download metrics related to it.
You can get your sites as follows:
Mood KPI
You can retrieve the latest calculated Mood KPI for a give site as follows:
Note that in some cases the Mood KPI cannot be calculated (for example during rollout) and will be returned as null. A date member will also be included indicating when the Mood KPI was last updated.
Alternatively, you can retrieve the latest calculated global Mood KPI of all the sites of the account as follows:
Historical Mood KPI
You can retrieve the historical calculated Mood KPI for a given site and the number of days to fetch since today as follows:
The maximum number of allowed days to be fetched can be configured in the Celpax Dashboard console. You need administrator privileges for accessing to the configuration section.
Alternatively you can retrieve the historical calculated global mood KPI of all the sites of the account as follows:
Pulses in a Typical Day
Dailypulse will track how many pulses are registered in a typical day. DailyPulse will detect and exclude from this statist days such as weekends in which a couple of people turn up to work, or company parties when there might be an unusual number of pulses.
Again, pulses per typical day might not be calculated for a given site yet, in which case null can be returned.
You can get it in a similar way by doing:
A date member will also be returned indicating when the pulses per typical day was last updated.
Alternatively, you can retrieve the global pulses in a typical day of all the sites of the account as follows:
Historical Pulses in a Typical Day
You can retrieve the historical Pulses in a Typical day for a given site and the number of days to fetch since today as follows:
The maximum number of allowed days to be fetched can be configured in the Celpax Dashboard console. You need administrator privileges for accessing to the configuration section.
Alternatively, you can retrieve the historical global pulses per typical day of all the sites of the account as follows:
User Interface Design
We have released user interface elements, such as: colours, fonts, widgets available in the github project: DailyPulse-Resources
The resources provided match the User Interface of the DailyPulse Dashboard.
Testing
An echo test method has also been include so that you can test your setup as much as you want before pulling real data.
You can use it as follows, for example in one of your unit tests:
Additional information
The tests run through all the API calls available, check them.