Create Record
METHOD: POST
KB-url: {BASE_URL}/API/Records.php
Purpose: Add a new record to the system. The target module depends on the Module_ID.
Request Body (Structure):
{
"Records": [
{
"CollectionTypeID": {Module_ID},
"field_1": "{value_1}",
"field_2": "{value_2}",
...
}
]
}
Create New Contact Example:
POST {BASE_URL}/API/Records.php
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
{
"Records": [
{
"CollectionTypeID": 1001,
"first_name": "John",
"last_name": "Doe",
"phone": "+12345678",
"email": "johndoe@ivinex.com",
"contact_type": 14795
}
]
}
The above will create a new contact with the specified fields. You can get your field names from your admin portal. Assuming the contact module ID is 1001
Create New Note Example:
POST {BASE_URL}/API/Records.php
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
{
"Records": [
{
"CollectionTypeID": "{Note_Module_ID}",
"description": "This API is well documented. I love Ivinex",
"contact": "8"
}
]
}
The above created a note for user with ID of 8.
Example Response:
[
{
"CollectionTypeID": 1001,
"CollectionID": 23456,
"Status": "Success",
"Message": "",
"RelatedRecords": []
}
]
Update Record
METHOD: POST
KB-url: {BASE_URL}/API/Records.php
Purpose: Modify an existing record. Requires CollectionID of the record to update.
Request Body (Structure):
{
"Records": [
{
"CollectionTypeID": {Module_ID},
"CollectionID": "{user_id}",
"field_1": "{updated_value_1}",
"field_2": "{updated_value_2}",
...
}
]
}
Update Contact Example:
POST {BASE_URL}/API/Records.php
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
{
"Records": [
{
"CollectionTypeID": 1001,
"CollectionID": 78,
"first_name": "Updated",
"last_name": "Contact",
"email": "updatedcontact@ivinex.com",
"phone": "2222222222"
}
]
}
Update Note Example:
POST {BASE_URL}/API/Records.php
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
{
"Records": [
{
"CollectionTypeID": {Note_Module_ID},
"CollectionID": 78,
"description": "Updated Note. We have done this update before"
}
]
}
The example above updates the notes with the CollectionID of 78.
Example Response:
[
{
"CollectionTypeID": 1001,
"CollectionID": 78,
"Status": "Success",
"Message": "",
"RelatedRecords": []
}
]
Get Records
METHOD: GET
Purpose: Retrieve records from a specific module (e.g., Contacts, Notes) using their
CollectionTypeID. Supports full record pulls, field-based filtering, date ranges, pagination, and linked record lookups.
Understanding Filters
Filters allow you to narrow down results using field-specific conditions. Operands are Case Sensitive.
Operand_Name options:
Equal(=), In, Contains,
NotContains, NotEqual(!=), GreaterThan(>),
GreaterThanEqual(>=), LessThan(<),
LessThanEqual(<=), StartsWith
NOTE: The API doesn't take mathematical operators like =, !=, etc. Use the Operand_Name like
Equal and NotEqual.
Structure:
Filter=[
{
"Field": "field_name",
"Operand": "Operand_Name",
"Value": "field_value"
}
]
Usage: Filters=[{"Field":"field_name","Operand":"{Operand_Name}","Value":"field_value"}]
1. Get All Records (Default Limit)
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}
Returns the first 10 records by default.
2. Get More Records Using Limit
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&Limit=100
Returns up to 100 records. Maximum allowed limit is 100.
3. Get Specific Record(s) by Field
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&Filters=[{"Field":"field_name","Operand":"{Operand_Name}","Value":"field_value"}]
Example 1: For Contacts:
GET {BASE_URL}/API/Records.php?CollectionTypeID=1001&Filters=[{"Field":"email","Operand":"Equal","Value":"demo_email@ivinex.com"}]
Example 2: For Notes:
GET {BASE_URL}/API/Records.php?CollectionTypeID=1002&Filters=[{"Field": "description", "Operand": "Contains", "Value": "Ivinex"}]
4. Linked Records
Sample API: Lets get the notes for a contact:
GET {BASE_URL}/API/Records.php?CollectionTypeID={Notes_Module_ID}
&Filters=[{"Field":"collection_id","Operand_Name":"LinkedTo","Value":"{Contact_Module_ID}:{user_id}"}]
Example: Get Notes for a Contact
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
GET {BASE_URL}/API/Records.php?CollectionTypeID=1002&Filters=[
{"Field":"collection_id","Operand":"LinkedTo","Value":"1001:8"}
]
Assuming Note Module ID is 1002 and Contact Module ID is 1001, this fetches all notes linked to user ID 8.
5. Get Records Within a Date Range
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&Filters=[
{"Field":"filter_start","Operand":"{Operand_Name}","Value":"{Filter_Value}"},
{"Field":"filter_end","Operand":"{Operand_Name}","Value":"{Filter_Value}"}
]
Replace filter_start and filter_end with the actual date fields.
Example:
GET {BASE_URL}/API/Records.php?CollectionTypeID=1001&Filters=[
{"Field":"created_date","Operand":"GreaterThanEqual","Value":"2020-04-13"},
{"Field":"created_date","Operand":"LessThanEqual","Value":"2020-04-28"}
]
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&Limit={Page_Limit}&Offset={Offset_Record}
Page_Limit: Number of records per page (max: 100)
Offset_Record: Number of records to skip
7. Sorting Results
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&OrderBy={field_name} DESC
DESC: Sorts the records in descending order
8. LookupOptionText
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&LookupOptionText=true
9. Advanced Filtering
Contains can be used to check for partial values
NotContains can exclude matches
GET {BASE_URL}/API/Records.php?CollectionTypeID={Module_ID}&Filters=[
{"Field":"filter_field","Operand":"Contains","Value":"{Filter_Value}"},
{"Field":"filter_field","Operand":"NotContains","Value":"{Filter_Value}"}
]
Example Filter Request:
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
GET {BASE_URL}/API/Records.php?CollectionTypeID=1001&Filters=[
{"Field":"full_name","Operand":"StartsWith","Value":"jo"},
{"Field":"email","Operand":"Contains","Value":"gmail.com"}
]
This request filters contacts whose full name starts with “jo” and email contains “gmail.com”.
Example Full Request:
Authorization: Basic {Base64Encoded(username:password)}
Content-Type: application/json
GET {BASE_URL}/API/Records.php?CollectionTypeID=1001&Limit=50&Offset=0&LookupOptionText=true&Filters=[
{"Field":"created_date","Operand":"GreaterThanEqual","Value":"2020-04-13"},
{"Field":"created_date","Operand":"LessThanEqual","Value":"2020-04-28"},
{"Field":"id","Operand":"GreaterThan","Value":"4"}
]