Api doc


SDK's


Api Modules

Sample Workflow

To help you better understand how our API works we've provided a brief example of a 'real world' workflow of making calls to various modules of the Humanity API

The API URL is located at https://www.humanity.com/api/

App Setup

First we'll make a request to the API to read in the initial config details that we'll use in other parts of the app for forms, display, etc. This will also very quickly confirm that the API is online, and our key, and request method is valid.

  1. {
  2. "key": "YOUR_API_KEY",
  3. "request": {
  4. "module": "api.config"
  5. }
  6. }

In the above call we're passing very little information to the API because we're relying on the default output format(json) as well as the default method(GET).


Authentication

We'll make a request to the API to authenticate the current user. We'll swap the key, username and password for an authentication token to be used on subsequent calls.

  1. {
  2. "key": "YOUR_API_KEY",
  3. "request": {
  4. "module": "staff.login",
  5. "method": "GET",
  6. "username": "ryan@humanity.com",
  7. "password": "nicetry"
  8. }
  9. }

Assuming succesful login our response will look like this: (See Authentication for full details)

  1. {
  2. "success": "1",
  3. "data": {
  4. "employee": {
  5. "name": "Ryan Fyfe",
  6. "email": "ryan@humanity.com",
  7. "etc": "..."
  8. },
  9. "business": {
  10. "name": "Humanity Inc.",
  11. "etc": "..."
  12. }
  13. },
  14. "token": "xxxxxxx"
  15. }

Now that we have authentication all future calls to the API just require this token which holds all of the other information in it.


Schedule

To load an individual Employee's upcoming schedule we would use the schedules.shifts module like this:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "module": "schedule.shift",
  5. "mode": "employee"
  6. }
  7. }

To fetch the details for any particular shift:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "module": "schedule.shift",
  5. "id": "1(id of shift)"
  6. }
  7. }

To update the details on a shift:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "module": "schedule.shift",
  5. "id": "1(id of shift)",
  6. "method": "UPDATE",
  7. "notes": "New Shift Notes"
  8. }
  9. }

To add an employee to a shift shift:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "module": "schedule.shift",
  5. "method": "UPDATE",
  6. "add": "1(id of employee)"
  7. }
  8. }

To create a new shift:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "module": "schedule.shift",
  5. "method": "CREATE",
  6. "start": "1(id of start time)",
  7. "end": "49(id of end time)",
  8. "start_date": "date",
  9. "end_date": "date",
  10. "schedule": "1(id of schedule)"
  11. }
  12. }

Message Wall

Let's say we want to display the message wall for the currently logged in employee's business:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "module": "messaging.wall",
  5. "mode": "employee"
  6. }
  7. }

Now to leave a new post on the message wall requires a few more details:

  1. {
  2. "token": "xxxxxxx",
  3. "request": {
  4. "method": "CREATE",
  5. "module": "messaging.wall",
  6. "title": "New post for the message wall",
  7. "post": "This is a new post that will be added to the message wall."
  8. }
  9. }

GET STARTED NOW

Free Trial. No Credit Card Required.

close
(e.g.+14158675309 or +1415-8675-309)

By clicking "Create my ShiftPlanning Account" you agree to the Terms of Service and Privacy Policy.

Have a promotional code?Click Here


LIVE CHAT DEMO REQUEST!

Please provide information below.

close
INSTANT DEMOSCHEDULED DEMO
Connect with a ShiftPlanning Team Member for a live demo right now!
 

RESELLER REQUEST!

Please provide information below.

close