API

Collections

Overview

Collections are the main way things are organized in Dropmark. A collection has one owner, but has many items and users (AKA collaborators).

Collections:

  1. List collections
  2. Get collections count
  3. Create a collection
  4. Get a collection
  5. List collection tags
  6. Update a collection
  7. Delete a collection

Collection items:

  1. Update items order
  2. Update items
  3. Delete items

Collection collaborators:

  1. List collaborators
  2. Add a collaborator
  3. Remove a collaborator

List collections

Endpoint

GET https://api.dropmark.com/v1/collections

Query String Params

Name Type Desc
domain String Retrieves collections of the account matching this dashboard domain
include Array Additional objects available to include in response: items, users
owned Boolean Filters collections to those owned by current user
owner_id Integer Filters collections to those owned by this user
page Integer Current page
per_page Integer Number of collections to return
q String Filters collections to those matching this search query
sort String Supported values: name, recent
status Array Supported collection statuses: active (default), archived, highlighted

Response

Status: 200 OK
X-Total-Count: 53
[
  {
    "id": 1337,
    "user_id": 1,
    "name": "Inspiration",
    "description": null,
    "type": "private",
    "sort": 1,
    "sort_by": null,
    "sort_order": null,
    "view_mode": "tile",
    "thumbnail": null,
    "labels": true,
    "highlighted": false,
    "archived": false,
    "last_accessed_at": "2016-08-12T12:20:18Z",
    "created_at": "2016-08-12T12:20:18Z",
    "updated_at": "2016-08-12T12:20:18Z",
    "items_total_count": 0,
    "user_name": "Jane Doe",
    "username": "demo",
    "user_avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
    "user_email": "jane@example.com",
    "custom_domain": null,
    "user_plan": "pro",
    "user_plan_active": true,
    "users_total_count": 1,
    "url": "http://demo.dropmark.com/1337",
    "short_url": "http://dpmk.com/0LJFKM0Wk3",
    "thumbnails": {
      "mini": "http://img.dropmark.com/...",
      "small": "http://img.dropmark.com/...",
      "cropped": "http://img.dropmark.com/...",
      "uncropped": "http://img.dropmark.com/...",
      "large": "http://img.dropmark.com/..."
    },
    "permissions": {
      "admin": true,
      "edit": true,
      "share": true,
      "leave": false,
      "delete": true
    }
  }
]

Get collections count

Endpoint

GET https://api.dropmark.com/v1/collections/count

Response

Status: 200 OK
{
  "active": 2,
  "archived": 1,
  "highlighted": 1,
  "owned": 1,
  "total": 3
}

Create a collection

Endpoint

POST https://api.dropmark.com/v1/collections

Input

Name Type Desc
name String Collection title (required)
type String Privacy type: private, public, global (required)
archived* Boolean Collection’s archived status
description String Collection description
highlighted* Boolean Collection’s highlighted status
labels* Boolean Set to false to hide item labels in list
sort_by* String Item sort: created_at, updated_at, name, type, size, reactions. Set to null to sort by item’s drag & drop position
sort_order* String Item sort order: asc or desc
thumbnail String Collection thumbnail URL or Base64 image
users Array User IDs of collaborators to invite
user_id Integer Collection owner’s user ID
view_mode* String Item view mode: tile (default), shelf, flow, list

* Available for accounts on a paid plan only

Example

{
  "name": "Inspiration",
  "type": "private"
}

Response

Status: 201 Created
{
  "id": 1337,
  "user_id": 1,
  "name": "Inspiration",
  "description": null,
  "type": "private",
  "sort": 1,
  "sort_by": null,
  "sort_order": null,
  "view_mode": "tile",
  "thumbnail": null,
  "labels": true,
  "highlighted": false,
  "archived": false,
  "last_accessed_at": "2016-08-12T12:20:18Z",
  "created_at": "2016-08-12T12:20:18Z",
  "updated_at": "2016-08-12T12:20:18Z",
  "items_total_count": 0,
  "user_name": "Jane Doe",
  "username": "demo",
  "user_avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
  "user_email": "jane@example.com",
  "custom_domain": null,
  "user_plan": "pro",
  "user_plan_active": true,
  "users_total_count": 1,
  "url": "http://demo.dropmark.com/1337",
  "short_url": "http://dpmk.com/0LJFKM0Wk3",
  "thumbnails": {
    "mini": "http://img.dropmark.com/...",
    "small": "http://img.dropmark.com/...",
    "cropped": "http://img.dropmark.com/...",
    "uncropped": "http://img.dropmark.com/...",
    "large": "http://img.dropmark.com/..."
  },
  "permissions": {
    "admin": true,
    "edit": true,
    "share": true,
    "leave": false,
    "delete": true
  }
}

Get a collection

Endpoint

GET https://api.dropmark.com/v1/collections/:collection_id

Query String Params

Name Type Desc
domain String Retrieves collection assocatiated with this domain
include Array Additional objects available to include in response: items, users
items_page Integer Current items page
items_per_page Integer Number of items to return
items_type String Filter returned items to this type: image, video, audio, link, text, other, stack
items_not_type String Don’t include items of this type: image, video, audio, link, text, other, stack
items_parent_id Integer ID of parent item
log_access Boolean Set to true to update last_accessed_at

Response

