Skip to main content
Question

change costcenter information of an extension

  • October 3, 2025
  • 3 replies
  • 148 views

<?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
Forum|alt.badge.img
  • Community Manager
  • October 3, 2025

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.


  • Author
  • Known Participant
  • October 24, 2025

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
Forum|alt.badge.img
  • Community Manager
  • October 27, 2025

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.