getCallLog
This interface retrieves a previously logged call log record in the target CRM. This information is used to render a form to allow an end user to view or edit that record within the App Connect client.
Request parameters
Parameter | Description |
---|---|
user |
TODO |
callLogId |
The ID of the activity or call log record within the CRM. |
authHeader |
The HTTP Authorization header to be transmitted with the API request to the target CRM. |
Return value(s)
This interface should return the associated call log record in a prescribed format.
Parameter | Description |
---|---|
callLogInfo |
Contain subject , note and optionally additionalSubmission |
returnMessage |
message , messageType and ttl |
Example
{
callLogInfo:{
subject: "A new call from John Doe",
note: "Delivery location changed.",
additionalSubmission: {
address: "12 Some Street, CA"
}
},
returnMessage:{
message: 'Log fetched',
messageType: 'success', // 'success', 'warning' or 'danger'
ttl: 30000 // in miliseconds
}
}
Reference
// const postBody = {
// subject: callLog.customSubject ?? `[Call] ${callLog.direction} Call ${callLog.direction === 'Outbound' ? 'to' : 'from'} ${contactInfo.name} [${contactInfo.phone}]`,
// body: `\nContact Number: ${contactInfo.phoneNumber}\nCall Result: ${callLog.result}\nNote: ${note}${callLog.recording ? `\n[Call recording link] ${callLog.recording.link}` : ''}\n\n--- Created via RingCentral App Connect`,
// type: 'PhoneCommunication',
// received_at: moment(callLog.startTime).toISOString()
// }
// const addLogRes = await axios.post(
// `https://api.crm.com/activity`,
// postBody,
// {
// headers: { 'Authorization': authHeader }
// });
console.log(`adding call log... \n${JSON.stringify(callLog, null, 2)}`);
console.log(`body... \n${body}`);
console.log(`with additional info... \n${JSON.stringify(additionalSubmission, null, 2)}`);
mockCallLog = {
id: 'testCallLogId',
subject: callLog.customSubject,
note: body,
contactName: contactInfo.name
}
const addLogRes = {
data: {
id: mockCallLog.id
}
}
//----------------------------------------------------------------------------
//---CHECK.4: Open db.sqlite and CRM website to check if call log is saved ---
//----------------------------------------------------------------------------
return {
user_id: user.id,
subject,
person_id: contactInfo.id,
org_id: orgId,
deal_id: dealId,
note,
done: true,
due_date: dateUtc,
due_time: timeUtc,
type: hasSMSType ? 'SMS' : 'Call'
}
const addLogRes = await axios.post(
`https://${user.hostname}/v1/activities`,
postBody,
{
headers: { 'Authorization': authHeader }
});
extraDataTracking = {
ratelimitRemaining: addLogRes.headers['x-ratelimit-remaining'],
ratelimitAmount: addLogRes.headers['x-ratelimit-limit'],
ratelimitReset: addLogRes.headers['x-ratelimit-reset']
};