Status: 200 OK
[
  {
    "id": 1337,
    "user_id": 1,
    "name": "Inspiration",
    "description": null,
    "type": "private",
    "sort": 1,
    "sort_by": null,
    "sort_order": null,
    "view_mode": "tile",
    "thumbnail": null,
    "labels": true,
    "highlighted": false,
    "archived": false,
    "last_accessed_at": "2016-08-12T12:20:18Z",
    "created_at": "2016-08-12T12:20:18Z",
    "updated_at": "2016-08-12T12:20:18Z",
    "items_total_count": 0,
    "user_name": "Jane Doe",
    "username": "demo",
    "user_avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
    "user_email": "jane@example.com",
    "custom_domain": null,
    "user_plan": "pro",
    "user_plan_active": true,
    "users_total_count": 1,
    "url": "http://demo.dropmark.com/1337",
    "short_url": "http://dpmk.com/0LJFKM0Wk3",
    "thumbnails": {
      "mini": "http://img.dropmark.com/...",
      "small": "http://img.dropmark.com/...",
      "cropped": "http://img.dropmark.com/...",
      "uncropped": "http://img.dropmark.com/...",
      "large": "http://img.dropmark.com/..."
    },
    "permissions": {
      "admin": true,
      "edit": true,
      "share": true,
      "leave": false,
      "delete": true
    }
  }
]

List collection tags

Endpoint

GET https://api.dropmark.com/v1/collections/:collection_id/tags

Response

Status: 200 OK
[
  {
    "items_total_count": 3,
    "name": "clever"
  }
]

Update a collection

Endpoint

PUT https://api.dropmark.com/v1/collections/:collection_id

Input

Name Type Desc
name String Collection title
type String Privacy type: private, public, global
archived* Boolean Collection’s archived status
description String Collection description
highlighted* Boolean Collection’s highlighted status
labels* Boolean Set to false to hide item labels in list
sort_by* String Item sort: created_at, updated_at, name, type, size, reactions. Set to null to sort by item’s drag & drop position
sort_order* String Item sort order: asc or desc
thumbnail String Collection thumbnail URL or Base64 image
users Array User IDs of collaborators to invite
user_id Integer Collection owner’s user ID
view_mode* String Item view mode: tile (default), shelf, flow, list

* Available for accounts on a paid plan only

Example

{
  "name": "Inspiration",
  "type": "private"
}

Response

Status: 200 OK
{
  "id": 1337,
  "user_id": 1,
  "name": "Inspiration",
  "description": null,
  "type": "private",
  "sort": 1,
  "sort_by": null,
  "sort_order": null,
  "view_mode": "tile",
  "thumbnail": null,
  "labels": true,
  "highlighted": false,
  "archived": false,
  "last_accessed_at": "2016-08-12T12:20:18Z",
  "created_at": "2016-08-12T12:20:18Z",
  "updated_at": "2016-08-12T12:20:18Z",
  "items_total_count": 0,
  "user_name": "Jane Doe",
  "username": "demo",
  "user_avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
  "user_email": "jane@example.com",
  "custom_domain": null,
  "user_plan": "pro",
  "user_plan_active": true,
  "users_total_count": 1,
  "url": "http://demo.dropmark.com/1337",
  "short_url": "http://dpmk.com/0LJFKM0Wk3",
  "thumbnails": {
    "mini": "http://img.dropmark.com/...",
    "small": "http://img.dropmark.com/...",
    "cropped": "http://img.dropmark.com/...",
    "uncropped": "http://img.dropmark.com/...",
    "large": "http://img.dropmark.com/..."
  },
  "permissions": {
    "admin": true,
    "edit": true,
    "share": true,
    "leave": false,
    "delete": true
  }
}

Delete a collection

Endpoint

DELETE https://api.dropmark.com/v1/collections/:collection_id

Response

Status: 200 OK
{
  "code": "deleted",
  "message": "Collection deleted"
}

Update items order

Endpoint

PUT https://api.dropmark.com/v1/collections/:collection_id/items

Input

Name Type Desc
order Array Array of item IDs (can be subset of IDs rather than all collection item IDs)

Example

{
  "order": [1, 3, 2]
}

Response

Status: 200 OK

Update items

Endpoint

PUT https://api.dropmark.com/v1/collections/:collection_id/items
Name Type Desc
items Array Array of item IDs (required)
collection_id Integer Collection ID to transfer items to
parent_id Integer Stack (item) ID to stack items into
tags array Tags to add to items

Example

{
  "items": [1, 3, 2],
  "collection_id": 1337
}

Response

Status: 200 OK

Delete items

Endpoint

DELETE https://api.dropmark.com/v1/collections/:collection_id/items
Name Type Desc
items Array Array of item IDs to be deleted (required)

Example

{
  "items": [1, 3, 2]
}

Response

Status: 200 OK

List collaborators

Endpoint

GET https://api.dropmark.com/v1/collections/:collection_id/users

Response

Status: 200 OK
[
  {
    "id": 1,
    "name": "Jane Doe",
    "email": "jane@example.com",
    "user_avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
    "username": "demo",
    "plan": "pro",
    "billing_email": null,
    "kind": "owner",
    "is_subscribed": true
  }
]

Add a collaborator

Endpoint

POST https://api.dropmark.com/v1/collections/:collection_id/users

Input

Name Type Desc
email String Email of collaborator (required if id or username aren’t provided)
id Integer User ID of collaborator (required if email or username aren’t provided)
username String Username of collaborator (required if email or id aren’t provided)

Example

{
  "email": "jane@example.com"
}

Response

Status: 201 Created
{
  "id": 1,
  "name": "Jane Doe",
  "email": "jane@example.com",
  "user_avatar": "https://gravatar.com/avatar/db450747b81669f6cea",
  "username": "demo",
  "plan": "pro",
  "billing_email": null,
  "kind": "owner",
  "is_subscribed": true
}

Remove a collaborator

Endpoint

DELETE https://api.dropmark.com/v1/collections/:collection_id/users/:user_id

Response

Status: 200 OK
{
  "code": "deleted",
  "message": "User removed from collection"
}