### Request All Subscriptions (GET) Source: https://perfexcrm.themesic.com/apiguide/index This example shows how to request all subscriptions using the HTTP GET method. It specifies the endpoint `yourdomain.com/api/subscriptions/` and requires an `authtoken` in the header for authentication. ```http GET yourdomain.com/api/subscriptions/ ``` -------------------------------- ### Project Data Example Source: https://perfexcrm.themesic.com/apiguide/index This section provides an example of a successful response for project data, including various details about a contract. ```APIDOC ## GET /websites/perfexcrm_themesic_apiguide/projects/{id} ### Description Retrieves detailed information about a specific project or contract. ### Method GET ### Endpoint /websites/perfexcrm_themesic_apiguide/projects/{id} ### Parameters #### Path Parameters - **id** (String) - Required - The ID of the project or contract to retrieve. ### Response #### Success Response (200) - **id** (String) - Unique identifier for the contract. - **content** (String) - Content of the contract. - **description** (String) - Detailed description of the contract. - **subject** (String) - Subject or title of the contract. - **client** (String) - Identifier for the client associated with the contract. - **datestart** (String) - Start date of the contract. - **dateend** (String) - End date of the contract. - **contract_type** (String) - Type of contract. - **project_id** (String) - Associated project ID. - **addedfrom** (String) - Identifier of who added the contract. - **dateadded** (String) - Date and time the contract was added. - **isexpirynotified** (String) - Indicates if expiration has been notified. - **contract_value** (String) - The monetary value of the contract. - **trash** (String) - Indicates if the contract is in trash. - **not_visible_to_client** (String) - Indicates if the contract is not visible to the client. - **hash** (String) - A hash value for the contract. - **signed** (String) - Indicates if the contract is signed. - **signature** (Null) - Signature data if available. - **marked_as_signed** (String) - Indicates if the contract is marked as signed. - **acceptance_firstname** (Null) - First name of the acceptor. - **acceptance_lastname** (Null) - Last name of the acceptor. - **acceptance_email** (Null) - Email of the acceptor. - **acceptance_date** (Null) - Date of acceptance. - **acceptance_ip** (Null) - IP address of the acceptor. - **short_link** (Null) - Short link for the contract. - **name** (String) - Name of the contract. - **userid** (String) - User ID associated with the contract. - **company** (String) - Company name. - **vat** (String) - VAT information. - **phonenumber** (String) - Phone number. - **country** (String) - Country code. - **city** (String) - City. - **zip** (String) - Zip code. - **state** (String) - State. - **address** (String) - Address. - **website** (String) - Website. - **datecreated** (String) - Date the contract was created. - **active** (String) - Indicates if the contract is active. - **leadid** (Null) - Associated lead ID. - **billing_street** (String) - Billing street address. - **billing_city** (String) - Billing city. - **billing_state** (String) - Billing state. - **billing_zip** (String) - Billing zip code. - **billing_country** (String) - Billing country code. - **shipping_street** (String) - Shipping street address. - **shipping_city** (String) - Shipping city. - **shipping_state** (String) - Shipping state. - **shipping_zip** (String) - Shipping zip code. - **shipping_country** (String) - Shipping country code. - **longitude** (Null) - Longitude coordinate. - **latitude** (Null) - Latitude coordinate. - **default_language** (String) - Default language. - **default_currency** (String) - Default currency code. - **show_primary_contact** (String) - Indicates if primary contact should be shown. - **stripe_id** (Null) - Stripe customer ID. - **registration_confirmed** (String) - Indicates if registration is confirmed. - **type_name** (String) - Name of the contract type. - **attachments** (Array) - List of attachments. - **customfields** (Array) - List of custom fields. #### Response Example ```json { "id": "1", "content": "", "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", "subject": "New Contract", "client": "9", "datestart": "2022-11-21", "dateend": "2027-11-21", "contract_type": "1", "project_id": "0", "addedfrom": "1", "dateadded": "2022-11-21 12:45:58", "isexpirynotified": "0", "contract_value": "13456.00", "trash": "0", "not_visible_to_client": "0", "hash": "31caaa36b9ea1f45a688c7e859d3ae70", "signed": "0", "signature": null, "marked_as_signed": "0", "acceptance_firstname": null, "acceptance_lastname": null, "acceptance_email": null, "acceptance_date": null, "acceptance_ip": null, "short_link": null, "name": "Development Contracts", "userid": "9", "company": "8web", "vat": "", "phonenumber": "", "country": "0", "city": "", "zip": "", "state": "", "address": "", "website": "", "datecreated": "2022-08-11 14:07:26", "active": "1", "leadid": null, "billing_street": "", "billing_city": "", "billing_state": "", "billing_zip": "", "billing_country": "0", "shipping_street": "", "shipping_city": "", "shipping_state": "", "shipping_zip": "", "shipping_country": "0", "longitude": null, "latitude": null, "default_language": "", "default_currency": "0", "show_primary_contact": "0", "stripe_id": null, "registration_confirmed": "1", "type_name": "Development Contracts", "attachments": [], "customfields": [] } ``` ``` -------------------------------- ### Request Taxes API Example Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates the GET request to retrieve tax data. Requires an 'authtoken' in the header. Returns an array of tax objects on success or an error message if no data is found. ```http GET yourdomain.com/api/common/tax_data Header: authtoken: String (Authentication token) ``` -------------------------------- ### Task Information Response Example Source: https://perfexcrm.themesic.com/apiguide/index Example of a successful response when retrieving task information, including various details about the task. ```json { "id": "10", "name": "This is a task", "description": "", "priority": "2", "dateadded": "2019-02-25 12:26:37", "startdate": "2019-01-02 00:00:00", "duedate": "2019-01-04 00:00:00", "datefinished": null, "addedfrom": "9", "is_added_from_contact": "0", "status": "4", "recurring_type": null, "repeat_every": "0", "recurring": "0", "is_recurring_from": null, ... } ``` -------------------------------- ### HTTP Request Examples for Contact Operations Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates the structure of HTTP requests for common contact operations like listing, searching, and updating. Includes examples of success and error responses. ```HTTP GET yourdomain.com/api/contacts/:customer_id/:contact_id --- GET yourdomain.com/api/contacts/search/:keysearch --- PUT yourdomain.com/api/contacts/:id ``` -------------------------------- ### Get All Leads Request (HTTP) Source: https://perfexcrm.themesic.com/apiguide/index Illustrates the HTTP GET request to retrieve a list of all leads. This endpoint requires an authentication token in the header. ```http GET yourdomain.com/api/leads/ ``` -------------------------------- ### Update Expense API: Request and Response Examples (HTTP) Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates the HTTP requests and responses for updating an expense. Includes examples of successful updates and various error scenarios like 'Not Found' or validation conflicts. ```http PUT yourdomain.com/api/expenses Header: authtoken: String (Authentication token) Parameter: expense_name (optional): String note (optional): String category: Number (Mandatory) amount: Decimal (Mandatory) date: Date (Mandatory) clientid (optional): Number currency: Number (Mandatory) tax (optional): Number tax2 (optional): Number paymentmode (optional): Number reference_no (optional): String recurring (optional): String (1-12 or custom) repeat_every_custom (optional): Number repeat_type_custom (optional): String (day/week/month/year) ``` ```http HTTP/1.1 200 OK { "status": true, "message": "Expense Updated Successfully" } ``` ```http HTTP/1.1 404 Not Found { "status": false, "message": "Expense Update Fail" } ``` ```http HTTP/1.1 409 Conflict { "status": false, "error": { "category":"The Expense Category is not found" }, "message": "The Expense Category is not found" } ``` ```http HTTP/1.1 409 Conflict { "status": false, "error": { "date":"The Expense date field is required." }, "message": "The Expense date field is required." } ``` ```http HTTP/1.1 409 Conflict { "status": false, "error": { "amount":"The Amount field is required." }, "message": "The Amount field is required." } ``` -------------------------------- ### API Success Response Example Source: https://perfexcrm.themesic.com/apiguide/index Illustrates a successful API response with a 200 OK status. This example shows the expected JSON structure when a request is processed without errors. ```json HTTP/1.1 200 OK { "status": true, "message": "Credit Note Updated Successfully" } ``` -------------------------------- ### GET /api/proposals/search/:keysearch Source: https://perfexcrm.themesic.com/apiguide/index Searches for proposals based on a provided keyword. Requires an authentication token. ```APIDOC ## GET /api/proposals/search/:keysearch ### Description Searches for proposals using a keyword. An authentication token is required in the header. ### Method GET ### Endpoint `/api/proposals/search/:keysearch` ### Parameters #### Path Parameters - **keysearch** (String) - Required - The keyword to search for proposals. #### Header Parameters - **authtoken** (String) - Required - Authentication token generated from the admin area. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **Proposals** (Object) - Contains information about the found proposals. #### Error Response (4xx) - **status** (Boolean) - Indicates the status of the request (false for errors). - **message** (String) - Describes the error, e.g., "No data were found." #### Success Response Example ```json { "id": "2", "subject": "Test 2", "content": "{proposal_items}", "addedfrom": "1", "datecreated": "2021-08-01 13:43:49", "total": "10.00", "subtotal": "10.00", "total_tax": "0.00", "adjustment": "0.00", "discount_percent": "0.00", "discount_total": "0.00", "discount_type": "", "show_quantity_as": "1", "currency": "1", "open_till": "2021-08-08", "date": "2021-08-01", "rel_id": "1", "rel_type": "customer", "assigned": "0", "hash": "6fe6cd0bc66dff03663154660acc1a93", "proposal_to": "test", "country": "102", "zip": "300000", "state": "test", "city": "test", "address": "test", "email": "test@gmail.com", "phone": "01324568903", "allow_comments": "1", "status": "6", "estimate_id": null, "invoice_id": null, "date_converted": null, "pipeline_order": "0", "is_expiry_notified": "0", "acceptance_firstname": null, "acceptance_lastname": null, "acceptance_email": null, "acceptance_date": null, "acceptance_ip": null, "signature": null, "short_link": null, "symbol": "$", "name": "USD", "decimal_separator": ".", "thousand_separator": ",", "placement": "before", "isdefault": "1", "customfields": [ { "label": "Custom Field", "value": "Custom Field value" } ] } ``` #### Error Response Example ```json { "status": false, "message": "No Data Were Found" } ``` ``` -------------------------------- ### Get Lead Information Request (HTTP) Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates the HTTP GET request to retrieve information for a specific lead using its unique ID. Requires an authentication token in the header and the lead's ID as a URL parameter. ```http GET yourdomain.com/api/leads/:id ``` -------------------------------- ### Task API Success Response Example Source: https://perfexcrm.themesic.com/apiguide/index Example of a successful response when adding or deleting a task, indicating the status and a confirmation message. ```json { "status": true, "message": "Task add successful." } ``` -------------------------------- ### GET /api/milestones/search/:keysearch Source: https://perfexcrm.themesic.com/apiguide/index Searches for milestones based on a provided key. Requires authentication. ```APIDOC ## GET /api/milestones/search/:keysearch ### Description Searches for milestones based on a provided key. Requires authentication. ### Method GET ### Endpoint yourdomain.com/api/milestones/search/:keysearch ### Parameters #### Header - **authtoken** (String) - Mandatory - Authentication token, generated from admin area #### Path Parameters - **keysearch** (String) - Mandatory - The search key for milestones. ### Response #### Success Response (200) - **Milestones** (Array) - A list of milestones matching the search criteria. #### Error Response (4xx) - **status** (Boolean) - Request status. - **message** (String) - Indicates if the search failed or no results were found. ### Response Example #### Success Response (200) ```json [ { "id": "5", "name": "MIlestone A", "description": "", "description_visible_to_customer": "0", "due_date": "2019-09-30", "project_id": "2", "color": null, "milestone_order": "1", "datecreated": "2019-07-19", "total_tasks": "0", "total_finished_tasks": "0" } ] ``` #### Error Response (4xx) ```json { "status": false, "message": "No milestones found for the given key." } ``` ``` -------------------------------- ### Get Customer Information API Endpoint and Parameters Source: https://perfexcrm.themesic.com/apiguide/index Describes the GET request to retrieve a specific customer's information using their unique ID. An authentication token is required in the header. ```http GET yourdomain.com/api/customers/:id Header: authtoken: String (Authentication token) Parameter: id: Number (Customer unique ID) ``` -------------------------------- ### Perfex CRM API: Example Success Response (Proposal Details) Source: https://perfexcrm.themesic.com/apiguide/index An example of a successful HTTP 200 OK response when retrieving proposal details. It provides comprehensive information about a specific proposal, including items, custom fields, and status. ```json HTTP/1.1 200 OK { "id": "1", "subject": "Test Proposal", "content": "{proposal_items}", "addedfrom": "1", "datecreated": "2021-08-01 13:38:08", "total": "10.00", "subtotal": "10.00", "total_tax": "0.00", "adjustment": "0.00", "discount_percent": "0.00", "discount_total": "0.00", "discount_type": "", "show_quantity_as": "1", "currency": "1", "open_till": "2021-08-08", "date": "2021-08-01", "rel_id": "1", "rel_type": "customer", "assigned": "0", "hash": "9fc38e5ad2f8256b1b8430ee41069f75", "proposal_to": "test", "country": "102", "zip": "30000202", "state": "Test", "city": "Test", "address": "Test", "email": "test@gmail.com", "phone": "01324568903", "allow_comments": "1", "status": "6", "estimate_id": null, "invoice_id": null, "date_converted": null, "pipeline_order": "0", "is_expiry_notified": "0", "acceptance_firstname": null, "acceptance_lastname": null, "acceptance_email": null, "acceptance_date": null, "acceptance_ip": null, "signature": null, "short_link": null, "symbol": "$", "name": "USD", "decimal_separator": ".", "thousand_separator": ",", "placement": "before", "isdefault": "1", "currencyid": "1", "currency_name": "USD", "attachments": [], "items": [ { "id": "4", "rel_id": "1", "rel_type": "proposal", "description": "item 1", "long_description": "item 1 description", "qty": "1.00", "rate": "10.00", "unit": "1", "item_order": "1" } ], "visible_attachments_to_customer_found": false, "customfields": [ { "label": "Custom Field", "value": "Custom Field value" } ] } ``` -------------------------------- ### Perfex CRM API: Example Success Response (Proposal Search) Source: https://perfexcrm.themesic.com/apiguide/index An example of a successful HTTP 200 OK response when searching for proposals. It returns detailed information about the found proposal, including its ID, subject, content, and associated metadata. ```json HTTP/1.1 200 OK { "id": "2", "subject": "Test 2", "content": "{proposal_items}", "addedfrom": "1", "datecreated": "2021-08-01 13:43:49", "total": "10.00", "subtotal": "10.00", "total_tax": "0.00", "adjustment": "0.00", "discount_percent": "0.00", "discount_total": "0.00", "discount_type": "", "show_quantity_as": "1", "currency": "1", "open_till": "2021-08-08", "date": "2021-08-01", "rel_id": "1", "rel_type": "customer", "assigned": "0", "hash": "6fe6cd0bc66dff03663154660acc1a93", "proposal_to": "test", "country": "102", "zip": "300000", "state": "test", "city": "test", "address": "test", "email": "test@gmail.com", "phone": "01324568903", "allow_comments": "1", "status": "6", "estimate_id": null, "invoice_id": null, "date_converted": null, "pipeline_order": "0", "is_expiry_notified": "0", "acceptance_firstname": null, "acceptance_lastname": null, "acceptance_email": null, "acceptance_date": null, "acceptance_ip": null, "signature": null, "short_link": null, "symbol": "$", "name": "USD", "decimal_separator": ".", "thousand_separator": ",", "placement": "before", "isdefault": "1", "customfields": [ { "label": "Custom Field", "value": "Custom Field value" } ] } ``` -------------------------------- ### Add New Task (POST) Source: https://perfexcrm.themesic.com/apiguide/index This example shows how to add a new task using the HTTP POST method. The endpoint is `yourdomain.com/api/tasks`, and it requires an `authtoken` in the header for authentication. ```http POST yourdomain.com/api/tasks ``` -------------------------------- ### Error Response Example - 404 Not Found Source: https://perfexcrm.themesic.com/apiguide/index This is an example of a standard HTTP 404 Not Found error response. It indicates that the requested resource could not be found on the server. The response body typically mirrors the original request. ```http HTTP/1.1 404 Not Found Same as Original request ``` -------------------------------- ### Delete Invoice API Response Examples Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates the expected JSON response for successful and failed invoice deletion requests. Includes status and message fields. ```HTTP HTTP/1.1 200 OK { "status": true, "message": "Invoice Deleted Successfully" } ``` ```HTTP HTTP/1.1 404 Not Found { "status": false, "message": "Invoice Delete Fail" } ``` -------------------------------- ### Get Staff Information API Endpoint Source: https://perfexcrm.themesic.com/apiguide/index Defines the GET request to retrieve information about a specific staff member using their ID. Requires authentication. Includes example success and error responses. ```HTTP GET yourdomain.com/api/staffs/:id #### Header json Field | Type | Description ---|---|--- authtoken | String | Authentication token, generated from admin area #### Parameter json Field | Type | Description ---|---|--- id | Number | Staff unique ID. * Success-Response: ``` HTTP/1.1 200 OK { "staffid": "8", "email": "data1.gsts@gmail.com", "firstname": "Đào Quang Dân", "lastname": "", "facebook": "", "linkedin": "", "phonenumber": "", "skype": "", "password": "$2a$08$ySLokLAM.AqmW9ZjY2YREO0CIrd5K4Td\/Bpfp8d9QJamWNUfreQuK", "datecreated": "2019-02-25 09:11:31", "profile_image": "8.png", ... } ``` * Error-Response: ``` HTTP/1.1 404 Not Found { "status": false, "message": "No data were found" } ``` ``` -------------------------------- ### Add New Project Source: https://perfexcrm.themesic.com/apiguide/index Creates a new project in the system. Requires an authentication token and several mandatory project details. Optional fields can be included for further customization. ```HTTP POST yourdomain.com/api/projects #### Header json Field | Type | Description ---|---|--- authtoken | String | Authentication token, generated from admin area #### Parameter json Field | Type | Description ---|---|--- name | String | Mandatory Project Name. rel_type | string | Mandatory Project Related. Allowed values: `"lead"`, `"customer"`, `"internal"` clientid | Number | Mandatory Related ID. billing_type | Number | Mandatory Billing Type. start_date | Date | Mandatory Project Start Date. status | Number | Mandatory Project Status. progress_from_tasks (optional) | String | Optional on or off progress from tasks. project_cost (optional) | String | Optional Project Cost. progress (optional) | String | Optional project progress. project_rate_per_hour (optional) | String | Optional project rate per hour. estimated_hours (optional) | String | Optional Project estimated hours. project_members (optional) | Number[] | Optional Project members. deadline (optional) | Date | Optional Project deadline. tags (optional) | String | Optional Project tags. description (optional) | String | Optional Project description. #### Success 200 json Field | Type | Description ---|---|--- status | Boolean | Request status. message | String | Project add successful. ``` -------------------------------- ### Example Success Response (JSON) Source: https://perfexcrm.themesic.com/apiguide/index This JSON object represents a successful API response, typically for retrieving data. It includes fields like 'id', 'content', 'description', and various metadata related to a contract or project. The structure is common for many successful GET requests. ```json { "id": "1", "content": "", "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", "subject": "New Contract", "client": "9", "datestart": "2022-11-21", "dateend": "2027-11-21", "contract_type": "1", "project_id": "0", "addedfrom": "1", "dateadded": "2022-11-21 12:45:58", "isexpirynotified": "0", "contract_value": "13456.00", "trash": "0", "not_visible_to_client": "0", "hash": "31caaa36b9ea1f45a688c7e859d3ae70", "signed": "0", "signature": null, "marked_as_signed": "0", "acceptance_firstname": null, "acceptance_lastname": null, "acceptance_email": null, "acceptance_date": null, "acceptance_ip": null, "short_link": null, "name": "Development Contracts", "userid": "9", "company": "8web", "vat": "", "phonenumber": "", "country": "0", "city": "", "zip": "", "state": "", "address": "", "website": "", "datecreated": "2022-08-11 14:07:26", "active": "1", "leadid": null, "billing_street": "", "billing_city": "", "billing_state": "", "billing_zip": "", "billing_country": "0", "shipping_street": "", "shipping_city": "", "shipping_state": "", "shipping_zip": "", "shipping_country": "0", "longitude": null, "latitude": null, "default_language": "", "default_currency": "0", "show_primary_contact": "0", "stripe_id": null, "registration_confirmed": "1", "type_name": "Development Contracts", "attachments": [], "customfields": [] } ``` -------------------------------- ### Get Estimate Information API Endpoint Source: https://perfexcrm.themesic.com/apiguide/index Details the GET request to retrieve information about a specific estimate using its ID. ```http GET yourdomain.com/api/estimates/:id ``` -------------------------------- ### POST /api/projects Source: https://perfexcrm.themesic.com/apiguide/index This endpoint allows for the creation of new projects. It requires various details about the project, including name, related type, client ID, billing type, start date, and status. Optional fields allow for further customization such as cost, progress, members, deadline, and description. ```APIDOC ## POST /api/projects ### Description Creates a new project with specified details. ### Method POST ### Endpoint /api/projects ### Parameters #### Query Parameters - **name** (String) - Mandatory - Project Name. - **rel_type** (string) - Mandatory - Project Related. Allowed values: `"lead"`, `"customer"`, `"internal"` - **clientid** (Number) - Mandatory - Related ID. - **billing_type** (Number) - Mandatory - Billing Type. - **start_date** (Date) - Mandatory - Project Start Date. - **status** (Number) - Mandatory - Project Status. - **progress_from_tasks** (String) - Optional - on or off progress from tasks. - **project_cost** (String) - Optional - Project Cost. - **progress** (String) - Optional - project progress. - **project_rate_per_hour** (String) - Optional - project rate per hour. - **estimated_hours** (String) - Optional - Project estimated hours. - **project_members** (Number[]) - Optional - Project members. - **deadline** (Date) - Optional - Project deadline. - **tags** (String) - Optional - Project tags. - **description** (String) - Optional - Project description. ### Request Example ```json { "name": "Example Project", "rel_type": "customer", "clientid": 123, "billing_type": 1, "start_date": "2023-10-27", "status": 1, "project_cost": "1000", "deadline": "2023-12-31" } ``` ### Response #### Success Response (200) - **status** (Boolean) - Request status. - **message** (String) - Project Update Successful. #### Response Example ```json { "status": true, "message": "Project Update Successful." } ``` #### Error Response (4xx) - **status** (Boolean) - Request status. - **message** (String) - Project Update Fail. ``` ``` -------------------------------- ### Task API Error Response Example Source: https://perfexcrm.themesic.com/apiguide/index Example of an error response when a task operation fails, showing the status and an error message. ```json { "status": false, "message": "Task add fail." } ``` -------------------------------- ### Projects - Search Project Information Source: https://perfexcrm.themesic.com/apiguide/index Searches for projects based on a keyword. Requires an authentication token. ```APIDOC ## GET /api/projects/search/:keysearch ### Description Searches for projects based on a keyword. ### Method GET ### Endpoint `yourdomain.com/api/projects/search/:keysearch` ### Parameters #### Path Parameters - **keysearch** (String) - Required - Search keywords. #### Header - **authtoken** (String) - Required - Authentication token, generated from admin area. ### Response #### Success Response (200) - **Project** (Object) - Project information. #### Error Response (4xx) - **status** (Boolean) - Request status. - **message** (String) - No data were found. ### Request Example (No request body for GET request) ### Response Example ```json { "id": "28", "name": "Test1", "description": null, "status": "1", "clientid": "11", "billing_type": "3", "start_date": "2019-04-19", "deadline": "2019-08-30", "project_created": "2019-07-16", "date_finished": null, "progress": "0", "progress_from_tasks": "1", "project_cost": "0.00", "project_rate_per_hour": "0.00", "estimated_hours": "0.00", "addedfrom": "5", "rel_type": "lead", "potential_revenue": "0.00", "potential_margin": "0.00", "external": "E" } ``` ``` -------------------------------- ### API Authentication and Success Response Example Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates the expected HTTP headers for authentication (authtoken or Authorization Bearer token) and a typical JSON success response (HTTP 200 OK) for API requests, including status and data fields. ```http HTTP/1.1 200 OK { "status": true, "data": [ { "key": "customers", "label": "Customers", "description": "New or updated customers" }, { "key": "invoices", "label": "Invoices", "description": "New or updated invoices" }, { "key": "leads", "label": "Leads", "description": "New or updated leads" }, { "key": "tasks", "label": "Tasks", "description": "New or updated tasks" }, { "key": "tickets", "label": "Tickets", "description": "New or updated support tickets" } ] } ``` -------------------------------- ### Leads - Request All Leads Source: https://perfexcrm.themesic.com/apiguide/index Retrieves a list of all leads. ```APIDOC ## GET /api/leads/ ### Description Retrieves a list of all leads. ### Method GET ### Endpoint `/api/leads/` ### Parameters #### Header Parameters - **authtoken** (String) - Required - Authentication token, generated from admin area. ### Response #### Success Response (200) - **Lead** (Object) - Lead information. #### Response Example ```json { "id": "17", "hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631", "name": "Lead name", "contact": "", "title": "", "company": "Themesic Interactive", "description": "", "country": "243", "zip": null, "city": "London", "state": "London", "address": "1a The Alexander Suite Silk Point", "assigned": "5", "dateadded": "2019-07-18 08:59:28", "from_form_id": "0", "status": "0", "source": "4", ... } ``` #### Error Response (4xx) - **status** (Boolean) - Request status. - **message** (String) - No data were found. #### Error Response Example ```json { "status": false, "message": "No data were found" } ``` ``` -------------------------------- ### Leads - Add New Lead Source: https://perfexcrm.themesic.com/apiguide/index Adds a new lead to the system. ```APIDOC ## POST /api/leads ### Description Adds a new lead to the system. ### Method POST ### Endpoint `/api/leads` ### Parameters #### Header Parameters - **authtoken** (string) - Required - Authentication token, generated from admin area. #### Request Body Parameters - **source** (string) - Mandatory - Lead source. - **status** (string) - Mandatory - Lead Status. - **name** (string) - Mandatory - Lead Name. - **assigned** (string) - Mandatory - Lead assigned. - **client_id** (string) - Optional - Lead From Customer. - **tags** (string) - Optional - Lead tags. - **contact** (string) - Optional - Lead contact. - **title** (string) - Optional - Position. - **email** (string) - Optional - Lead Email Address. - **website** (string) - Optional - Lead Website. - **phonenumber** (string) - Optional - Lead Phone. - **company** (string) - Optional - Lead company. - **address** (string) - Optional - Lead address. - **city** (string) - Optional - Lead City. - **zip** (string) - Optional - Zip code. - **state** (string) - Optional - Lead state. - **country** (string) - Optional - Lead Country. - **default_language** (string) - Optional - Lead Default Language. - **description** (string) - Optional - Lead description. - **custom_contact_date** (string) - Optional - Lead From Customer. - **contacted_today** (string) - Optional - Lead Contacted Today. - **is_public** (string) - Optional - Lead google sheet id. ### Response #### Success Response (200) - **status** (boolean) - Request status. - **message** (string) - Indicates successful lead addition. #### Error Response (404) - **status** (boolean) - Request status. - **message** (string) - Indicates lead addition failure. ### Request Example ```json { "source": "Website", "status": "New", "name": "John Doe", "assigned": "1", "email": "john.doe@example.com" } ``` ### Response Example #### Success Response (200) ```json { "status": true, "message": "Lead add successful." } ``` #### Error Response (404) ```json { "status": false, "message": "Lead add fail." } ``` ``` -------------------------------- ### Add Custom Fields via API (POST) Source: https://perfexcrm.themesic.com/apiguide/index Demonstrates how to add custom fields to API resources using a POST request. The example shows the URL structure and the format for submitting custom field data, including various field types. ```http POST yourdomain.com/N/A ``` -------------------------------- ### 4xx Error Response Source: https://perfexcrm.themesic.com/apiguide/index Details the structure of client-side error responses (4xx) and provides an example. ```APIDOC ## 4xx Error Response ### Description This section describes the structure of client-side error responses, typically indicated by a 4xx HTTP status code. These errors occur when the client sends an invalid request. ### Method N/A (Applies to all methods) ### Endpoint N/A (Applies to all endpoints) ### Parameters N/A ### Request Example N/A ### Response #### Error Response (4xx) - **status** (Boolean) - Indicates the success or failure of the request. Typically false for errors. - **error** (String) - A message describing the specific error encountered. #### Response Example ```json { "error": "Method not found: invalid_get" } ``` ``` -------------------------------- ### Retrieve Invoice API Response Examples Source: https://perfexcrm.themesic.com/apiguide/index Illustrates the JSON response for retrieving invoice details, including comprehensive invoice data and client information upon success. Also shows the error response when no data is found. ```HTTP HTTP/1.1 200 OK { "id": "2", "sent": "0", "datesend": null, "clientid": "1", "deleted_customer_name": null, "number": "2", "prefix": "INV-", "number_format": "1", "datecreated": "2020-05-26 19:53:11", "date": "2020-05-26", "duedate": "2020-06-25", "currency": "1", "subtotal": "5.00", "total_tax": "0.00", "total": "5.00", "adjustment": "0.00", "addedfrom": "0", "hash": "7bfac86da004df5364407574d4d1dbf2", "status": "1", "clientnote": null, "adminnote": null, "last_overdue_reminder": null, "cancel_overdue_reminders": "0", "allowed_payment_modes": "['1']", "token": null, "discount_percent": "0.00", "discount_total": "0.00", "discount_type": "", "recurring": "0", "recurring_type": null, "custom_recurring": "0", "cycles": "0", "total_cycles": "0", "is_recurring_from": null, "last_recurring_date": null, "terms": null, "sale_agent": "0", "billing_street": "", "billing_city": "", "billing_state": "", "billing_zip": "", "billing_country": null, "shipping_street": null, "shipping_city": null, "shipping_state": null, "shipping_zip": null, "shipping_country": null, "include_shipping": "0", "show_shipping_on_invoice": "1", "show_quantity_as": "1", "project_id": "0", "subscription_id": "0", "symbol": "$", "name": "USD", "decimal_separator": ".", "thousand_separator": ",", "placement": "before", "isdefault": "1", "currencyid": "1", "currency_name": "USD", "total_left_to_pay": "5.00", "items": [ { "id": "2", "rel_id": "2", "rel_type": "invoice", "description": "12MP Dual Camera with cover", "long_description": "The JBL Cinema SB110 is a hassle-free soundbar", "qty": "1.00", "rate": "5.00", "unit": "", "item_order": "1" } ], "attachments": [], "visible_attachments_to_customer_found": false, "client": { "userid": "1", "company": "trueline", "vat": "", "phonenumber": "", "country": "0", "city": "", "zip": "", "state": "", "address": "", "website": "", "datecreated": "2020-05-19 20:07:49", "active": "1", "leadid": null, "billing_street": "", "billing_city": "", "billing_state": "", "billing_zip": "", "billing_country": "0", "shipping_street": "", "shipping_city": "", "shipping_state": "", "shipping_zip": "", "shipping_country": "0", "longitude": null, "latitude": null, "default_language": "english", "default_currency": "0", "show_primary_contact": "0", "stripe_id": null, "registration_confirmed": "1", "addedfrom": "1" }, "payments": [], "scheduled_email": null } ``` ```HTTP HTTP/1.1 404 Not Found { "status": false, "message": "No data were found" } ``` -------------------------------- ### Calendar_Events - Get All Calendar Events Source: https://perfexcrm.themesic.com/apiguide/index Retrieves a list of all calendar events. Requires authentication. ```APIDOC ## GET /api/calendar/ ### Description Retrieves all calendar events. ### Method GET ### Endpoint /api/calendar/ ### Parameters #### Header - **authtoken** (String) - Required - Authentication token, generated from admin area ### Response #### Success Response (200) - Returns an array of calendar event objects. #### Response Example ```json [ { "eventid": "1", "title": "Hello", "description": "test", "userid": "1", "start": "2023-12-12 07:00:00", "end": "2023-12-12 07:00:00", "public": "1", "color": "#03a9f4", "isstartnotified": "0", "reminder_before": "30", "reminder_before_type": "minutes" } ] ``` #### Error Response (404) - **status** (Boolean) - Indicates if the operation failed. - **message** (String) - Error message. #### Error Response Example ```json { "status": false, "message": "No data were found" } ``` ```