7Shifts API: Integration Guide, Key Features, and Best Practices
Published on:
October 12, 2024

What is 7shifts?

7shifts is a specialized restaurant scheduling software designed to streamline operations for restaurant managers and staff. It offers a range of features that facilitate efficient scheduling, communication, and labor management.

In this guide, we’ll explore how to integrate 7shifts API into your applications, look at common use cases, and offer best practices for troubleshooting API issues. Whether you’re a developer, HR-tech professional, or part of a team evaluating 7shifts, this blog aims to help you leverage the API effectively.

Note - This is an educational article on 7shifts API. If you’re looking for an easier way to launch integrations with 7shifts, check out Bindbee.

Our Unified API connects you to 50+ HRIS, ATS and Payroll Platforms in minutes. Zero maintenance, no-code Integrations that lets you launch at one-tenth the cost of custom Integrations.

That said, Here’s what we’ll cover in this article:

  • A step-by-step 7shifts API integration guide using Direct API and other key methodologies.
  • An overview of the API’s capabilities and key features.
  • Best practices and troubleshooting tips for easier API operations.

What is 7shifts API?

7shifts API is a RESTful API that allows developers to integrate and interact with the 7shifts platform. Here’s an overview of the API's features, authentication methods and available endpoints for integration.

Key Features of 7shifts API

1. Architecture

  • RESTful Design: The 7shifts API follows REST principles, making it easy to interact with resources using standard HTTP methods (GET, POST, PUT, DELETE).
  • JSON Format: Data is exchanged in JSON format, which is lightweight and easy to work with in most programming environments.

2. Authentication

  • OAuth2 Protocol: The API uses OAuth2 for secure authentication. Developers must obtain a Client ID and Client Secret to authenticate their applications.
  • Access Tokens: After obtaining the access token via OAuth2, it can be used to make authorized requests to the API endpoints.

3. Endpoints

The API provides various endpoints for managing different aspects of restaurant operations:

  • Employee Management:
    • GET /employees: Retrieve a list of employees.
    • POST /employees: Add a new employee.
    • PUT /employees/{id}: Update employee details.
  • Scheduling:
    • GET /schedules: Fetch current schedules.
    • POST /schedules: Create a new schedule.
    • DELETE /schedules/{id}: Remove an existing schedule.
  • Time-Off Requests:
    • GET /time-off: View time-off requests.
    • POST /time-off: Submit a new time-off request.
  • Shift Management:
    • GET /shifts: Retrieve shift details.
    • POST /shifts: Create new shifts or modify existing ones.

4. Webhooks

  • Real-Time Updates: The API supports webhooks that notify your application about changes in data (e.g., shift swaps, employee updates), allowing for real-time synchronization with your system.

7Shifts API - Integration Guide

We’ll walk through three methodologies to integrate with 7Shifts API

1. Direct API Integration

Step 1: Obtain API Credentials

  • Create a Developer Account: Sign up for a developer account via the 7shifts Developer Portal.
  • Get API Keys: After your account is approved, retrieve your Client ID and Client Secret from the developer portal. These credentials are essential for OAuth2 authentication.

Step 2: Authentication

  • OAuth2 Protocol: The 7shifts API uses OAuth2 to authenticate requests. Follow these steps:
    1. User Redirection: Redirect users to the 7shifts authorization URL for granting access.
    2. Authorization Code: Upon user consent, your application will receive an authorization code.
    3. Token Exchange: Exchange the authorization code for an access token:
POST <https://api.7shifts.com/oauth/token>
Content-Type: application/json

{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "code": "AUTHORIZATION_CODE",
  "grant_type": "authorization_code"
}

Step 3: Explore API Endpoints

Familiarize yourself with core API endpoints to integrate key features into your application. Here’s a table of the primary endpoints:

Step 4: Make API Requests

After obtaining your access token, use tools like Postman or cURL to test API requests. Here’s an example using cURL:

curl -X GET "<https://api.7shifts.com/v1/employees>" \\
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Step 5: Implement Error Handling

Always handle error responses based on HTTP status codes:

  • 401 Unauthorized: Ensure your access token is valid.
  • 404 Not Found: Check that the requested resource exists.
  • 429 Too Many Requests: Implement rate limiting to handle API limits.

Step 6: Set Up Webhooks (Optional)

To stay updated in real-time, set up webhooks for events like shift swaps or time-off approvals:

  1. Register Webhooks: Register your webhook URL via the 7shifts API.
  2. Subscribe to Events: Subscribe to events such as employee updates, schedule changes, etc.

2. POS System Integration

Overview - By integrating your POS (Point-of-Sale) system with 7shifts, you can sync sales data with labor management tools for better forecasting and shift planning.

Step 1: Verify Compatibility

Ensure that your POS system supports integration with 7shifts by checking the 7shifts POS Integration Documentation.

Step 2: Connect Your POS System

  • Access Integration Settings: In your POS dashboard, find the 7shifts integration option.
  • Authorize Connection: Follow the prompts to authorize the connection between your POS system and 7shifts.

Step 3: Sync Sales Data

Configure your POS system to send sales data to 7shifts. This will allow 7shifts to use the sales data for labor forecasting. Typical configuration steps include:

  • Mapping Locations: Ensure that locations in your POS system are correctly mapped to those in 7shifts.
  • User Role Mapping: Map user roles and permissions across both systems.

Step 4: Test the Integration

