Skip to content

Commit

Permalink
API users/search
Browse files Browse the repository at this point in the history
  • Loading branch information
vovko committed Jul 12, 2012
1 parent b02455e commit 62c58b9
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -48,6 +48,7 @@ The API is [REST API](http://en.wikipedia.org/wiki/Representational_State_Transf
- **[<code>GET</code> users/show](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_show.md)**
- **[<code>GET</code> users/:id/friends](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_id_friends.md)**
- **[<code>GET</code> users/:id/followers](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_id_followers.md)**
- **[<code>GET</code> users/search](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_search.md)**
- **[<code>POST</code> users/:id/friends](https://github.com/500px/api-documentation/blob/master/endpoints/user/POST_users_id_friends.md)**
- **[<code>DELETE</code> users/:id/friends](https://github.com/500px/api-documentation/blob/master/endpoints/user/DELETE_users_id_friends.md)**

Expand Down
3 changes: 1 addition & 2 deletions endpoints/photo/GET_photos_search.md
Expand Up @@ -34,7 +34,6 @@ An array with the following keys and values:
***

## Errors

- **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.


Expand All @@ -43,7 +42,7 @@ An array with the following keys and values:
## Example
**Request**

v1/photos/search?term=bike
GET v1/photos/search?term=bike

## Return __shortened for example purpose__
``` json
Expand Down
96 changes: 96 additions & 0 deletions endpoints/user/GET_users_search.md
@@ -0,0 +1,96 @@
# User Resources

GET users/search

## Description
Return listing of ten (up to one hundred) users from search results for a specified search term.

***

## Requires authentication
* A valid Consumer Key must be provided in **consumer_key** parameter.
* Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.

***

## Parameters
- **term** _(required)_ — A keyword to search for.

***

## Return format
An array with the following keys and values:

- **current_page** — Number of the page that is returned.
- **total_pages** — Total number of pages in this feature's stream.
- **total_items** — Total number of items in this feature's stream.
- **users** — An array of Users objects in **[full format][]**. **.

***

## Errors
- **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.

***

## Example
**Request**

GET v1/photos/search?term=vovko

**Return**
``` json
{
"current_page": 1,
"total_pages": 1,
"total_items": 1,
"users": [
{
"id": 173,
"username": "vovko",
"firstname": "Vladimir",
"lastname": "Drizhepolov",
"birthday": null,
"sex": 1,
"city": "Toronto",
"state": "Ontario",
"country": "Canada",
"registration_date": "2009-11-08T12:41:14-05:00",
"about": "Toronto based photographer.\r\n",
"domain": "vovko.500px.com",
"fotomoto_on": true,
"locale": "en",
"show_nude": true,
"fullname": "Vladimir Drizhepolov",
"userpic_url": "http://acdn.500px.net/173.jpg",
"upgrade_status": 2,
"store_on": true,
"contacts": {
"website": "vovko.ca",
"twitter": "vovko",
"flickr": "Vladimir Drizhepolov",
"gtalk": "vladimir@drizhepolov.com",
"facebook": "562874260",
"blog": "www.vovko.ca"
},
"equipment": {
"camera": [
"Kiev 88"
],
"lens": [
"Volna 80mm"
]
},
"photos_count": 17,
"affection": 4,
"in_favorites_count": 1,
"friends_count": 86,
"followers_count": 18,
"following": false
}
]
}
```

[OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
[full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format

0 comments on commit 62c58b9

Please sign in to comment.