REST API (Available on Selected Plans )
The REST API Module for DigifyCRM allows seamless integration between DigifyCRM and third-party applications by enabling REST API functionality. This module is essential for automating workflows, enhancing functionality, and creating real-time data flows with external services, all using HTTP/HTTPS protocols.
Key Features:
- HTTP Methods: Supports all RESTful API methods, including:
- GET: Retrieve data from the CRM.
- POST: Create new entries (e.g., customers, tasks).
- PUT: Update existing entries.
- DELETE: Remove entries.
- Available Endpoints: The module supports various DigifyCRM functions:
- Customers: Add, delete, and update customer records.
- Contacts: Manage contact information for customers.
- Invoices: Add, delete, and update invoices.
- Leads: Manage leads with full control over lead data.
- Projects: Create, delete, and modify project information.
- Tasks: Manage tasks with various actions.
- Payments: Retrieve payment information.
- Estimates: Manage estimates and update data.
- Custom Fields: Handle custom fields for multiple modules.
- Contracts, Tickets, Subscriptions: Manage contracts, tickets, and subscriptions.
- Calendar Events: Create, update, and delete calendar events.
- Attachments Support: Upload files and attachments for leads, projects, tasks, and more.
1. Setting Up the REST API Module
The REST API module for DigifyCRM can be easily installed and activated, providing instant access to the API functionality. Here’s how to set it up:
Steps to Install and Activate:
- Navigate to the Module:
- Go to Modules > REST API in your DigifyCRM dashboard.
- Follow the installation prompts to activate the REST API module.
- Once installed, navigate to Settings > API Settings.
- Generate API keys for secure access to the DigifyCRM data.
- Assign permissions for API keys based on user roles to control access to the API endpoints.
- Review the REST API documentation for detailed request-response examples and endpoint information.
2. Integrating with Third-Party Applications
The REST API module enables integration with various third-party services like accounting software, project management platforms, email marketing systems, and more.
Example Integrations:
- Zapier: Automate workflows between DigifyCRM and other applications like Google Sheets, Slack, or MailChimp.
- Xero: Sync invoice and customer data between DigifyCRM and your accounting system.
- Custom Applications: Build your own integrations using HTTP methods to retrieve, update, or delete data from DigifyCRM in real-time.
3. API Usage Examples
Here are some common use cases for utilizing the DigifyCRM REST API:
1. Creating a New Customer:
- Method: POST
- Endpoint: /api/customers
- Request:
json
Copy code
{
"company": "Example Co.",
"vat": "123456789",
"phonenumber": "+1234567890",
"website": "www.example.com"
}
2. Retrieving Project Information:
- Method: GET
- Endpoint: /api/projects/{id}
- Response:
json
Copy code
{
"id": 1,
"name": "New Website Launch",
"status": "in_progress",
"start_date": "2024-01-01",
"deadline": "2024-03-01"
}
3. Deleting a Task:
- Method: DELETE
- Endpoint: /api/tasks/{id}
4. Updating an Invoice:
- Method: PUT
- Endpoint: /api/invoices/{id}
- Request:
json
Copy code
{
"status": "paid",
"payment_date": "2024-09-30"
}
4. Attachments and File Uploads
The module supports attaching files to various entities such as leads, projects, tasks, tickets, and expenses. This allows external systems to send relevant documents directly to DigifyCRM.
Example: Uploading an Attachment to a Task
- Endpoint: /api/tasks/{id}/attachments
- Method: POST
- Request:
- Include the file in the request body, ensuring that the content-type is correctly set (e.g., multipart/form-data).
5. Security and Authentication
For secure API usage, the module supports JWT authentication. Ensure that you have generated the correct API keys, and always use HTTPS for encrypted data transmission.
6. Reports and Data Retrieval
You can use the REST API to pull real-time data from DigifyCRM for reports and analysis. For example, you can generate a list of all invoices, retrieve customer data, or get detailed timesheet reports.
Example: Retrieve All Invoices
- Endpoint: /api/invoices
- Method: GET
- Response:
json
Copy code
[
{
"id": 1,
"customer": "Example Co.",
"status": "paid",
"amount": 500.00
},
{
"id": 2,
"customer": "Another Co.",
"status": "unpaid",
"amount": 300.00
}
]
7. API Limitations and Considerations
- Custom Development: For advanced integration, you may need a developer with experience in REST APIs.
- Performance: API requests are processed in real-time, but excessive API calls can affect performance. Be mindful of rate limits (if any) set by your external service.
- Token Expiration: Ensure that your API tokens are securely stored and managed, as expired or compromised tokens can disrupt API access.
8. Best Practices
- Use HTTPS: Always use HTTPS for API requests to ensure data is transmitted securely.
- Limit Access: Use the API key permissions feature to control access to specific endpoints, reducing potential security risks.
- Monitor Logs: Regularly check API logs to monitor for any suspicious activity or failed requests.
- Test Before Deploying: Thoroughly test your API integrations in a sandbox or staging environment before deploying them to production.