Blogger API > XML-RPC >
This documentation is provided for historical interest
only. The Blogger 1.0 API is no longer supported and must not
be used for new client development. Please use our
GData API
instead. — phopkins, 4/2007
blogger.setTemplate changes the template for a given blog. Can change either main or archive index template.
All XML-RPC requests should go to the following URI: http://plant.blogger.com/api/RPC2
Note: This could (and, likely, will) change at some point! (Due warning will be given.)
setTemplate returns a boolean true value upon success. Here is an example setTemplate methodResponse with no errors:POST /api/RPC2 HTTP/1.0 User-Agent: Java.Net Wa-Wa 2.0 Host: plant.blogger.com Content-Type: text/xml Content-length: 515 blogger.setTemplate C6CE3FFB3174106584CBB250C0B0519BF4E294 744154 ewilliams secret <html><head><title><$BlogTitle$></title></head><body><Blogger><BlogDateHeader><h1><$BlogDateHeaderDate$></h1></BlogDateHeader><$BlogItemBody$><br></Blogger></body></html> main
HTTP/1.1 200 OK Connection: close Content-Length: 125 Content-Type: text/xml Date: Mon, 6 Aug 20001 19:55:08 GMT Server: Java.Net Wa-Wa/Linux 1
Errors are returned as an XML-RPC <methodResponse> with a <fault> item, containing a <struct> with a faultCode and a faultString, as defined by the XML-RPC spec.
Here an example response for an unsuccessful post. This error is due to an invalid templateType parameter:
HTTP/1.1 200 OK Connection: close Content-Length: 225 Content-Type: text/xml Date: Mon, 6 Aug 20001 19:55:08 GMT Server: Java.Net Wa-Wa/Linux faultCode 4 faultString java.lang.Exception: java.lang.Exception: Bad parameter: templateType must be either "main" or "archiveIndex".