Once connected, test the integration by:

  • Checking Data Sync: Ensure that sales data from your POS is correctly reflected in 7shifts.
  • Verifying Labor Forecasts: Review labor cost forecasts in 7shifts to ensure accurate integration.

3. Mobile App Integration

Overview -Mobile app integration enhances how employees interact with their schedules, allowing them to manage shifts, request time off, and communicate directly through their mobile devices.

Step 1: Leverage Mobile SDKs

If available, utilize mobile SDKs provided by 7shifts (e.g., for iOS or Android). Check the 7shifts Developer Portal for SDK availability.

Step 2: Implement Core Features

Allow employees to:

  • View Schedules: Enable real-time schedule viewing.
  • Request Time Off: Let employees submit time-off requests directly from the app.
  • Swap Shifts: Provide functionality for shift swapping between employees.

Here’s an example of fetching employee schedules in a mobile app using JavaScript:

fetch('<https://api.7shifts.com/v1/schedules>', {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${YOUR_ACCESS_TOKEN}`
    }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Step 3: Enable Notifications

Use push notifications to inform employees about schedule updates, new shift availability, or time-off approvals. This keeps everyone informed in real-time.

Step 4: Test Mobile Functionality

Ensure a smooth user experience by:

  • Testing on Multiple Devices: Test the app on various mobile devices (iOS and Android) to ensure compatibility.
  • Verifying Push Notifications: Make sure push notifications work correctly for schedule changes or urgent updates.

Method 4: Integrating with 7shifts Using Bindbee

Overview - Bindbee is a unified API platform that lets you integrate with 7shifts (and 50+ HRIS, ATS & Payroll Platforms) in just a few minutes. No-code, zero-maintenance integrations that offers round-the-clock data sync at one-tenth the cost of custom Integrations. Check out Bindbee today!

Setting up 7shifts Integration with Bindbee

  • Create a Connector:
    • Click on Create Connector from the dashboard.
    • Select HRIS as the type of integration. Enter customer details and give your connector a unique ID (e.g., 7shifts_Integration).
  • Generate a Magic Link:
    • After setting up the connector, click Create Link to generate a magic link. This will allow the customer to authenticate the connection with 7shifts API.
    • Open the link and enter the necessary credentials (e.g., 7shifts key, subdomain). This step establishes the connection between the platform and Bindbee.
  • Sync the Connector:
    • Once the connection is made, the connector will begin syncing data from 7shifts. This may take a few minutes depending on the size of the data. You can track the sync status in the connector section.
  • Access the Synced Data:
    • After syncing, go to the Employee section in the Bindbee dashboard and select Get Employees to retrieve employee data.
  • Get the API Key and Connector Token:
    • Copy the API key and the x-connector-token from the Bindbee dashboard, which you will need to make authenticated API requests.

Retrieving Employee Data with Bindbee

Once the data has been synced, you can retrieve employee data on to your application via the Bindbee API.

Here’s a step-by-step process for accessing synced data from Zenefits through Bindbee’s unified API:

  1. Request Setup:
    • Use the Bindbee API to send a request for employee data. You’ll need both your Bindbee API token and the x-connector-token.
  2. Example Request:
    • Using Python:

import requests

url = "https://api.bindbee.com/hris/v1/employees"
headers = {
    "Authorization": "Bearer YOUR_BINDBEE_API_KEY",
    "x-connector-token": "YOUR_CONNECTOR_TOKEN",
    "Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())

  • Using cURL:

curl --request GET \
  --url https://api.bindbee.com/hris/v1/employees \
  --header 'Authorization: Bearer YOUR_BINDBEE_API_KEY' \
  --header 'x-connector-token: YOUR_CONNECTOR_TOKEN'

This request will return a list of employee objects, including details like the employee’s first name, last name, job title, department, and contact information.

Sample Response:

{
  "items": [
    {
      "id": "018b18ef-c487-703c-afd9-0ca478ccd9d6",
      "first_name": "John",
      "last_name": "Doe",
      "job_title": "Chief Technology Officer",
      "department": "Engineering",
      "work_email": "john@johndoe.dev"
    }
  ]
}

Bulk Employee Data Retrieval

For retrieving large datasets, Bindbee simplifies the process by allowing you to fetch bulk employee data from Sage.

The pagination feature helps manage large responses by returning results in pages.

What is Pagination?

“Pagination is the process of dividing a large dataset into smaller, manageable chunks or pages, allowing users to navigate through the data more easily without overwhelming them with too much information at once.”

  • Pagination Parameters:
    • Use the cursor and page_size parameters to navigate through the results. By default, Bindbee returns 50 records per page.
    • Example of a paginated request:

url = "https://api.bindbee.com/hris/v1/employees?cursor=MDE4YjE4ZWYtYzk5Yy03YTg2LTk5NDYtN2I3YzlkNTQzM2U1&page_size=50"
response = requests.get(url, headers=headers)

  • Querying for Specific Employee Data:
    • You can further refine your request by filtering based on specific fields, such as manager_id, remote_id, or company_id to get employees under a particular manager or company.

‍Check out the entire documentation here - Bindbee’s API documentation.

Get Started with 7shifts API Using Bindbee

Integrating with 7shifts shouldn’t be an engineering battle.

Yet, for most teams, it feels like a huge time sink—draining valuable engineering resources.

Let us handle the heavy lifting. You focus on growth, what say?

Book a demo with our experts today.

7Shifts API: Integration Guide, Key Features, and Best Practices
Kunal Tyagi
CTO -
Bindbee
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.