Skip to main content

I want to update multiple contact in my custom web application using api..which api can be called? Any sample example available?

You can use this following API to update your external contacts in bulk (maximum 500 ext) :

https://developers.ringcentral.com/api-reference/External-Contacts/addressBookBulkUpload


This endpoint documentation shows a ‘results’ property on the response with record details, but I do not get one. I’m trying to find the most efficient way to upload contacts and get the associated IDs. I tried adding ?results=true to the url, no luck. Can anyone help? 

Thanks,

Alex


This endpoint documentation shows a ‘results’ property on the response with record details, but I do not get one. I’m trying to find the most efficient way to upload contacts and get the associated IDs. I tried adding ?results=true to the url, no luck. Can anyone help? 

Thanks,

Alex

The response from the POST endpoint contains the task Id. You need to use the id to check the status of the task and get the response with the result when the task is completed.

Here is an example how to check the task status and get the response.

async function check_bulk_upload_task(taskId){
try {
var endpoint = `/restapi/v1.0/account/~/address-book-bulk-upload/tasks/${taskId}`
var resp = await platform.get(endpoint)
var jsonObj = await resp.json()
if (jsonObj.status == "Failed"){
console.log(jsonObj)
}else if (jsonObj.status == "Completed"){
console.log(JSON.stringify(jsonObj))
} else {
await new Promise(r => setTimeout(r, 20000));
check_bulk_upload_task(taskId)
}
}catch(e){
console.log(e.message)
}
}

 


Thank you!


I did this and was returned an array that did not include a id for each contact created. I got names, phones, addresses, but no ID. How can I get the IDs? I need to do several hundred per extension, so individual calls are not an option because of the rate limiting.


Reply