Back

CompanyCam API Essential Guide

Aug 15, 20246 minute read

What type of API does CompanyCam provide?

Based on the search results provided, CompanyCam uses a REST API. Here are the key points:

API Type

CompanyCam uses a REST-based API for its core functionality.

Key Features

  1. The API allows developers to read, create, update, and delete most CompanyCam entities like Projects and Photos.

  2. It is designed as a REST-based API for easy integration into any solution.

  3. The API supports webhooks, allowing developers to subscribe to certain events as they occur in real-time.

Use Cases

Some common use cases for the CompanyCam API include:

  • Creating projects from a CRM
  • Syncing photos to job management software
  • Subscribing to webhooks when a photo is tagged

Developer Resources

  1. CompanyCam provides documentation and resources to help developers get started quickly.

  2. Developers need a CompanyCam account to begin developing with the API.

  3. There's a "Getting Started" page available for developers to begin working with the API.

Best Practices

While not specific to CompanyCam, some general best practices for working with REST APIs include:

  1. Using proper HTTP methods (GET, POST, PUT, DELETE) for different operations.
  2. Handling errors and status codes appropriately.
  3. Implementing authentication and authorization as required by the API.
  4. Optimizing requests to minimize data transfer and improve performance.

In conclusion, CompanyCam offers a REST API that provides developers with flexibility and ease of integration for building custom solutions and integrations with their platform.

Does the CompanyCam API have webhooks?

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

Webhook Support

CompanyCam provides webhooks that allow you to subscribe to certain events as they occur in real-time. This eliminates the need to constantly poll the API for updates.

Event Types

You can subscribe to the following types of events via webhooks:

  • Project events (e.g. project.created)
  • Photo events (e.g. photo uploaded, photo tagged)
  • Document events (e.g. document created)
  • Label events (e.g. project labeled)

Some specific examples include:

  • New project created
  • New photo uploaded
  • Photo tagged
  • New document created
  • Project labeled

How It Works

When an event occurs that matches your webhook's scope, CompanyCam will send a POST HTTP request to the webhook URL you specify.

Webhook Payload

The webhook payload will include:

  • event_type: The type of event that occurred
  • created_at: Timestamp of when the webhook was sent
  • payload: Object containing details about the event
  • webhook_id: ID of the webhook that triggered the request

Security

CompanyCam recommends validating webhook payloads for security. They provide a token you can use to verify the request came from CompanyCam.

Setting Up Webhooks

You can create and manage webhooks via the CompanyCam API. When creating a webhook, you specify:

  • URL to receive webhook requests
  • Scopes/events to subscribe to
  • Optional security token

Best Practices

  • Validate webhook payloads using the provided security token
  • Handle webhook events asynchronously
  • Set up proper error handling for your webhook endpoint

In summary, CompanyCam's webhook support allows you to build real-time integrations by subscribing to key events like project creation, photo uploads, and more. This enables powerful automation workflows when combined with their core API functionality.

Rate Limits and other limitations

Based on the search results, here are the key points about the API rate limits for CompanyCam:

Rate Limits

CompanyCam imposes the following rate limits on API requests:

  • GET requests: 240 calls per minute
  • POST requests: 100 calls per minute
  • PUT requests: 100 calls per minute
  • DELETE requests: 100 calls per minute

Key Points to Consider

  1. These rate limits are applied per API token/key.

  2. CompanyCam recommends implementing a retry mechanism to handle requests that may be denied due to rate limiting.

  3. When the rate limit is exceeded, CompanyCam will return a 429 - Too Many Requests HTTP status code.

  4. It's recommended to add exponential backoff to requests to avoid getting rate limited on retries.

Best Practices

  1. Implement proper error handling for 429 responses.

  2. Use exponential backoff when retrying failed requests.

  3. Design your application to stay within the rate limits rather than constantly hitting them.

  4. If you have legitimate needs to exceed the rate limits, contact CompanyCam to discuss options.

  5. Do not attempt to circumvent rate limits by using multiple API keys for the same application, as this could result in a service ban.

Code Example

Here's a simple Python example demonstrating how to make an authenticated request to the CompanyCam API:

import requests API_TOKEN = 'your_api_token_here' BASE_URL = 'https://api.companycam.com/v2' headers = { 'Authorization': f'Bearer {API_TOKEN}' } response = requests.get(f'{BASE_URL}/projects', headers=headers) if response.status_code == 200: projects = response.json() print(projects) elif response.status_code == 429: print("Rate limit exceeded. Please wait and try again.") else: print(f"Error: {response.status_code}")

