Skip to content

Follow friend

Rafael Chacon edited this page Feb 22, 2012 · 1 revision

###URL: POST http://public-api.piictu.com/v2/friendships

###HTTP method(s): POST

###Requires authentication (Authentication and Authorization): Yes

###Parameters:

  • id id of the user you want to follow

###Usage example:

Example using cURL:

curl -i http://public-api.piictu.com/v2/friendships \
  -F id=4d6ebc4f5a0d032648000016 \
  -H "Authorization: OAuth 2540af0de12cb2367691516b8477b0b7bd66dbd8ab6840b147340c6898c4eebd" \
  -X POST

###Response:

On success

  • HTTP response code is 200 (ok)
  • HTTP response body is a JSON string like this:
{
  "friend": {
    "id":"4d99eb672696e71604000001",
    "username":"sulin",
    "fullname": null,
    "bio": null,
    "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
  }
}

On error (when friend doesn't exist)

  • HTTP response code is 404 (document not found)
  • HTTP response body is a JSON string like this:
{
    "error" : "document not found"
}

Clone this wiki locally