API

From FavPal

Jump to: navigation, search

Contents

[edit] Introduction

HTTP Basic Authentication

REST

Twitter API


[edit] abitants

Note: FavPal users are called inh abitants.

[edit] authentication test

URL favpal.org/abitants/test_auth.xml Format: xml

Example: curl -X POST -u "user:password" "http://favpal.org/abitants/test_auth.xml"

[edit] abitants index

Return the last abitants.

URL: favpal.org/abitants.format

Formats: xml, html, (soon: atom, rss,... ?)

Parameters:

  • soon: since_id

Example:

curl http://favpal.org/abitants.xml

[edit] abitants show

URL: favpal.org/abitants/id.format

Id: username or numeric id

Format: xml, html

Example:

curl http://favpal.org/abitants/dev_city.xml

[edit] abitants create

URL: favpal.org/abitants (post) Formats: xml, html Requires authentication (abitant who invites and gives one or more favs to the new abitant).

Required parameters:

  • email or password (and password_confirmation). Required one of them at least.

Optional parameters:

  • login (username)
  • email
  • url
  • password and password-confirmation
  • invitation-favs (default: 1)

Example:

curl -X POST -u user:password -H 'Content-Type: application/xml' -d "<abitant><login>mylogin</login><email>my@email.com</email></abitant>" "http://favpal.org/abitants.xml"

[edit] abitants update

Example:

curl -X PUT -u username:password -H 'Content-Type: application/xml' -d "<abitant><login>newlogin</login><password>newpassword</password><password-confirmation>newpassword</password-confirmation></abitant>" "http://favpal.org/abitants/username-orid.xml"

[edit] transfers

[edit] transfers index

URL: favpal.org/transfers.format

Formats: xml, html, (soon: atom, rss, json?)

Parameters:

  • id (show all transfers of the user id as sender or receiver)
  • sender (show transfers of the user sender as sender)
  • receiver (show transfers of the user receiver as receiver)
  • soon: since_id

Example:

curl http://favpal.org/transfers.xml

[edit] transfers show

URL: favpal.org/transfers/id.format

id: numeric id of the transfer

Example:

curl http://favpal.org/transfers/1.xml


[edit] transfers create

URL: favpal.org/abitants (post) Formats: xml, html Requires authentication (sender).

Required parameters:

  • receiver

Optional parameters:

  • amount
  • description
  • link (url as description, for example the url of a post or tweet)

Example:

curl -u "user:password" -X POST -H 'Content-Type: application/xml' -d "<transfer><receiver>uno</receiver><amount>5</amount></transfer>" "http://favpal.org/transfers.xml"

Retrieved from "http://wiki.favpal.org/API"
Personal tools