The addSpinlet service enables you to register a Flash widget with SpinletsLab. You call this service with the following URL:
https://service.spinletslab.com/spinlet/v1/addSpinlet?parameter_list
where parameter_list is the set of required and optional parameters for the call.
All parameters must be urlencoded.
| Name | Description | Required? |
| apiKey | SpinletsLab API Key of the Spinlets widget owner. | Yes |
| source | Flash Spinlets widget’s source URL. | Yes |
| name | Flash Spinlets widget’s name (see Note below). | Yes |
| width | Width, in pixels, of this Spinlets widget. If none is specified, SpinletsLab will use the default size of the Flash widget. If the width is bigger or smaller than the limit, it will be set to a size that’s proportional to the original size. If used, this parameter must be used jointly with the height parameter. | No |
| height | Height, in pixels, of this Spinlets widget. If none is specified, SpinletsLab will use the default size of the Flash widget. If the height is bigger or smaller than the limit, it will be set to a size that’s proportional to the original size. If used, this parameter must be used jointly with the width parameter. | No |
| as | Action Script 2 (as2) or Action Script 3 (as3). Action Script 3 is the default. | No |
| menu | Top menu (top), Bottom menu (bottom) or Hide menu (hide). Bottom menu is the default. | No |
| external | External (displayed) name for this Flash Spinlets widget. If not specified, name is used as the displayed name. | No |
| format | Format which the response is structured: XML (xml) or JSON (json). XML is the default. | No |
https://service.spinletslab.com/spinlet/v1/addSpinlet?apiKey= 00000000000000000000000000000000&source=%22http%3A%2F%2Fspinletslab.com %2Fsample%2Ff%2Fb%2F9%2F619.swf%22
<?xml version="1.0" encoding="UTF-8"?>
<data>
<message>Ok</message>
<response>
<sid>00000000000000000000000000000000</sid>
<name>Spinlets Widget Name</name>
</response>
<status>0</status></data>
{
message:"Ok",response:
{sid:"00000000000000000000000000000000"}
,status:0
}
| Status | Success / Error | Description |
| 0 | Success | Successfully added the widget to SpinletsLab |
| 13 | Error | Invalid API Key; authentication failure |
| 101 | Error | Invalid specified width |
| 102 | Error | Invalid specified height |
| 103 | Error | Invalid specified format |
| 104 | Error | Invalid source |
| 999 | Error | Unknown error |
The getCode service returns the JavaScript code (in XML or JSON format) that can be used to place a widget on a Web page. You call this service with the following URL:
https://services.spinletslab.com/spinlet/v1/getCode?parameter_list
where parameter_list is the set of required and optional parameters for the call.
All parameters must be urlencoded.
| Name | Description | Required? |
| apiKey | SpinletsLab API Key of the Spinlets widget owner | Yes |
| spinletID | The Spinlets widget ID | Yes |
| placementID | The placement ID that’s being used for this Spinlets widget. If none is specified, a new placement ID will be generated. | No |
| parentPlacementID | The parent placement ID for this Spinlets widget. This ID must be specified if placementID is specified. | No |
| format | Format which the response is structured: XML (xml) or JSON (json). XML is the default. | No |
https://service.spinletslab.com/spinlet/v1/getCode?apiKey=000000000 00000000000000000000000&spinletID=00000000000000000000000000000000
<?xml version="1.0" encoding="UTF-8"?>
<data>
<message>OK</message>
<status>0</status>
<response>
<code>CODE HERE</code>
<pid>00000000</pid>
<sid>00000000000000000000000000000000</sid>
</response>
</data>
{
"message": "OK",
"status": 0,
"response": {
"code": "CODE HERE",
"sid": "00000000000000000000000000000000",
"pid": "00000000"
}
}
| Status | Success / Error | Description |
| 0 | Success | Successfully added the widget to SpinletsLab |
| 13 | Error | Invalid API Key; authentication failure |
| 300 | Error | Invalid Spinlets widget ID |
| 301 | Error | Invalid placement ID |
| 302 | Error | Invalid parent placement ID |
| 303 | Error | Invalid Spinlets widget placement type (that is, placement ID is assigned to desktop) |
| 999 | Error | Unknown error |