Knowledge Base: collections.create

collections.create

HTTP Method: POST
Parameters: api_key, user_token, name
Optional Paramters: slug, description, privacy_level_id

Uploads a new image file to the site.

Required Parameters

api_key:    API token for your client.
user_token: The users token, received after the user logs in.
name:       A name for the collection. [string] (100 characters)

Optional Parameters

slug:               A slug to be used in the url [string] (50 chars max, alphanumeric and hyphen)
description:        Description of the collection [string]
privacy_level_id:   An id to set the privacy level of the collection to. [int]

Usage

Simply send a HTTP POST containing the above parameters in the body.

https://api.emberapp.com/collections/create

Response

On success: HTTP 200 response.

collection:

name:           Name of the image: [string]
slug:           The slug used by the image on the site unique to the owner. [string]
description:    The collection description. [string]
created:        Unix Timestamp the image was added. [int]
privacy_level:  Privacy level of the collection. [string]

On failure: HTTP 400 response plus an array of errors.

Example Successful XML Response

<?xml version="1.0"?>
<response>
    <status code="0">OK</status>
    <api>api.collections.create</api>
    <collection>
        <name>Websites</name>
        <slug>websites</slug>
        <description/>
        <created>1253199922</created>
        <privacy_level id="1">Public</privacy_level>
    </collection>
</response>

Example Unsuccessful XML Response

<?xml version="1.0"?>
<response>
    <status code="1">FAIL</status>
    <api>api.collections.create</api>
    <errors>
        <name>Collection name already exists.</name>
    </errors>
</response>