Skip to content

Instantly share code, notes, and snippets.

@dtrenz
Created November 5, 2013 15:08
Show Gist options
  • Save dtrenz/7320427 to your computer and use it in GitHub Desktop.
Save dtrenz/7320427 to your computer and use it in GitHub Desktop.
Copy REST API Postman Collection
{
"id": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"name": "Copy API (REST)",
"description": "## API Calls\n\nThis is the meat and potatoes of this document. Here we'll discuss the various API calls you can make to our servers, along with what inputs we require, and what outputs you can expect back, and the required permissions to perform the request. Since this is a RESTful JSON API, you will need to know the URLs ahead of time.\n\nIn the URLs of the sample requests, words that appear in all CAPITAL letters represent the part of the URL which is meant to be changed by you, the developer, depending on the intention of your request.\n\n##### Request Headers\n\nYou will need to provide the following two HTTP request headers while talking to the Copy API:\n\n* **X-Api-Version**: 1\n* **Accept**: application/json\n\n##### Response Headers\n\nHere's a list of some typical response headers to expect from our server, most of which can be ignored.\n\n* **Access-Control-Allow-Headers**: X-AUTHORIZATION-ANON, X-AUTHORIZATION, X-CLIENT-VERSION, X-CLIENT-TYPE, X-CLIENT-OSVERSION, X-CLIENT-HWID, X-CLIENT-NAME, X-API-VERSION, X-REQUESTED-WITH, X-HTTP-METHOD-OVERRIDE, CONTENT-TYPE\n* **Access-Control-Allow-Methods**: POST, GET, PUT, PATCH, DELETE, OPTIONS\n* **Access-Control-Allow-Origin**: *.copy.com\n* **Access-Control-Max-Age**: 1728000\n* **Cache-Control**: no-cache\n* **Connection**: keep-alive\n* **Date**: Wed, 27 Mar 2013 21:19:39 GMT\n* **Server**: nginx/1.2.7\n* **Transfer-Encoding**: chunked\n* **X-Powered-By**: PHP/5.4.12\n* **X-Copy-Time**: 1364419178\n* **Content-Type**: application/json\n\n**X-Copy-Time**: The current time, according to the Copy server. This is useful for comparing timestamp times and keeping relative time working as expected:\n\n**Content-Type**: Since we have a RESTful JSON api, most of our responses should be JSON encoded. A notable exception is performing a GET request on the `files` section of the API for a file, or the `thumbs` section of the API for an image thumbnail.\n\n##### HTTP Verbs\n\nThe Copy.com API makes use of the four primary HTTP verbs. Here's an overview of what each one does:\n\n* **GET**: Returns information about the resource at the specified URL\n* **POST**: Creates a new entry at the specified resource collection URL\n* **PUT**: Updates an entry at the specified resource URL\n* **DELETE**: Deletes an entry at the specified resource URL\n\nWhen performing a **GET** or **DELETE** request, the URL typically specifies the particular item being retreived or removed. When performing a **PUT** request, the URL also specifies the item being acted upon, and the data to be sent is in the form of a JSON document as the body of the request. When performing a **POST** request, the URL doesn't mention the specific resource ID in it, but actually the parent collection, as we are actually acting upon the collection and not an existing record. The POST body is also a JSON document.\n\n##### Time\n\nWhen retrieving timestamp information, the API will always send a [UNIX timestamp](http://en.wikipedia.org/wiki/Unix_time), which is the number of seconds since the UNIX epoch on January 1st, 1970. An example time may look like this:\n\n\t1365103180\n\nThis timestamp is based on UTC time. Converting this timestamp into a format consumable by your language should be relatively easy. Here are a few examples:\n\n###### PHP\n\n\t<?php\n\techo date('Y m d H:i:s', 1365103180);\n\t# 2013 04 04 15:19:40\n\n###### JavaScript\n\n\tvar date = new Date(1365103180 * 1000);\n\tconsole.log(date);\n\t// Thu Apr 04 2013 15:19:40 GMT-0400 (EDT)\n",
"order": [],
"folders": [
{
"id": "811239fd-caf2-b343-e0bf-6fac2cb4a21e",
"name": "Filesystem",
"description": "",
"order": [
"f6da4756-ec95-5d31-7d77-2f8c48958ede",
"6747c7da-4504-04b8-c773-835a3d30cdaf",
"e3865dbc-604b-11b8-0370-e576fe860f18",
"898d1d09-0528-2618-2a62-cadada23c928",
"00a32176-0eac-abe7-5e66-5dfa9684d327",
"16eef1b5-9211-0e8b-f103-8ee329c62193",
"3683dd18-999b-8351-1f3d-fdc1318e63e5",
"8da9499f-da12-e180-26ed-60735f211392",
"b6262864-9c13-bdee-27c9-ade4bc5622ca",
"b6f4e29a-ac25-77ea-b6e7-dc48fa4c32ae",
"ede80736-3382-0582-329f-01692726d109",
"32c7b2e5-15a4-1cbb-6caa-0897588b05ee"
],
"collection_name": "Copy API (REST)",
"collection_id": "c64a107a-39ab-27b4-9c37-d93b1e187589"
},
{
"id": "0473c1c8-baf5-14ce-2c86-26987acbb6b4",
"name": "Links",
"description": "",
"order": [
"eda64e3b-ce14-f766-bcd2-ffcc5458e7c4",
"e2d5b3da-ba40-51f4-1ea3-edc90edd470e",
"cb1bc5bb-c495-7076-658c-7af60ced3453",
"5475790e-d390-1040-82a6-159be6198e5d",
"aa4c4b63-663c-1212-52ba-6c263df5c6b2",
"f1014f13-3e66-ab7c-1940-f24e94ea1c67"
],
"collection_name": "Copy API (REST)",
"collection_id": "c64a107a-39ab-27b4-9c37-d93b1e187589"
},
{
"id": "27d85da8-2d51-9920-89c9-fe4147220f8e",
"name": "User Profile",
"description": "",
"order": [
"745af241-d8da-4e03-0762-5d7027a8181e",
"3021cc45-35f8-8bf3-48af-0080c4c5f4e1"
],
"collection_name": "Copy API (REST)",
"collection_id": "c64a107a-39ab-27b4-9c37-d93b1e187589"
}
],
"timestamp": 1383593590981,
"synced": false,
"requests": [
{
"id": "00a32176-0eac-abe7-5e66-5dfa9684d327",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/meta/copy/test.jpg/@activity",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600098342,
"name": "/meta/copy/file/@activity",
"description": "##### Permissions\n* `filesystem.read`: Required\n* `profile.email.read`: Required to get the revisions.creator.email attributes\n\nThis returns a listing of the different revisions that have been made to the file. Whenever you see a `revision\\_id` value, it is a unique number to identify a revision. These numbers are not sequential per file. You will need to make this request to get a listing of the different revisions on a file (although a normal request can get you the most current `revision\\_id` of the file).\n\nA revision will have the conflict attribute set to true if a client uploads a file more recently than a different file while having an older timestamp.\n\nIf different users are editing the same file (e.g., the file is within a SYNC'd share directory), different revisions will have different users attached to them.\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"/copy/Big%20API%20Changes/API-Changes.md/@activity\",\n\t \"path\": \"/Big API Changes/API-Changes.md\",\n\t \"name\": \"Activity\",\n\t \"token\": null,\n\t \"permissions\": null,\n\t \"syncing\": false,\n\t \"public\": false,\n\t \"type\": \"file\",\n\t \"size\": 12670,\n\t \"date_last_synced\": 1365543105,\n\t \"stub\": false,\n\t \"recipient_confirmed\": false,\n\t \"url\": \"https://copy.com/web/Big%20API%20Changes/API-Changes.md\",\n\t \"revision_id\": \"5000\",\n\t \"thumb\": null,\n\t \"share\": null,\n\t \"counts\": [\n\t ],\n\t \"links\": [\n\t ],\n\t \"revisions\": [\n\t {\n\t \"revision_id\": \"5000\",\n\t \"modified_time\": 1365543105,\n\t \"size\": 12670,\n\t \"latest\": true,\n\t \"conflict\": false,\n\t \"id\": \"/copy/Big%20API%20Changes/API-Changes.md/@activity/@time:1365543105\",\n\t \"type\": \"revision\",\n\t \"creator\": {\n\t \"user_id\": \"1381231\",\n\t \"created_time\": 1358175510,\n\t \"email\": \"thomashunter@example.com\",\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\",\n\t \"confirmed\": true\n\t }\n\t },\n\t {\n\t \"revision_id\": \"4900\",\n\t \"modified_time\": 1365542000,\n\t \"size\": 12661,\n\t \"latest\": false,\n\t \"conflict\": true,\n\t \"id\": \"/copy/Big%20API%20Changes/API-Changes.md/@activity/@time:1365542000\",\n\t \"type\": \"revision\",\n\t \"creator\": {\n\t \"user_id\": \"1381231\",\n\t \"created_time\": 1358175510,\n\t \"email\": \"thomashunter@example.com\",\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\",\n\t \"confirmed\": true\n\t }\n\t },\n\t {\n\t \"revision_id\": \"4800\",\n\t \"modified_time\": 1365543073,\n\t \"size\": 12658,\n\t \"latest\": false,\n\t \"conflict\": false,\n\t \"id\": \"/copy/Big%20API%20Changes/API-Changes.md/@activity/@time:1365543073\",\n\t \"type\": \"revision\",\n\t \"creator\": {\n\t \"user_id\": \"1381231\",\n\t \"created_time\": 1358175510,\n\t \"email\": \"thomashunter@example.com\",\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\",\n\t \"confirmed\": true\n\t }\n\t }\n\t ]\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "16eef1b5-9211-0e8b-f103-8ee329c62193",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/meta",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383659790030,
"name": "/meta",
"description": "##### Permissions\n* `filesystem.read`: Required\n* `inbox.read`: Required for the /inbox child element\n\nThe `/rest/meta` entrypoint into the API represents the top-most level of the filesystem. This level sort of shows a listing of the real filesystems below it. Think of this location as the _My Computer_ of a Windows environment. You can't write to this location, just browse it.\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"/\",\n\t \"path\": \"/\",\n\t \"name\": \"Copy\",\n\t \"type\": \"root\",\n\t \"stub\": false,\n\t \"children\": [\n\t {\n\t \"id\": \"/copy\",\n\t \"path\": \"/\",\n\t \"name\": \"Copy Folder\",\n\t \"type\": \"copy\",\n\t \"stub\": true\n\t },\n\t {\n\t \"id\": \"/inbox\",\n\t \"path\": \"/\",\n\t \"name\": \"Shared With Me\",\n\t \"type\": \"inbox\",\n\t \"stub\": true,\n\t \"counts\": {\n\t \"count_new\": 7,\n\t \"count_viewed\": 30,\n\t \"count_hidden\": 95\n\t }\n\t }\n\t ]\n\t}\n\nThe stub flag you see on all of the nodes represents if the specified node is incomplete, that is, if the children have not all been delivered to you. Basically, they will always be a stub, unless you are looking at that item directly.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
},
{
"id": "3021cc45-35f8-8bf3-48af-0080c4c5f4e1",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\nContent-Type: application/json\n",
"url": "{{base_url}}/user",
"pathVariables": {},
"method": "PUT",
"data": "{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n}",
"dataMode": "raw",
"version": 2,
"time": 1383598367388,
"name": "/user",
"description": "##### Permissions\n* `profile.write`: Required\n* `profile.read`: Required to get the response back from the server\n* `profile.email.read`: Required to get the .emails[].email and .email attributes in the response back from the server\n\nThis request can be used to update the users first name and their last name.\n\nThe response from this request is the same as the corresponding GET request above, however, the storage attribute will be missing.\n\n##### Example Request\n\n\t{\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\"\n\t}\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"1381231\",\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\",\n\t \"developer\": true,\n\t \"created_time\": 1358175510,\n\t \"push_token\": \"33eda843fbcfed0522bdb0a704984425b553dbe9\",\n\t \"email\": \"thomashunter@example.com\",\n\t \"emails\": [\n\t {\n\t \"primary\": true,\n\t \"confirmed\": true,\n\t \"email\": \"thomashunter@example.com\",\n\t \"gravatar\": \"eca957c6552e783627a0ced1035e1888\"\n\t },\n\t {\n\t \"primary\": false,\n\t \"confirmed\": true,\n\t \"email\": \"thomashunter@example.net\",\n\t \"gravatar\": \"c0e344ddcbabb383f94b1bd3486e55ba\"\n\t }\n\t ]\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
},
{
"id": "32c7b2e5-15a4-1cbb-6caa-0897588b05ee",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/thumbs/test.jpg?size=64",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600012488,
"name": "/thumbs/test.jpg (upload)",
"description": "##### Permissions\n* `filesystem.read`: Required\n\nThis request will return a thumbnail image of the image at the specified path. The returned image will be at MOST the provided size. For example, if you have an image which is `200x320` pixels, and you load the image with the size paramater set to `32`, the returned image will be `20x32` pixels.\n\nIf you plan on serving these images up to your client in a browser, you will need to create a proxy, since you need to pass along the OAuth paramaters with this request. Attempting to load the image from the browser directly will cause an error.\n\nThe response will be a binary image file. The content type will be either `image/jpeg` for JPEG images, or `image/png` for all other types of image formats.\n\n##### Valid Sizes\n\nIf a `size` attribute different than the ones listed here is provided, a thumbnail of size 32 will be returned.\n\n* 32\n* 64\n* 128\n* 256\n* 512\n* 1024\n",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "3683dd18-999b-8351-1f3d-fdc1318e63e5",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files/test.jpg?overwrite=true",
"pathVariables": {},
"method": "PUT",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600076163,
"name": "/files/file",
"description": "##### Permissions\n* `filesystem.write`: Required\n\nUpdates a file. Returns a `200` status code on success.\n\nThe maximum filesize of an upload is 1GB. An API endpoint supporting chunked file uploading is planned for circumventing this limitation.\n\nPerform a `multipart/form-data` upload to the URL, and it will replace the contents of the file which existed there previously.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "5475790e-d390-1040-82a6-159be6198e5d",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\nContent-Type: application/json\n",
"url": "{{base_url}}/links/{{link_token}}",
"pathVariables": {},
"method": "PUT",
"data": "{\n \"token\": \"vNGZ69Y9ApHI\"\n \"recipients\": [\n {\n \"email\": \"nobody@example.com\",\n \"permissions\": \"read\"\n }\n ]\n}",
"dataMode": "raw",
"version": 2,
"time": 1383661189930,
"name": "/links/TOKEN",
"description": "##### Permissions\n* `links.write`: Required\n\nWhen performing a _PUT_ operation on a link, having the recipient attribute set with a recipient object within the array will append that user to the list of recipients. This is done so that you don't need to keep track of all the recipients when making changes.\n\nIf you would like to clear out all of the recipients, you can send the recipients attribute as an empty array `[]`.\n\nIf you would like to remove a single contact at a time, you can set a `remove` attribute within the individual recipient object.\n\n##### Example Request\n\n\t{\n\t \"public\": true,\n\t \"name\": \"New Name\",\n\t \"token\": \"YyvXNbkDgSvI\"\n\t \"paths\": [\n\t \"/bad-binding-of-isaac.png\"\n\t ],\n\t \"recipients\": [\n\t {\n\t \"email\": \"alexkinnee@example.com\",\n\t \"permissions\": \"read\"\n\t }\n\t ]\n\t}\n\nThis request also returns a complete version of the document.\n\n**NOTE**: The `token` attribute is currently required, and the TOKEN in the URL needs to be present and the same value.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "6747c7da-4504-04b8-c773-835a3d30cdaf",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files/test.txt",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600335841,
"name": "/files/file",
"description": "##### Required Permissions\n* `filesystem.read`: Required\n* `links.read`: Required for children[].token, children[].links[] attributes to be available\n\nThis request is useful for getting the binary contents of a file.\n\nThe path is similar to the `/rest/meta/copy` requests, except that the `copy` url segment isn't required. For example, the following two URLs correlate to the same file:\n\n* https://api.copy.com/rest/meta/copy/subdirectory/file.txt\n* https://api.copy.com/rest/files/subdirectory/file.txt\n\nThe response to this request is NOT a JSON representation of data, it is instead the actual contents of the file, as if it were being downloaded. Please note that if you are building a third party web application, you will need to have a local proxy for this before downloading data to your user, as requesting the file directly will return an error since the OAuth headers will not be present.\n\nNote that when making the `meta` requests above, there is an attribute called `object_available`. If this attribute is set to false, it means the file is still being uploaded, and making this `files` request will fail as the file will not yet be available.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
},
{
"id": "745af241-d8da-4e03-0762-5d7027a8181e",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/user",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383598352372,
"name": "/user",
"description": "##### Permissions\n* `profile.read`: Required\n* `profile.email.read`: Required to get the .emails[].email and .email attributes\n\nThis API call will give you basic information about a users account. The contents of the returned document will vary depending on what permissions you have access to.\n\nThe `storage` attribute contains storage information in bytes. The `used` attribute is the number of bytes currently being used by the user. The `quota` attribute is the total number of bytes the user can use. The `saved` attribute is the number of bytes the user is saving from using against their quota by using our Fair Storage calculation.\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"1381231\",\n \"storage\":{\n \"used\": 9207643837,\n \"quota\": 1100585369600,\n \"saved\": 14557934927\n },\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\",\n\t \"developer\": true,\n\t \"created_time\": 1358175510,\n\t \"email\": \"thomashunter@example.com\",\n\t \"emails\": [\n\t {\n\t \"primary\": true,\n\t \"confirmed\": true,\n\t \"email\": \"thomashunter@example.com\",\n\t \"gravatar\": \"eca957c6552e783627a0ced1035e1888\"\n\t },\n\t {\n\t \"primary\": false,\n\t \"confirmed\": true,\n\t \"email\": \"thomashunter@example.net\",\n\t \"gravatar\": \"c0e344ddcbabb383f94b1bd3486e55ba\"\n\t }\n\t ]\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
},
{
"id": "898d1d09-0528-2618-2a62-cadada23c928",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/meta/copy/test.jpg/@activity/@time:1365532651",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600106951,
"name": "/meta/copy/file/@activity/@time",
"description": "##### Permissions\n* `filesystem.read`: Required\n* `links.read`: Required for links attribute to be available\n\nReturns information about the file at the specified revision. You can get the URL for this from the above request.\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"/copy/Big%20API%20Changes/API-Changes.md/@activity/@time:1365532651\",\n\t \"path\": \"/Big API Changes/API-Changes.md\",\n\t \"name\": \"API-Changes.md\",\n\t \"token\": null,\n\t \"permissions\": null,\n\t \"syncing\": false,\n\t \"public\": false,\n\t \"type\": \"file\",\n\t \"size\": 12666,\n\t \"date_last_synced\": 1365532651,\n\t \"stub\": false,\n\t \"recipient_confirmed\": false,\n\t \"url\": \"https://copy.com/web/Big%20API%20Changes/API-Changes.md?revision=4898\",\n\t \"revision_id\": 4898,\n\t \"thumb\": null,\n\t \"share\": null,\n\t \"counts\": [\n\t ],\n\t \"links\": [\n\t ]\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
},
{
"id": "8da9499f-da12-e180-26ed-60735f211392",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files/test.jpg?name=newtest.jpg&overwrite=true",
"pathVariables": {},
"method": "PUT",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600068154,
"name": "/files/file (rename)",
"description": "##### Permissions\n* `filesystem.write`: Required\n\nPerforms a rename of the file, where the file stays in the same directory but its name has changed. Think of this as a relative move. Returns a `200` status code on success.\n\nThe `overwrite` parameter is optional and defaults to `true`, which will cause a file rename to overwrite any existing file named `name`. If it is set to `false`, the filename will have some text appended automatically to prevent an overwrite. For example, `TPS\\_Report.pdf` would be renamed `TPS\\_Report (1).pdf`. If an item exists with the same number in parenthesis, the next available number will be chosen. The resulting filename will be returned in the response.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "aa4c4b63-663c-1212-52ba-6c263df5c6b2",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\nContent-Type: application/json\n",
"url": "{{base_url}}/links/{{link_token}}",
"pathVariables": {},
"method": "DELETE",
"data": "",
"dataMode": "raw",
"version": 2,
"time": 1383600803321,
"name": "/links/TOKEN",
"description": "#### Permissions\n* `links.write`: Required\n\nUse this to delete a link the user owns.\n\n##### Example Response (204 No Content)\n\n\t<EMPTY DOCUMENT>\n\n##### Example Response (400 Bad Request)\n\n\t{\n\t \"error\": 1021,\n\t \"message\": \"Cannot find link YyvXNbkDgSvI\"\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "b6262864-9c13-bdee-27c9-ade4bc5622ca",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files/test.jpg?path=/test/test.jpg&overwrite=true",
"pathVariables": {},
"method": "PUT",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600058398,
"name": "/files/file (move)",
"description": "##### Permissions\n* `filesystem.write`: Required\n\nPerforms a move of the file, where the file moves into a new directory. The `path` variable is an absolute path. Returns a `200` status code on success.\n\nThe `overwrite` parameter is optional and defaults to `true`, which will cause a file move to overwrite any existing file at `path`. If it is set to `false`, the filename will have some text appended automatically to prevent an overwrite. For example, `Docs/TPS\\_Report.pdf` would be renamed `Docs/TPS\\_Report (1).pdf`. If an item exists with the same number in parenthesis, the next available number will be chosen. The resulting filename will be returned in the response.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "b6f4e29a-ac25-77ea-b6e7-dc48fa4c32ae",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files/test",
"pathVariables": {},
"method": "POST",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383599830429,
"name": "/files/dir (create folder)",
"description": "##### Permissions\n* `filesystem.write`: Required\n\n**Creating a Directory**: If you perform a _POST_ to the URL, provide the name of the directory within the URL that you would like to create. For example, if you wanted to create a new directory Phylum within an existing directory Kingdom located at the root of the users Copy directory, you would do `POST files/Kingdom/Phylum` with an empty body.\n\n##### Example Response (201 Created) [Creating a Folder]\n\n\t{\n\t \"id\": \"/copy/test/test\",\n\t \"path\": \"/test/test\",\n\t \"name\": \"test\",\n\t \"token\": null,\n\t \"permissions\": null,\n\t \"syncing\": false,\n\t \"public\": false,\n\t \"type\": \"dir\",\n\t \"size\": null,\n\t \"date_last_synced\": 1366986969,\n\t \"stub\": false,\n\t \"recipient_confirmed\": false,\n\t \"counts\": [\n\t ],\n\t \"url\": \"https://copy.com/web/test/test\",\n\t \"links\": [\n\t ],\n\t \"thumb\": null,\n\t \"share\": null\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "cb1bc5bb-c495-7076-658c-7af60ced3453",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\nContent-Type: application/json\n",
"url": "{{base_url}}/links",
"pathVariables": {},
"method": "POST",
"data": "{\n \"public\": true,\n \"name\": \"Test Link\",\n \"paths\": [\n \"test.png\"\n ]\n}",
"dataMode": "raw",
"version": 2,
"time": 1383659722894,
"name": "/links",
"description": "##### Permissions\n* `links.write`: Required\n\nThe `paths` attribute is required, and is an array of paths to be included in a link. You can have multiple files and directories specified when you create a link, the only rule is that they need to all be siblings in the filesystem (e.g., all exist within the same directory). This starts beneath the `/copy` entry point in the filesystem.\n\nThe `public` attribute specifies whether or not the generated link can be viewed by anybody with the URL, meaning unauthenticated users or authenticated users who are not mentioned in the recipient link. It is optional and defaults to true.\n\nThe response for this request will be a complete document, as if you had made the GET request above. You'll probably want to parse this response to get the new token ID / URL for the link.\n\n**NOTE**: Recipients cannot be set during a POST, they need to be set later during a PUT.\n\n##### Example Request\n\n\t{\n\t \"public\": true,\n\t \"name\": \"My Cool Shared Files\",\n\t \"paths\": [\n\t \"/path/to/file.txt\"\n\t ]\n\t}\n\n##### Example Response (201 Created)\n\n\t{\n\t \"id\": \"MBrss3roGDk4\",\n\t \"name\": \"My Cool Shared Files\",\n\t \"public\": true,\n\t \"url\": \"https://copy.com/MBrss3roGDk4\",\n\t \"url_short\": \"https://copy.com/MBrss3roGDk4\",\n\t \"creator_id\": \"1381231\",\n\t \"confirmation_required\": false,\n\t \"status\": \"viewed\",\n\t \"permissions\": \"read\",\n\t \"recipients\": [\n\t ]\n\t}\n\n##### Example Response (400 Bad Request)\n\n\t{\n\t \"error\": 1303,\n\t \"message\": \"No path(s) specified.\"\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "e2d5b3da-ba40-51f4-1ea3-edc90edd470e",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/links",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600463416,
"name": "/links",
"description": "##### Permissions\n* `links.read`: Required\n\nThis call will return a comprehensive listing of every link created by the user. This call can be slow, so it is recommended that you cache the results. Note that the recipients array will always be empty (otherwise the request would be even slower). The `name` attribute is used when the user chooses to share the link with people via their email addresses, and they enter a subject line for the email.\n\n##### Example Response (200 OK)\n\n\t[\n\t {\n\t \"id\": \"sCxkowlraze1\",\n\t \"name\": \"Big API Changes\",\n\t \"public\": true,\n\t \"url\": \"https://copy.com/sCxkowlraze1\",\n\t \"url_short\": \"https://copy.com/sCxkowlraze1\",\n\t \"creator_id\": \"1381231\",\n\t \"created_time\": 1366825349,\n\t \"object_count\": 1,\n\t \"confirmation_required\": false,\n\t \"status\": \"viewed\",\n\t \"permissions\": \"read\",\n\t \"recipients\": [\n\t ]\n\t },\n\t {\n\t \"id\": \"f6e4fNxrtwY8\",\n\t \"name\": \"to\",\n\t \"public\": true,\n\t \"url\": \"https://copy.com/f6e4fNxrtwY8\",\n\t \"url_short\": \"https://copy.com/f6e4fNxrtwY8\",\n\t \"creator_id\": \"1381231\",\n\t \"created_time\": 1366817886,\n\t \"object_count\": 1,\n\t \"confirmation_required\": false,\n\t \"status\": \"viewed\",\n\t \"permissions\": \"read\",\n\t \"recipients\": [\n\t ]\n\t },\n\t {\n\t \"id\": \"MBzss3r2GXk4\",\n\t \"name\": \"\",\n\t \"public\": true,\n\t \"url\": \"https://copy.com/MBzss3r2GXk4\",\n\t \"url_short\": \"https://copy.com/MBzss3r2GXk4\",\n\t \"creator_id\": \"1381231\",\n\t \"created_time\": 1366817750,\n\t \"object_count\": 1,\n\t \"confirmation_required\": false,\n\t \"status\": \"viewed\",\n\t \"permissions\": \"read\",\n\t \"recipients\": [\n\t ]\n\t }\n\t]",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "e3865dbc-604b-11b8-0370-e576fe860f18",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/meta/copy",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383598384373,
"name": "/meta/copy",
"description": "##### Permissions\n* `filesystem.read`: Required\n* `links.read`: Required for children[].token, children[].links[] attributes to be available\n\nThis call represents the first level of the real filesystem. You can add more levels of depth to the URL in accordance with the users filesystem. For example, if you would like to read data from a top level directory named Applications, the URL would be https://api.copy.com/rest/meta/copy/Applications.\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"/copy\",\n\t \"path\": \"/\",\n\t \"name\": \"Copy Folder\",\n\t \"type\": \"copy\",\n\t \"size\": null,\n\t \"date_last_synced\": null,\n\t \"stub\": false,\n\t \"children\": [\n\t {\n\t \"id\": \"/copy/Applications\",\n\t \"path\": \"/Applications\",\n\t \"name\": \"Applications\",\n\t \"link_name\": \"\",\n\t \"token\": \"\",\n\t \"permissions\": \"\",\n\t \"public\": false,\n\t \"type\": \"dir\",\n\t \"size\": null,\n\t \"date_last_synced\": 1360079517,\n\t \"stub\": true,\n\t \"counts\": [\n\t ],\n\t \"recipient_confirmed\": false,\n\t \"object_available\": true,\n\t \"links\": [\n\t {\n\t \"id\": \"hPTBeqqN9Bg9\",\n\t \"public\": true,\n\t \"expires\": false,\n\t \"expired\": false,\n\t \"url\": \"https://copy.com/hPTBeqqN9Bg9/Applications\",\n\t \"url_short\": \"https://copy.com/hPTBeqqN9Bg9\",\n\t \"recipients\": [\n\t ],\n\t \"creator_id\": \"1381231\",\n\t \"confirmation_required\": false\n\t }\n\t ],\n\t \"url\": \"https://copy.com/web/Applications\",\n\t \"thumb\": false\n\t },\n\t {\n\t \"id\": \"/copy/binding-of-isaac.png\",\n\t \"path\": \"/binding-of-isaac.png\",\n\t \"name\": \"binding-of-isaac.png\",\n\t \"link_name\": \"\",\n\t \"token\": \"\",\n\t \"permissions\": \"\",\n\t \"public\": false,\n\t \"type\": \"file\",\n\t \"size\": 164850,\n\t \"date_last_synced\": 1363573463,\n\t \"stub\": true,\n\t \"counts\": [\n\t ],\n\t \"recipient_confirmed\": false,\n\t \"object_available\": true,\n\t \"links\": [\n\t ],\n\t \"url\": \"https://copy.com/web/bad-binding-of-isaac.png\",\n\t \"revision_id\": 2897,\n\t \"thumb\": \"https://copy.com/thumbs/bad-binding-of-isaac.png\",\n\t \"thumb_original_dimensions\": {\n\t \"width\": 800,\n\t \"height\": 620\n\t }\n\t }\n\t ]\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
},
{
"id": "eda64e3b-ce14-f766-bcd2-ffcc5458e7c4",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/links/{{link_token}}",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600326470,
"name": "/links/TOKEN",
"description": "##### Permissions\n* `links.read`: Required\n\nThis call will retreive information about the identified link.\n\n##### Example Response (200 OK)\n\n\t{\n\t \"id\": \"wFIK8aMIDvh2\",\n\t \"name\": \"Such a cool Link\",\n\t \"public\": false,\n\t \"url\": \"https://copy.com/wFIK8aMIDvh2\",\n\t \"url_short\": \"https://copy.com/wFIK8aMIDvh2\",\n\t \"creator_id\": \"110660\",\n\t \"created_time\": 1366825349,\n\t \"object_count\": 1,\n\t \"confirmation_required\": false,\n\t \"status\": \"viewed\",\n\t \"permissions\": \"sync\",\n\t \"recipients\": [\n\t {\n\t \"contact_type\": \"user\",\n\t \"contact_id\": \"user-1381231\",\n\t \"contact_source\": \"link-3514165\",\n\t \"user_id\": \"1381231\",\n\t \"email\": \"thomashunter@example.com\",\n\t \"first_name\": \"Thomas\",\n\t \"last_name\": \"Hunter\",\n\t \"permissions\": \"sync\",\n\t \"emails\": [\n\t {\n\t \"primary\": true,\n\t \"confirmed\": true,\n\t \"email\": \"thomashunter@example.com\",\n\t \"gravatar\": \"eca957c6552e783627a0ced1035e1888\"\n\t },\n\t {\n\t \"primary\": false,\n\t \"confirmed\": true,\n\t \"email\": \"thomashunter@example.net\",\n\t \"gravatar\": \"c0e344ddcbabb383f94b1bd3486e55ba\"\n\t }\n\t ]\n\t }\n\t ]\n\t}\n\n##### Example Response (404 Not Found)\n\n\t{\n\t \"error\": 1021,\n\t \"message\": \"Cannot find link InVaL1Dt0k3n\"\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "ede80736-3382-0582-329f-01692726d109",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files",
"pathVariables": {},
"method": "POST",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383599827508,
"name": "/files/file (upload)",
"description": "##### Permissions\n* `filesystem.write`: Required\n\n**Creating a File**: If you perform a POST to the URL, provide the name of the existing directory that the file will live in. The filename is not a part of the URL, but is instead derived from the upload form. For example, to add a file named Thomas.txt to a directory named Employees in the root of the uers Copy directory, you would do `POST files/Employees` with a content type of `multipart/form-data` and the filename in the _Content Disposition_ area of the upload body (see example below). It may sound complex, but it's a simple standardized HTTP file upload.\n\nThe maximum filesize of an upload is 1GB. An API endpoint supporting chunked file uploading is planned for circumventing this limitation.\n\nThe `overwrite` parameter is optional and defaults to `true`, which will cause a new file to overwrite any existing file at the same location. If it is set to `false`, the filename will have some text appended automatically to prevent an overwrite. For example, `Docs/TPS\\_Report.pdf` would be renamed `Docs/TPS\\_Report (1).pdf`. If an item exists with the same number in parenthesis, the next available number will be chosen. The resulting filename will be returned in the response. This doesn't apply to creating a new folder with the same name as an existing folder, the existing folder will be returned.\n\n##### Example Request [Creating a File]\n\n\tContent-Type:multipart/form-data; boundary=----BOUNDARYRn6JpCAjA8RWn\n\n\t------BOUNDARYRn6JpCAjA8RWn\n\tContent-Disposition: form-data; name=\"file\"; filename=\"animation.gif\"\n\tContent-Type: image/gif\n\n\tRAW-BINARY-FILE-CONTENT\n\t------BOUNDARYRn6JpCAjA8RWn--\n\n##### Example Response (201 Created) [Creating a File]\n\n\t{\n\t \"objects\": [\n\t {\n\t \"id\": \"/copy/test/test/animation.gif\",\n\t \"path\": \"/test/test/animation.gif\",\n\t \"name\": \"animation.gif\",\n\t \"token\": null,\n\t \"permissions\": null,\n\t \"syncing\": false,\n\t \"public\": false,\n\t \"type\": \"file\",\n\t \"size\": 456357,\n\t \"date_last_synced\": 1366987166,\n\t \"stub\": false,\n\t \"recipient_confirmed\": false,\n\t \"counts\": [\n\t ],\n\t \"url\": \"https://copy.com/web/test/test/animation.gif\",\n\t \"links\": [\n\t ],\n\t \"revision\": 5293,\n\t \"thumb\": null,\n\t \"share\": null\n\t }\n\t ]\n\t}",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "f1014f13-3e66-ab7c-1940-f24e94ea1c67",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\nContent-Type: application/json\n",
"url": "{{base_url}}/links/{{link_token}}",
"pathVariables": {},
"method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600854707,
"name": "/meta/links/TOKEN",
"description": "##### Permissions\n* `links.read`: Required\n\nThis API call will return a listing of files attached to a link. Notice that the URL begins with /meta/. When getting deeper into the links subdirectories, they are appended to the URL, like the rest of the filesystem calls.\n\n##### Example Response (200 OK) [Token Root]\n\n {\n \"id\": \"/links/e6aauE2WodKj\",\n \"path\": \"/e6aauE2WodKj\",\n \"name\": \"Artwork\",\n \"token\": \"e6aauE2WodKj\",\n \"creator_id\": \"1381231\",\n \"permissions\": \"read\",\n \"syncing\": false,\n \"public\": true,\n \"type\": \"link\",\n \"size\": null,\n \"date_last_synced\": null,\n \"stub\": false,\n \"recipient_confirmed\": false,\n \"counts\": [\n ],\n \"children_count\": null,\n \"mime_type\": \"\",\n \"url\": \"http://copy.local/e6aauE2WodKj\",\n \"links\": [\n ],\n \"thumb\": null,\n \"share\": null,\n \"children\": [\n {\n \"id\": \"/links/e6aauE2WodKj/Artwork\",\n \"path\": \"/e6aauE2WodKj/Artwork\",\n \"name\": \"Artwork\",\n \"link_name\": null,\n \"token\": null,\n \"creator_id\": null,\n \"permissions\": null,\n \"public\": false,\n \"type\": \"dir\",\n \"size\": null,\n \"date_last_synced\": null,\n \"stub\": true,\n \"recipient_confirmed\": false,\n \"object_available\": true,\n \"counts\": [\n ],\n \"mime_type\": \"\",\n \"list_index\": 0,\n \"url\": \"http://copy.local/e6aauE2WodKj/Artwork\",\n \"revision\": 0,\n \"thumb\": null,\n \"links\": [\n ]\n }\n ]\n }\n\n##### Example Response (200 OK) [Token Subdirectory]\n\n {\n \"id\": \"/links/e6aauE2WodKj/Artwork\",\n \"path\": \"/e6aauE2WodKj/Artwork\",\n \"name\": \"Artwork\",\n \"token\": null,\n \"creator_id\": null,\n \"permissions\": null,\n \"syncing\": false,\n \"public\": false,\n \"type\": \"dir\",\n \"size\": null,\n \"date_last_synced\": null,\n \"stub\": false,\n \"recipient_confirmed\": false,\n \"counts\": [\n ],\n \"children_count\": null,\n \"mime_type\": \"\",\n \"url\": \"http://copy.local/e6aauE2WodKj/Artwork\",\n \"links\": [\n ],\n \"thumb\": null,\n \"share\": null,\n \"children\": [\n {\n \"id\": \"/links/e6aauE2WodKj/Artwork/blue-eyes.jpg\",\n \"path\": \"/e6aauE2WodKj/Artwork/blue-eyes.jpg\",\n \"name\": \"blue-eyes.jpg\",\n \"link_name\": null,\n \"token\": null,\n \"creator_id\": null,\n \"permissions\": null,\n \"public\": false,\n \"type\": \"file\",\n \"size\": 253839,\n \"date_last_synced\": null,\n \"stub\": true,\n \"recipient_confirmed\": false,\n \"object_available\": true,\n \"counts\": [\n ],\n \"mime_type\": \"image/jpeg\",\n \"list_index\": 0,\n \"url\": \"http://copy.local/e6aauE2WodKj/Artwork/blue-eyes.jpg\",\n \"revision\": 1160,\n \"thumb\": \"http://copy.local/thumbs_public/e6aauE2WodKj/Artwork/blue-eyes.jpg\",\n \"thumb_original_dimensions\": {\n \"width\": 1262,\n \"height\": 1365\n },\n \"links\": [\n ]\n },\n {\n \"id\": \"/links/e6aauE2WodKj/Artwork/emma-stone.png\",\n \"path\": \"/e6aauE2WodKj/Artwork/emma-stone.png\",\n \"name\": \"emma-stone.png\",\n \"link_name\": null,\n \"token\": null,\n \"creator_id\": null,\n \"permissions\": null,\n \"public\": false,\n \"type\": \"file\",\n \"size\": 228618,\n \"date_last_synced\": null,\n \"stub\": true,\n \"recipient_confirmed\": false,\n \"object_available\": true,\n \"counts\": [\n ],\n \"mime_type\": \"image/png\",\n \"list_index\": 1,\n \"url\": \"http://copy.local/e6aauE2WodKj/Artwork/emma-stone.png\",\n \"revision\": 1161,\n \"thumb\": \"http://copy.local/thumbs_public/e6aauE2WodKj/Artwork/emma-stone.png\",\n \"thumb_original_dimensions\": {\n \"width\": 1100,\n \"height\": 1164\n },\n \"links\": [\n ]\n }\n ]\n }",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"responses": [],
"synced": false
},
{
"id": "f6da4756-ec95-5d31-7d77-2f8c48958ede",
"headers": "X-Api-Version: 1.0\nX-Client-Type: API\nX-Authorization: {{auth_token}}\n",
"url": "{{base_url}}/files/test.jpg",
"pathVariables": {},
"method": "DELETE",
"data": [],
"dataMode": "params",
"version": 2,
"time": 1383600115805,
"name": "/files/file",
"description": "##### Permissions\n* `filesystem.write`: Required\n\nDeletes a file at the provided location. Returns a `200` on success. Returns a `404` if the file does not exist.\n\nYou can run a delete either on a directory or a file. All files below the directory being deleted will be removed.",
"collectionId": "c64a107a-39ab-27b4-9c37-d93b1e187589",
"synced": false
}
]
}
@dtrenz
Copy link
Author

dtrenz commented Nov 5, 2013

In order to use this collection, you need to have environment variables setup to populate at least 2 variables; base_url & auth_token

base_url: The url you want to target for the REST service (e.g. http://api.copy.com/rest)
auth_token: An auth token for access to your account. This can be acquired via OAuth handshake or from the network inspector in Chrome or Firefox while on copy.com.

I plan to add the OAuth endpoints soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment