Back

SafetyCulture API Essential Guide

Aug 17, 20246 minute read

What type of API does SafetyCulture provide?

The SafetyCulture API appears to be a REST API based on the following evidence:

  1. The API documentation lists many endpoints using standard HTTP methods like GET, POST, PUT, DELETE, which is characteristic of REST APIs.

  2. The API endpoints are organized around resources like actions, schedules, sensors, templates, etc. This resource-oriented structure is typical of REST APIs.

  3. There is no mention of GraphQL, SOAP, or other API types in the SafetyCulture API documentation.

  4. The API appears to use JSON for data formats, which is common for REST APIs (though XML can also be used).

Does the SafetyCulture API have webhooks?

Yes, the official SafetyCulture API does have webhooks. Here are the key points about SafetyCulture's webhook functionality:

Webhook Support

SafetyCulture's API includes webhook capabilities, allowing you to subscribe to various events and receive real-time notifications.

Available Webhook Operations

The SafetyCulture API provides several webhook-related operations:

  1. Get signature secret
  2. Regenerate signature secret
  3. List webhooks
  4. Create a webhook
  5. Get a webhook
  6. Delete a webhook
  7. Update a webhook

Event Types

While the search results don't provide an exhaustive list of event types you can subscribe to, SafetyCulture's API documentation likely includes this information. Based on the API's overall functionality, you might expect to be able to subscribe to events related to:

  • Inspections
  • Actions
  • Issues
  • Schedules
  • Templates
  • Users and Groups

Implementing Webhooks

To implement webhooks with SafetyCulture:

  1. You'll need to create a webhook using the "Create a webhook" operation.
  2. Specify the events you want to subscribe to when creating the webhook.
  3. Provide an endpoint URL where SafetyCulture will send the webhook notifications.
  4. Use the signature secret to verify the authenticity of incoming webhook payloads.

Best Practices

  1. Always verify the webhook payload using the signature secret to ensure security.
  2. Implement proper error handling and retry mechanisms for your webhook endpoint.
  3. Use the webhook listing and management operations to keep track of your active webhooks.
  4. Regularly check and update your webhooks to ensure they're still relevant and functioning correctly.

To get detailed information about the specific event types and payload structures for SafetyCulture's webhooks, you should refer to their official API documentation, which would provide comprehensive details about their webhook implementation.

Rate Limits and other limitations

Here are the key points about the API Rate Limits of the SafetyCulture API:

Rate Limiting Policy

  • SafetyCulture API implements a hard throttling limit for rate limiting.
  • Different endpoints have different rate limits, ranging from 20 to 800 requests per 60 seconds.

Specific Endpoint Limits

Some examples of endpoint-specific rate limits include:

  • POST /users/search: 200 requests per 60 seconds
  • GET /share/connections: 200 requests per 60 seconds
  • POST /audits: 30 requests per 60 seconds
  • GET /audits/search: 200 requests per 60 seconds
  • POST /audits/<audit ID>/export: 20 requests per 60 seconds
  • Other endpoints: 800 requests per 60 seconds

Rate Limit Response Headers

The API includes rate limit information in response headers:

  • x-ratelimit-limit: The rate limit credit for that given endpoint
  • x-ratelimit-remaining: The number of requests left for the window
  • x-ratelimit-reset: The number of seconds until this window resets

Exceeding Rate Limits

  • Making too many requests simultaneously will result in throttling.
  • The API will return a 429 HTTP status code with a "Too Many Requests" error message when rate limits are exceeded.

Best Practices

To handle rate limits effectively:

  1. Monitor API usage proactively
  2. Implement error logging and circuit breaker patterns
  3. Use exponential back-off for retries
  4. Analyze API usage to identify critical endpoints
  5. Implement request throttling and efficient data processing
  6. Prioritize batch processing and asynchronous methods
  7. Implement caching at multiple levels
  8. Allocate API calls proportionately to high-priority endpoints
  9. Set up monitoring and alerts for rate limit breaches

By understanding and adhering to these rate limits, developers can ensure optimal usage of the SafetyCulture API and prevent disruptions in their applications.

Latest API Version

Based on the search results provided, I do not have definitive information about the most recent version of the SafetyCulture API. The search results do not contain specific version numbers or release dates for the API. However, I can provide some relevant information about the SafetyCulture API:

Key Points:

  1. SafetyCulture provides an API for developers to integrate with their platform.

  2. The API documentation and resources are available on the SafetyCulture Developer Portal.

  3. Access to the API requires a Premium or Enterprise Plan.

  4. The API covers various functionalities including Users & Groups, Heads Up, Assets, Issues, Templates, Webhooks, and more.

