Skip to content

Popular streams list

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

Description:

Return the list of popular streams, for every stream include the 10 latest photos.

This method doesn't include locked streams

###URL: GET http://public-api.piictu.com/v1/streams/popular

###HTTP method(s): GET

###Requires authentication (Authentication and Authorization):

No

If user is not authenticated (supply a valid OAuth token) the parameters: client_id and client_secret must be supplied

###Parameters:

  • page (optional:integer): Specifies the page of results to retrieve, default = 1.
  • rpp (optional:integer): results per page, default =10, max = 50.
  • since_seq (optional:integer): Returns results with an SEQ greater than (that is, more recent than) the specified SEQ.
  • max_seq (optional:integer): Returns results with an SEQ less than (that is, older than) or equal to the specified SEQ.
  • client_id (optional:string) id of piictu API client (Authentication and Authorization)
  • client_secret (optional:string) secret of piictu API client (Authentication and Authorization)

###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":2,
  "total_pages":1,
  "streams":[
    {
      "stream":{
        "created_at":"2011-04-11T07:00:52-07:00",
        "seq":23,
        "updated_at":"2011-04-11T07:00:52-07:00",
        "id":"4da309947b3a3e58c800000a",
        "original_photo":{
          "photo":{
            "caption":"My Car",
            "created_at":"2011-04-11T07:00:52-07:00",
            "seq":83,
            "stream_id":"4da309947b3a3e58c800000a",
            "from":{
              "id":"4d99eb672696e71604000001",
              "username":"sulin",
              "fullname": null,
              "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
            },
            "id":"4da309947b3a3e58c800000b",
            "thumbnail":"http://piictu-test.s3.amazonaws.com/photos/thumb_4da309947b3a3e58c800000b.jpg",
            "url":"http://piictu-test.s3.amazonaws.com/photos/4da309947b3a3e58c800000b.jpg"
          }
        },
        "from":{
          "id":"4d99eb672696e71604000001",
          "username":"sulin",
          "fullname": null,
          "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
        },
        "photos":[
          {
            "photo":{
              "caption":"My Car",
              "created_at":"2011-04-11T07:00:52-07:00",
              "seq":83,
              "stream_id":"4da309947b3a3e58c800000a",
              "from":{
                "id":"4d99eb672696e71604000001",
                "username":"sulin",
                "fullname": null,
                "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
              },
              "id":"4da309947b3a3e58c800000b",
              "thumbnail":"http://piictu-test.s3.amazonaws.com/photos/thumb_4da309947b3a3e58c800000b.jpg",
              "url":"http://piictu-test.s3.amazonaws.com/photos/4da309947b3a3e58c800000b.jpg"
            }
          }
        ]
      }
    },
    {
      "stream":{
        "created_at":"2011-04-11T06:55:15-07:00",
        "seq":22,
        "updated_at":"2011-04-11T06:55:15-07:00",
        "id":"4da308437b3a3e58c8000008",
        "original_photo":{
          "photo":{
            "caption":"My House",
            "created_at":"2011-04-11T06:55:15-07:00",
            "seq":82,
            "stream_id":"4da308437b3a3e58c8000008",
            "from":{
              "id":"4d99eb672696e71604000001",
              "username":"sulin",
              "fullname": null,
              "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
            },
            "id":"4da308437b3a3e58c8000009",
            "thumbnail":"http://piictu-test.s3.amazonaws.com/photos/thumb_4da308437b3a3e58c8000009.jpg",
            "url":"http://piictu-test.s3.amazonaws.com/photos/4da308437b3a3e58c8000009.jpg"
          }
        },
        "from":{
          "id":"4d99eb672696e71604000001",
          "username":"sulin",
          "fullname": null,
          "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
        },
        "photos":[
          {
            "photo":{
              "caption":"My House",
              "created_at":"2011-04-11T06:55:15-07:00",
              "seq":82,
              "stream_id":"4da308437b3a3e58c8000008",
              "from":{
                "id":"4d99eb672696e71604000001",
                "username":"sulin",
                "fullname": null,
                "avatar_url":"http://gravatar.com/avatar/4357d23895df5f18f6cb6f804c95ccdd.png?r=PG&s=90"
              },
              "id":"4da308437b3a3e58c8000009",
              "thumbnail":"http://piictu-test.s3.amazonaws.com/photos/thumb_4da308437b3a3e58c8000009.jpg",
              "url":"http://piictu-test.s3.amazonaws.com/photos/4da308437b3a3e58c8000009.jpg"
            }
          }
        ]
      }
    }
  ]
}

###Usage example:

Example using cUrl without OAuth token:

curl -i "http://public-api.piictu.com/v1/streams/popular \
-F client_id=4d501d0d03128b000001 \
-F client_secret=3e9444dedfa3fb79c4c95feaac12574b6234dac368765037028d969714 \
-X GET"

Example using cURL with OAuth token:

curl -i http://public-api.piictu.com/v1/streams/popular \
 -H "Authorization: OAuth 2540af0de12cb2367691516b8477b0b7bd66dbd8ab6840b147340c6898c4eebd"

Clone this wiki locally