Custom Module API allows customers to add, edit, and delete records through REST API from scripts or external clients. The list of supported operations with the expected URL and input_data is given below.
For more details about the custom module refer to this link.
API Usage:
Here we have taken an example of adding records to a custom module called book with plural name as books and fields such as
Title
Author
Category - Pick list with 3 values
Description
References:
custom_module_api_plural_name
field_name
APIs
API | URL | input_data | Response |
Get the list of records for a particular custom module URL pattern: api/v3/<custom_module_api_plural_name> | GET - api/v3/cm_books | { "list_info": { "row_count": "10", "start_index": 1, "get_total_count": true, "search_criteria": { "field": "cm_fields.sline_author", "value": "author", "condition": "contains", "logical_operator": "AND" }, "sort_field": "cm_fields.sline_author", "sort_order": "asc" } } | { "cm_books": [ { "created_time": { "display_value": "17/04/2023 04:26 PM","value": "1681729003728" }, "cm_fields": { "sline_author": "test author", "pick_category": { "name": "Novel", "id": "3634" } }, "description": "<div>test description</div>", "id": "301", "title": "test", "created_by": { "email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null, "name": "Engineering", "id": 2 } } } ], "response_status": [ { "status_code": 2000, "status": "success" } ], "list_info": { "has_more_rows": false, "start_index": 1, "sort_field": "cm_fields.sline_author", "total_count": 1, "sort_order": "asc", "search_criteria": { "condition": "contains", "field": "cm_fields.sline_author", "logical_operator": "AND", "value": "auth" }, "get_total_count": "true", "row_count": 1 } } |
Get a single record URL pattern: api/v3/<custom_module_api_plural_name>/<id> | GET - api/v3/cm_books/3 | { "response_status": {"status_code": 2000, "status": "success" }, "cm_book": { "created_time": { "display_value": "17/04/2023 04:26 PM", "value": "1681729003728" }, "cm_fields": { "sline_author": "test author", "pick_category": { "name": "Novel", "id": "3634" } }, "attachments": [], "description": "<div>test description</div>", "id": "301", "title": "test", "created_by": { "email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null, "name": "Engineering", "id": 2 } } } } | |
Add a record URL pattern: api/v3/<custom_module_api_plural_name> | POST - api/v3/cm_books | { "cm_book": { "title": "Harry Potter", "description": "<div>description about harry potter</div>", "attachments": [], "cm_fields": { "sline_author": "J.K Rowling", "pick_category": { "id": "3636", "name": "Fantasy" }} } } | { "response_status": { "status_code": 2000, "status": "success" }, "cm_book": { "created_time": { "display_value": "17/04/2023 07:20 PM", "value": "1681739443587" }, "cm_fields": { "sline_author": "J.K Rowling", "pick_category": { "name": "Fantasy", "id": "3636" } },"attachments": [], "description": "<div>description about harry potter</div>", "id": "302", "title": "Harry Potter", "created_by": { "email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null, "name": "Engineering", "id": 2 } } } } |
Edit a record URL pattern: api/v3/<custom_module_api_plural_name>/<id> | PUT - api/v3/cm_books/301 | { "cm_book": { "title": "test1", "cm_fields": {"pick_category": { "id": "3635", "name": "Classics" } } } } | { "response_status": { "status_code": 2000, "status": "success"}, "cm_book": { "created_time": { "display_value": "17/04/2023 04:26 PM", "value": "1681729003728" }, "cm_fields": { "sline_author": "test author", "pick_category": { "name": "Classics", "id": "3635" } }, "attachments": [], "description": "<div>test description</div>", "id": "301", "title": "test1", "created_by": { "email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null, "name": "Engineering", "id": 2 } } } } |
Allowed values of selectable pick list and multi select values URL pattern: api/v3/<custom_module_api_plural_name>/cm_fields/<field_name> Note: In upcoming releases, "cm_fields" which is called holder, will be removed from this URL | api/v3/cm_books/cm_fields/pick_category | { "response_status": { "status_code": 2000, "status": "success" }, "pick_category": [ { "name": "Novel", "id": "3634" }, { "name": "Classics", "id": "3635" }, { "name": "Fantasy", "id": "3636" }, {"name": "Humor and satire.", "id": "3637" } ], "list_info": { "has_more_rows": false, "start_index": 1, "sort_order": "asc", "row_count": 4 } } | |
Move to trash URL pattern: api/v3/<custom_module_api_plural_name>/<id>/_move_to_trash | api/v3/cm_books/301/_move_to_trash | { "response_status": { "status_code": 2000, "status": "success" }, "cm_book": { "created_time": { "display_value": "17/04/2023 04:26 PM", "value": "1681729003728" }, "cm_fields": { "sline_author": "test author", "pick_category": { "name": "Classics", "id": "3635" } },"attachments": [], "description": "<div>test description</div>", "id": "301", "title": "test1", "created_by": { "email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null, "name": "Engineering", "id": 2 } } } } | |
Get trashed records URL pattern: api/v3/<custom_module_api_plural_name> | GET - api/v3/cm_books | { "list_info": { "start_index": 1, "row_count": "10","sort_field": "cm_fields.sline_author", "sort_order": "asc", "filter_by": { "name": "trash" }, "get_total_count": true } } | { "cm_books": [ { "created_time": {"display_value": "17/04/2023 04:26 PM", "value": "1681729003728" }, "cm_fields": { "sline_author": "test author", "pick_category": { "name": "Classics", "id": "3635" } }, "description": "<div>test description</div>", "id": "301", "title": "test1", "created_by": { "email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null,"name": "Engineering", "id": 2 } } } ], "response_status": [ { "status_code": 2000, "status": "success" } ], "list_info": { "has_more_rows": false, "start_index": 1, "sort_field": "cm_fields.sline_author", "total_count": 1, "filter_by": { "name": "trash" }, "sort_order": "asc", "get_total_count": "true", "row_count": 1 } } |
Delete a record URL pattern: api/v3/<custom_module_api_plural_name> /<id> | Delete - api/v3/cm_books/301 | {"response_status":{"status_code":2000,"status":"success"}} | |
Restore trashed record URL pattern: api/v3/<custom_module_api_plural_name> /<id>/_restore_from_trash | PUT - api/v3/cm_books/301/_restore_from_trash | { "response_status": { "status_code": 2000, "status": "success" }, "cm_book": { "created_time": { "display_value": "17/04/2023 04:26 PM", "value": "1681729003728" }, "cm_fields": { "sline_author": "test author", "pick_category": { "name": "Classics", "id": "3635" } }, "attachments": [], "description": "<div>test description</div>", "id": "301", "title": "test1", "created_by": {"email_id": "demo@test.com", "phone": "987654321", "name": "Demo", "mobile": "987654321", "profile_pic": { "content-url": "/images/default-profile-pic2.svg" }, "is_vipuser": false, "id": "10", "department": { "site": null, "name": "Engineering", "id": 2 } } } } |