Widget Services
Untitled Document
The Widget Web Services allow for creating and managing widgets
within the Clearspring platform. The currently released services are:
Widget GetCode
This service will retrieve XML/HTML (such as embed code or Javascript) for specified widget ID. Other parameters may be supplied to further specify how the widget is rendered. The follow is a sample
request:
https://services.clearspring.com/widget/v1/getCode?apikey=9zTN1Ra&widgetID=48587625ab446e5f
The above call will retrieve the widget code associated with the given widget
ID.
There is a number of parameter that can be used with the
widget remove services. These are
described in the following table:
| Parameter |
Description |
Required? |
|
apiKey (required)
|
The Clearspring API key of the widget owner.
|
yes
|
|
widgetId (required)
|
The widget ID for the widget which will be modified.
|
yes
|
placementId
|
The placement ID to use for this widget; if none is specified, one will be generated automatically.
|
no
|
parentId
|
The parent placement ID for this widget, if a placement ID has been specified. A parent placement ID must be specified if a placement ID is also specified.
|
no
|
config
|
Configuration for this widget placement; the configuration is a URL encoded set of key value pairs, where the key is the parameter name and the value is the value of the configuration parameter.
|
no
|
|
fmt
|
Format in which the response is structured ("xml"
(default), "json", or "kv").
|
no
|
The result of this call is a properly formatted response containing the XML/HTML code to be used for placing the widget.
Status codes for this call are as follows:
| Status |
Success |
Description |
|
0
|
True
|
Successful request.
|
|
12
|
False
|
Authentication failure (API
key doesn't exist or is invalid).
|
|
200
|
False
|
Widget does not exist.
|
201
|
False
|
Invalid placement ID.
|
202
|
False
|
Invalid parent placement ID.
|
302
|
False
|
Invalid widget placement type.
|