Skip to content

Search users

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

Description:

Search users (in a paginated way).

###URL: GET http://api.piictu.com/v2/users/search

###HTTP method(s): GET

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

###Parameters (photos pagination):

  • query (string): the text to search in username and fullname
  • page (optional:integer): Specifies the page of results of to retrieve, default = 1.
  • rpp (optional:integer): results per page, default =10, max = 50.

###Usage example:

Example using cUrl:

curl -i http://public-api.piictu.com/v2/users/search \
 -F query=edgar \
 -F page=2 \
 -X GET \
 -H "Authorization: OAuth 2540af0de12cb2367691516b8477b0b7bd66dbd8ab6840b147340c6898c4eebd"

###Response:

On success

  • HTTP response code is 200 (ok)
  • HTTP response body is a JSON string like this:
{
  "current_page": 1,
    "results_per_page": 10,
    "total_entries": 4,
    "total_pages": 1,
    "users": [(4)
    {
      "user": {
        "id": "4d7e40178362427891000001",
        "username": "edgar",
        "avatar_url": "http://cdn-staging.piictu.com/avatars%2F4d7e40178362427891000001%2F90x90_1328643405",
        "fullname": "Edgar Gonzalez",
        "bio": "Piictu - Lord of API",
        "photos_count": 104
      }
    },
  ... 
  ]
}

Clone this wiki locally