Skip to main content
The First Step
Oct 21, 2021 11:40 AM UTC
Question

Update multiple contact

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

    5 replies

    The First Step
    Oct 21, 2021 12:25 PM UTC

    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

    New Participant
    Jan 30, 2025 11:02 AM UTC

    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

    PhongVu
    Community Manager
    Community Manager
    Jan 30, 2025 6:58 PM UTC

    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)
    }
    }

     

    New Participant
    Jan 31, 2025 12:05 AM UTC

    Thank you!

    New Participant
    Jan 31, 2025 12:28 AM UTC

    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.