Skip to main content

<?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

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.


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