This code makes a GET request to fetch projects, includes proper authentication, and handles the potential 429 rate limit response.

Remember to replace 'your_api_token_here' with your actual CompanyCam API token.

Latest API Version

Based on the search results provided, there is no specific information about the most recent version of the CompanyCam API or about creating a gallery via the API. However, I can provide some general information about the CompanyCam API and its features:

Core API

CompanyCam offers a Core API that allows developers to work with the core CompanyCam data. This API is designed as a REST-based API for easy integration into various solutions [1][2]. The Core API allows you to:

  1. Read, create, update, and delete most CompanyCam entities like Projects and Photos.
  2. Create projects from your CRM.
  3. Sync photos to your job management software.
  4. Subscribe to webhooks when certain events occur, such as when a photo is tagged.

Key Points to Consider

  1. Authentication: To communicate with the API, you must send a token in the Authorization header of the request. CompanyCam uses a Bearer Token for authorization [3].

  2. Developer Accounts: You need a CompanyCam account to begin developing with CompanyCam. If you already have a CompanyCam account, creating a developer account is optional [1][2].

  3. OpenAPI Specification: CompanyCam provides an OpenAPI Specification (OAS) YAML file for the API, which can be downloaded for reference [3].

  4. Webhooks: The API supports webhooks, allowing you to subscribe to certain events as they occur without constantly polling the API [2].

Best Practices

  1. Use the provided documentation and resources to familiarize yourself with the API's capabilities and endpoints.

  2. If you're building an integration for your own account or want to quickly start using the API, consider using an Access Token generated through the CompanyCam app.

  3. For partners wanting to publish their integrations to other CompanyCam users, support OAuth. Refer to the OAuth guide provided by CompanyCam for more details [3].

  4. Utilize the OpenAPI Specification file to understand the API structure and available endpoints.

While the search results don't provide information about the most recent version of the API or specifically about creating a gallery via the API, it's recommended to check the official CompanyCam API documentation for the most up-to-date information and available endpoints. If you need to create a gallery programmatically, you may want to reach out to CompanyCam's support or consult their developer forums for more specific guidance.

How to get a CompanyCam developer account and API Keys?

To get a developer account for CompanyCam and create an API integration, you need to follow these steps:

1. Create a CompanyCam Account

  1. If you already have a CompanyCam account, you can use that for development purposes.
  2. If you don't have an account, you can sign up for a free development account by visiting the CompanyCam signup page.

2. Obtain API Credentials

  1. Generate an Access Token:
    • For quick testing or personal integrations, you can generate an access token directly through the CompanyCam app.
    • This method is suitable if you're building an integration just for your own account.
  2. Use OAuth:
    • For partners wanting to publish integrations for other CompanyCam users, you'll need to support OAuth.
    • To get OAuth credentials for a developer account, fill out the form provided by CompanyCam.

3. Start Building Your Integration

  • Use the CompanyCam API documentation to understand the available endpoints and functionalities.
  • Implement authentication in your application using either the access token or OAuth flow.
  • Test your integration thoroughly using the provided API endpoints.

4. Additional Resources

  • CompanyCam provides a Postman collection for API testing.
  • You can download the current OpenAPI Specification (OAS) YAML file for the API.
  • For technical issues or feedback, you can reach out to the integrations team at [email protected].

5. Publishing Your Integration (Optional)

  1. Build and test your integration thoroughly.
  2. Fill out the submission form provided by CompanyCam with the required information.
  3. Wait for approval from the CompanyCam team.
  4. Provide ongoing support for your integration once it's launched.

What can you do with the CompanyCam API?

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

Projects

  • Create new projects
  • Read project details
  • Update project information
  • Delete projects
  • Find projects by name
  • Add labels to projects

Photos

  • Upload new photos to projects
  • Read photo details
  • Update photo information
  • Delete photos
  • Add tags to photos
  • Retrieve photos by project

Users

  • Retrieve current user information
  • Manage user accounts

Documents

  • Create new documents
  • Read document details

Tags and Labels

  • Add tags to photos
  • Add labels to projects

Webhooks

  • Subscribe to events (e.g., new photo created, new project created, photo tagged, project labeled)

Key Points:

  • The API allows for CRUD (Create, Read, Update, Delete) operations on most CompanyCam entities
  • Unlimited cloud storage is available for photos and videos
  • All photos are automatically time-stamped and location-tagged
  • The API supports integration with other systems like CRMs and job management software

Best Practices:

  • Use webhooks for real-time event notifications rather than constantly polling the API
  • Leverage the API to automate workflows and integrate with other tools in your tech stack
  • Ensure proper authentication and security measures when accessing the API