Just finished the XMLPRC and REST APIs for f8p.
Being my first live implementations of either type of API, I learned quite a bit.
The XMLRPC was a breeze since foundation is already baked into Rails. Figuring out how to piggyback REST on top of it was a bit more challenging.
- The methods are:
Create Link expects a “path”, like http://speedymac.com
Find Link expects the link “id”, like 7vkkxg
Find Uses From Link expects the link “id”, like 7vkkxg
- XMLRPC resides at:
- http://fp8.com/backend/api
- REST calls are as follows:
- http://f8p.com/backend/create_link
- http://f8p.com/backend/find_link
- http://f8p.com/backend/find\_uses\_from\_link
All responses should be well-formed xml.
- Usage examples:
- REST
curl -d path=’http://speedymac.com’ -X POST http://f8p.com/backend/create_link
< ?xml version=”1.0” encoding=”UTF-8”?> http://f8p.com/e1gdd1curl -d id=’e1gdd1’ -X POST http://f8p.com/backend/find_link
< ?xml version=”1.0” encoding=”UTF-8”?>http://speedymac.com
curl -d id=’e1gdd1’ -X POST http://f8p.com/backend/find_uses_from_link
< ?xml version=”1.0” encoding=”UTF-8”?>
5
- XMLRPC
curl -d ‘< ?xml version=”1.0” ?>
’ -H “Content-Type: text/xml” -X POST http://f8p.com/backend/apiCreateLink http://speedymac.com < ?xml version=”1.0” ?>
http://f8p.com/e1gdd1 curl -d ‘< ?xml version=”1.0” ?>
’ -H “Content-Type: text/xml” -X POST http://f8p.com/backend/apiFindLink e1gdd1 < ?xml version=”1.0” ?>
http://speedymac.com curl -d ‘< ?xml version=”1.0” ?>
’ -H “Content-Type: text/xml” -X POST http://f8p.com/backend/apiFindUsesFromLink e1gdd1 < ?xml version=”1.0” ?>
5

0 responses so far ↓
There are no comments yet... Kick things off by filling out the form below.
Leave a Comment