Fail updating array/object via API

Hi,

I am able to update member variables of a service using the API but the same call does not update the geo array/object.

For example, the following code updates the port_id setting but neither of the geo settings. The API response says that geo is an array, the docs say it is an object. I’ve tried setting the geo as an object, and as an array, neither works.

My code:


                $serviceApiUrl = "admin/customers/customer/".$idCustomer."/internet-services--".$idService;

                //$obj = (object) array('geo' => array('marker'=>'53,4'));

                $data_array = array(
                        'port_id' => '666', 
                        'geo' => array(
                                'address' => 'example',
                                'marker' => '57.000000, -3.000000'
                        ),
                );

                $request = $this->api->api_call_put($serviceApiUrl,'', $data_array);

I’ve left object creation line in for ref. Either using the $obj variable or the created array above doesn’t change the geo object in the service. The code above does update the port_id and I can update other variables as well.

How can I update the geo object using the service API please?

I also tried with using http_build_query and appending the params to the end of the URL as below, however that didn’t work either.

                $params = [
                        'geo' => [
                                'address' => 'example',
                        ],
                ];

                $serviceApiUrl = "admin/customers/customer/".$idCustomer."/internet-services--".$idService.'?'. http_build_query($params);
                $request = $this->api->api_call_put($serviceApiUrl, $idCustomer, $params );

Regards,
Ian

Hello! Thank you for posting your inquiry on our forum, we would kindly ask you to reach out to our support team via support@splynx.com for assistance.