API Access and Documentation

To get started with the SafetyCulture API, developers can:

  • Visit the developer portal at https://developer.safetyculture.com/.
  • Access comprehensive guides and documentation to help with integration.
  • Sign up for a Premium Plan trial for 30 days or contact SafetyCulture for information about the Enterprise Plan.

API Functionality

The SafetyCulture API provides endpoints for various features, including:

  • Users & Groups management
  • Heads Up functionality
  • Asset management
  • Issue tracking
  • Template handling
  • Webhook integration
  • Data feeds
  • Schedules
  • Sensor data
  • Actions
  • And more

Best Practices

  1. Always refer to the official SafetyCulture Developer Portal for the most up-to-date information and documentation.

  2. Ensure you have the appropriate plan (Premium or Enterprise) to access the API.

  3. Familiarize yourself with the authentication process and API use cases before starting your integration.

  4. If you have specific questions or need support, contact the SafetyCulture customer support team.

While I couldn't provide the exact version number of the most recent SafetyCulture API, the information above should help you get started with using their API. For the most accurate and up-to-date information about API versions, it's best to consult the official SafetyCulture Developer Portal or contact their support team directly.

How to get a SafetyCulture developer account and API Keys?

Prerequisites

Before you begin, make sure you have:

  • A SafetyCulture Premium Plan or Enterprise Plan
  • Access to the SafetyCulture web app
  • A full seat in your SafetyCulture account

Steps to Create a Developer Account and API Integration

  1. Access the Developer Portal: Visit the SafetyCulture Developer Portal at https://developer.safetyculture.com/

  2. Explore Available Resources: The developer portal provides comprehensive guides, documentation, and support to help you start integrating with SafetyCulture

  3. Generate an API Token: To create an API integration, you'll need to generate an API token. Here's how:

    a. Log in to your SafetyCulture account b. Click your username on the lower-left corner of the page and select 'My Profile' c. In the pop-up window, give the token a name and enter your account password d. Click the newly generated token to copy it to your clipboard e. Store the token securely, as you won't be able to see it again once you close the pop-up window

  4. Explore API Documentation: Familiarize yourself with the available API endpoints and functionality in the SafetyCulture API documentation

  5. Start Building Your Integration: Use the API token and the documentation to start building your custom integration with SafetyCulture

Key Points to Consider

  • API tokens expire after 30 days of inactivity. You'll need to generate a new token if this happens
  • Each user account can have up to 10 active API tokens. The 11th token you generate will replace the first token
  • If you're part of multiple organizations and want to set up integrations for each, you'll need to generate API tokens separately per organization

Best Practices

  • Securely store your API token and never share it publicly
  • Regularly review and update your integrations to ensure they're using valid tokens
  • Familiarize yourself with SafetyCulture's API rate limits and best practices for efficient API usage

By following these steps and considering the key points, you should be able to set up a developer account and create an API integration with SafetyCulture. Remember to refer to the official documentation for the most up-to-date and detailed information on working with the SafetyCulture API.

What can you do with the SafetyCulture API?

Based on the search results provided, here is a list of data models you can interact with using the SafetyCulture API, along with what is possible for each:

Templates

  • Access and retrieve template data

Inspections

  • Retrieve inspection data
  • Filter inspections using the GetInspections function

Inspection Items

  • Access individual inspection item data
  • Filter inspection items using the GetInspectionItems function

Sites

  • Retrieve site information

Site Members

  • Access site member data (requires "Platform management: Sites" permission)

Users

  • Retrieve user data (requires "Platform management: Users" permission)

Groups

  • Access group information (requires "Platform management: Groups" permission)

Group Users

  • Retrieve group user data (requires "Platform management: Groups" permission)

Schedules

  • Access schedule information

Schedule Assignees

  • Retrieve schedule assignee data

Schedule Occurrences

  • Access schedule occurrence information

Actions

  • Retrieve action data

Action Assignees

  • Access action assignee information

Action Timeline Items

  • Retrieve action timeline item data

Issues

  • Access issue information (requires "Issues: Access" permission)

Issue Timeline Items

  • Retrieve issue timeline item data (requires "Issues: Access" permission)

Assets

  • Access asset information

Training Course Completion

  • Retrieve training course completion data (requires "Training: Manage content" permission)

Key points to consider:

  • The data available depends on the permissions of the account that generated the API token.
  • Some data models require specific permissions to access.
  • You can filter inspection and inspection item data using provided functions.
  • The SafetyCulture API allows integration with business intelligence tools like Power BI and Tableau for data analysis and visualization.