Update Server Widget

API Type: 
Server Widgets

This operation let you send HTTP request for updating a widget previously created by Server Widgets API. 

Request Parameters: 
  • app_id  - the application Id. Unless you set dedicated application use this value: "server_widgets"  
  • api_key - The API key assigned to service provider.  For trial version use this value:  "demo_developer-prod"
  • peers - Optional. Array of peers to update. One of the peers must be marked as owner. 
  • data - Optional. An updated data to set in the widget. For now since cg-APIHTMLWidget is the only supported widget this will be some HTML script or simple text.  

Path parameter:

  • widget_id - the Id of the widget to delete
Sample Code: 
<?php

$widgetId = "[The Id of widget to update]";
$params = array(
    "app_id" => "[APP ID]",
    "api_key" => "[API KEY]",
    "data" => "
123456789
", ); $serviceUrl = "http://api.contentglass.com/server_api/s1/server_widget/{$widgetId}"; $error = ""; $response = NetUtils::curlPUT($serviceUrl, $params, $error); echo "<h1>Test Widget Create</h1>"; echo "<pre>"; echo $response; echo "</pre>"; if (!empty($error)) { echo $error; } ?>
Sample Response: 
{"status":1,"id":"5676869016797"}