Collections Resources

Collections help you organize groups of related Messages. Read more about Collections in the Documentation.

Collection List

The collection list returns all collections for a given bucket.

Request

GET/buckets/<bucket_key>/collections

Response

Data Attributes
uuid The unique identifier (UUID) for this collection.
bucket_key The bucket where this message is stored.
name The name given to this collection.
created_at Thre timestamp that the collection was created
Sample Response Data
{
    "data": [
        {
            "bucket_key": "r55kpraoqohh", 
            "created_at": "Wed, 21 Aug 2013 23:21:17 -0000", 
            "name": "Favorites", 
            "uuid": "cfaf2408-9333-446e-b84e-249e3034fca2"
        }
    ], 
    "error": null, 
    "meta": {
        "status": "success"
    }
}

Collection Detail

The collection detail resource will return a list of message data for this collection. The messages are returned in ascending order of their rank value.

Request

GET/buckets/<bucket_key>/collections/<collection_uuid>

Response

Data Attributes
uuid The unique identifier (UUID) for this message.
rank A numeric value which is how the list is sorted. These are not necessarily continuous nor integer values.
bucket_key The key for the bucket this message is stored in.
request The HTTP request data.
request.headers Thre HTTP request headers as an object. The keys of this object are header names and the value is an array of values.
request.host The destination hostname of the HTTP request.
request.method The HTTP method of the request.
request.params Any querystring parameters in the request as an object. The keys of this object are parameter names, and the value is an array of values.
request.path The path portion of the HTTP request
request.scheme The scheme of the request. (http or https)
request.timestamp A unix timestamp representing the time the request was made. This is a floating point number that with microsecond granularity.
request.body A plain-text or base64-encoded string of data. For binary content (like images), we have base64 encoded the content so it can be returned in a JSON object. The key "body_encoding" will be set accordingly for base64 encoded message bodies.
request.body_encoding The encoding of the request.body. Either 'plaintext' or 'base64'.
response The HTTP response data.
response.headers Thre HTTP response headers as an object. The keys of this object are header names and the value is an array of values.
response.status Integer status code for the HTTP response.
response.reason Text status reason that corresponds to response.status. e.g. - 'OK', 'Not Found', etc.
response.size_bytes The size of the response body in bytes.
response.timestamp A unix timestamp representing the time the response was recieved. This is a floating point number that with microsecond granularity.
response.body A plain-text or base64-encoded string of data. For binary content (like images), we have base64 encoded the content so it can be returned in a JSON object. The key "body_encoding" will be set accordingly for base64 encoded message bodies.
response.body_encoding The encoding of the response.body. Either 'plaintext' or 'base64'.
Sample Response Data
{
    "data": [
        {
            "uuid":  "7adffbbc-9333-446e-b84e-249e3034fca2",
            "bucket_key": "r55kpraoqohh", 
            "rank": 1.1,
            // request and response objects are identical to Message Detail 
            "request": { ... },
            "response": { ... }
        },
        {
            "uuid":  "3034fca2-9333-446e-b84e-249e3446eca2",
            "bucket_key": "r55kpraoqohh", 
            "rank": 2,
            // request and response objects are identical to Message Detail 
            "request": { ... },
            "response": { ... }
        }
    ]
}

Creating a Collection

Request

POST/buckets/<bucket_key>/collections

POST Parameters
name string required The name for the collection. Maximum length is 100 characters.
description string optional A description of the collection. Maximum length is 1,000 characters.

Response

201 Created with the detail representation for the newly-created collection.

Adding Messages to Collections or Modifying Message Rank

This endpoint is used for adding a new message to a collection, or modifying an existing message's rank within the collection.

Request

PUT/buckets/<bucket_key>/collections/<collection_uuid>/<message_uuid>

PUT Parameters
rank float or int optional The numeric rank value for this message in the collection. Rank values do not need to be unique or consecutive. Defaults to current UNIX timestamp if not specified.

Response

201 Created (no body)

Removing a Message From a Collection

This action does not delete the actual message data, it only removes it from this collection instance. To delete a message entirely, see the Message Resource.

DELETE/buckets/<bucket_key>/collection/<collection_uuid>/<message_uuid>

Response

204 No Content with no body.

Delete a Collection

Deleting a collection will permanently remove the collection from Runscope.

DELETE/buckets/<bucket_key>/collection/<collection_uuid>

Response

204 No Content with no body.