Skip to main content
The First Step
Oct 3, 2025 3:14 PM UTC
Question

change costcenter information of an extension

<?php

 

    $endpoint = "/restapi/v1.0/account/~/extension/425746071";

    $body = [

        "costCenter" => [

            "id" => 303070 

        ]

    ];

    try {

        $response = $platform->patch($endpoint, $body);

        return $response->json();

    } catch (\RingCentral\SDK\Http\ApiException $e) {

        echo "Failed to update cost center for extension " . $e->getMessage() . "\n";

        return null;

    }

?>

 

But I am getting Resource not found. 425746071 is a valid extensionID and 303070  is a valid costcenterID. My app has Edit Extensions rights

    3 replies

    PhongVu
    Community Manager
    Community Manager
    Oct 3, 2025 10:40 PM UTC

    That endpoint does not support PATCH method, it is a PUT method. But it does not take the costCenter param in the request body either.

    Try with this API instead.

    The First Step
    Oct 24, 2025 1:32 AM UTC

    Hi PhongVu
    Thank you for your suggestion. I can use the API you suggested for changing some fields, however the Cost Center information is not changing when I try (no error message, just not doing anything).

    What am I doing wrong?

     

    $body = array(
        'records' => array(
            array(
                'id' => 425746071,
                'contact' => array(
                    'firstName' => 'new Name'
                    ),
                'costCenter' => array(
                    'id' => '675070',
                    'name' => 'B40101'
                ),
            )  
        )
    );


            $r = $platform->post("/restapi/v1.0/account/~/extension-bulk-update", $body);                                        
     

    PhongVu
    Community Manager
    Community Manager
    Oct 27, 2025 2:21 PM UTC

    Hi PhongVu
    Thank you for your suggestion. I can use the API you suggested for changing some fields, however the Cost Center information is not changing when I try (no error message, just not doing anything).

    What am I doing wrong?

     

    $body = array(
        'records' => array(
            array(
                'id' => 425746071,
                'contact' => array(
                    'firstName' => 'new Name'
                    ),
                'costCenter' => array(
                    'id' => '675070',
                    'name' => 'B40101'
                ),
            )  
        )
    );


            $r = $platform->post("/restapi/v1.0/account/~/extension-bulk-update", $body);                                        
     

    You are right. I tested myself and it does not work as expected. I then checked with the platform team and it turns out that changing CC via API is not supported. The API would return the “Accepted” and “Completed” task status but it just ignores the request.