Notes APIs
Notes are to provide some additional information about a contact, account, deal or task. You can find the notes section in most of the modules. Hence, with Notes API, you can create, delete, or update notes. You can perform actions on single or multiple notes.
Get Notes
Purpose
To get the list of notes.
Request Details
Request URL
https://www.zohoapis.com/bigin/v1/Notes
To get notes from a specific record:
https://www.zohoapis.com/bigin/v1/{module_api_name}/{record_id}/Notes
Supported module
Companies, Contacts, Deals, Tasks, Events, Calls and Products
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoBigin.modules.ALL
(or)
scope=ZohoBigin.modules.{module_name}.{operation_type}
(and)
scope=ZohoBigin.modules.notes.{operation_type}
Possible module names
companies, contacts, deals, tasks, events, calls, products and activities.
Possible operation types
ALL - Full access to notes
READ - Get note data
Parameters
- pagenumber, optional
To get the list of records from the respective pages. Default value is 1.
- per_pagenumber, optional
To get the list of records available per page. Default value is 200.
The page and per_page parameter is used to fetch records according to their position in Bigin. Let's assume that the user has to fetch 400 records. The maximum number of records that one can get for an API call is 200. So, for records above the 200th position, they cannot be fetched. By using the page (1, 2, 3 and 4) and per_page (100) parameter, the user can fetch all 400 records using 4 API calls.
Sample Request
Copiedcurl "https://www.zohoapis.com/bigin/v1/Notes"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
CopiedZBiginRecord record = ZBiginRecord.getInstance("Contacts",123456l);//module api name with record id
BulkAPIResponse response = record.getRelatedListRecords("Notes");
List<ZBiginNote> notes = (List<ZBiginNote>) response.getData();//relatedList name
Copiedtry{
$record=ZBiginRecord::getInstance("Contacts",410405000001111007);
$responseIns=$record->getNotes(null,null,1,50);
$records=$responseIns->getData();
foreach ($records as $note)
{
echo "\n";
echo $note->getId();
echo $note->getTitle();
echo $note->getContent();
$parentRecord=$note->getParentRecord();
echo $parentRecord->getEntityId();
echo $note->getParentName();
echo $note->getParentId();
$createdBy=$note->getCreatedBy();
echo $createdBy->getId();
echo $createdBy->getName();
$modifiedBy=$note->getModifiedBy();
echo $modifiedBy->getId();
echo $modifiedBy->getName();
$owner=$note->getOwner();
echo $owner->getId();
echo $owner->getName();
echo $note->getCreatedTime();
echo $note->getModifiedTime();
echo $note->isVoiceNote();
echo $note->getSize();
$attchments=$note->getAttachments();
if($attchments!=null)
{
foreach ($attchments as $attchmentIns)
{
echo "\nATTACHMENTS::\n";
echo $attchmentIns->getId();
echo $attchmentIns->getFileName();
echo $attchmentIns->getFileType();
echo $attchmentIns->getSize();
echo $attchmentIns->getParentModule();
$parentRecord=$attchmentIns->getParentRecord();
echo $parentRecord->getEntityId();
echo $attchmentIns->getParentName();
echo $attchmentIns->getParentId();
$createdBy=$attchmentIns->getCreatedBy();
echo $createdBy->getId();
echo $createdBy->getName();
$modifiedBy=$attchmentIns->getModifiedBy();
echo $modifiedBy->getId();
echo $modifiedBy->getName();
$owner=$attchmentIns->getOwner();
echo $owner->getId();
echo $owner->getName();
echo $attchmentIns->getCreatedTime();
echo $attchmentIns->getModifiedTime();
}
}
}
}catch (ZBiginException $e)
{
echo $e->getCode();
echo $e->getMessage();
echo $e->getExceptionCode();
}
Copieddef get_notes(self):
try:
record=ZBiginRecord.get_instance('Contacts',3719520000000326007) #module API Name, entityId
resp=record.get_notes()
print(resp.status_code)
note_ins_arr=resp.data
for note_ins in note_ins_arr:
print(note_ins.id)
print(note_ins.title)
print(note_ins.content)
print(note_ins.owner.id)
print(note_ins.created_by.id)
print(note_ins.modified_by.id)
print(note_ins.created_time)
print(note_ins.modified_time)
print("\n\n")
except ZBiginException as ex:
print(ex.status_code)
print(ex.error_message)
print(ex.error_code)
print(ex.error_details)
print(ex.error_content)
CopiedZBiginRecord recordIns = ZBiginRecord.GetInstance("Contacts", 3372164000000614001); //module api name with record id
BulkAPIResponse<ZBiginNote> response = recordIns.GetNotes();
List<ZBiginNote> notes = response.BulkData; //notes - list of ZBiginNote instance
Copiedresponse = invokeurl
[
url: "https://www.zohoapis.com/bigin/v1/Notes"
type: GET
connection:"bigin_oauth_connection"
];
info response;
Response JSON Keys
- OwnerJSON object
Represents the name, ID, and email of the record owner.
- Modified_Timestring
Represents the date and time at which the current note was last modified.
- $attachmentsJSON array
Represents the details of the attachment, if the current note has any.
- Created_Timestring
Represents the date and time at which the note was created.
- Parent_Idstring
Represents the display name and the unique ID of the parent record.
- $editableboolean
Represents if the user can edit the current note.
true: The user can edit the current note.
false: The user cannot edit the current note. - $se_modulestring
Represents the API name of the parent module of the note.
- Modified_ByJSON object
Represents the name, ID, and email of the user who last modified the note.
- idstring
Represents the unique ID of the current note.
- Created_ByJSON object
Represents the name, ID, and email of the user who created the current note.
- Note_Titlestring
Represents the title of the current note.
- Note_Contentstring
Represents the content of the current note.
Possible Errors
- INVALID_MODULEHTTP 400
The module name given seems to be invalid
Resolution: You have specified an invalid module name or there is no tab permission, or the module could have been removed from the available modules. Specify a valid module API name. - INVALID_MODULEHTTP 400
The given module is not supported in API
Resolution: The modules such as Documents and Projects are not supported in the current API. (This error will not be shown, once these modules are been supported). Specify a valid module API name. - INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have ZohoBigin.modules.notes.READ scope. Create a new client with valid scope. Refer to scope section above. - NO_PERMISSIONHTTP 403
Permission denied to read notes details
Resolution: The user does not have permission to retrieve notes data. Contact your system administrator. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team. - INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above. - AUTHORIZATION_FAILEDHTTP 400
User does not have sufficient privilege to read notes
Resolution: The user does not have the permission to retrieve notes data. Contact your system administrator.
Sample Response
Copied{
"data": [
{
"Owner": {
"name": "Patricia Boyle",
"id": "4150868000000225013",
"email": "patricia.b@zohocorp.com"
},
"Modified_Time": "2020-07-28T11:58:59+05:30",
"$attachments": null,
"Created_Time": "2020-07-28T11:55:47+05:30",
"Parent_Id": {
"name": null,
"id": "4150868000002567076"
},
"$editable": true,
"$se_module": "Contacts",
"$is_shared_to_client": false,
"Modified_By": {
"name": "Patricia Boyle",
"id": "4150868000000225013",
"email": "patricia.b@zohocorp.com"
},
"$size": null,
"$state": "save",
"$voice_note": false,
"id": "4150868000002748029",
"Created_By": {
"name": "Patricia Boyle",
"id": "4150868000000225013",
"email": "patricia.b@zohocorp.com"
},
"Note_Title": "Contacted",
"Note_Content": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}