Barracuda Copy

Barracuda Copy API

In this article:

Base URL

All URLs referenced in the documentation have the following base:

https://api.copy.com/

Security and Access Control

The Barracuda Copy API is served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.

You must provide the following two HTTP request headers while talking to the Copy API; note that this is a baseline only; depending on the api call, additional request headers may be required:

  • X-Api-Version: 1
  • Accept: application/json

Responses

Response Format

All responses are returned in JSON format.

Error Responses

API errors have the form:

{    
 "error": value (Integer value)        
 "message": ERROR_DESCRIPTION    
}   

 

In the following sample request URLs, words that appear in all CAPITAL letters represent the part of the URL meant to be changed depending on the intention of the request.

Response Headers

Typical response headers to expect from the Copy server; many can be ignored:

  • 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
  • Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS
  • Access-Control-Allow-Origin: *.copy.com
  • Access-Control-Max-Age: 1728000
  • Cache-Control: no-cache
  • Connection: keep-alive
  • Date: Wed, 27 Mar 2013 21:19:39 GMT
  • Transfer-Encoding: chunked
  • X-Copy-Time : 1364419178
  • Content-Type: application/json

 

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.
Content-TypeCopy has a RESTful JSON api. Therefore, most 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.

HTTP Verbs   

The Copy.com API makes use of the four and a half primary HTTP verbs. Here is an overview of what each one does:

  • GET: Returns information about the resource at the specified URL
  • POST: Creates a new entry at the specified resource collection URL
  • PUT: Updates an entry at the specified resource URL
  • PATCH: Updates a partial entry at the specified resource URL
  • DELETE: Deletes an entry at the specified resource URL

When performing a GET or DELETE request, the URL typically specifies the particular item being retrieved or removed. When performing a PUT or PATCH 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 does not include the specific resource ID, but actually the parent collection, as the API is acting upon the collection and not an existing record. The POST body is also a JSON document.

Time

When retrieving timestamp information, the API always sends a UNIX timestamp, which is the number of seconds since the UNIX epoch on January 1st, 1970.

For example:

1365103180

This timestamp is based on UTC time. Converting this timestamp into a format consumable by your language should be relatively easy.

For example:

PHP

<?php 
echo date('Y m d H:i:s', 1365103180);
# 2013 04 04 15:19:40

JavaScript

            var date = new Date(1365103180 * 1000); 
console.log(date);
// Thu Apr 04 2013 15:19:40 GMT-0400 (EDT)

/user

GET /user

Description

Read user profile information. Use for getting user name, account storage quotas, and email.

  • profile.read: Required
  • profile.email.read: Required to get the .emails[].email and .email attributes

This API call gives you basic information about a user's account. The contents of the returned document varies depending on your permissions.

The 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 against their quota by using the Fair Storage calculation.

Example request'{"first_name":"Test", "last_name":"User","developer":"true","created_time":"integer","email":"user@test.com"}'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET
Payload parameters
requiredfirst_nameFirst name of user
requiredlast_nameLast name of user
requireddeveloperDeveloper name
requiredcreated_timeTime user was created
requiredemailEmail of user
  • Example:
{
   "first_name":"Test",
   "last_name":"User",
   "developer":"true",
   "created_time":"integer",
   "email":"testUserEmail@test.com"
}
Example Response
{ 
"id": "1381231",
"storage":{
"used": 9207643837,
"quota": 1100585369600,
"saved": 14557934927
},
"first_name": "Test",
"last_name": "User",
"developer": true,
"created_time": 1358175510,
"email": "user@test.com",
"emails": [
{
"primary": true,
"confirmed": true,
"email": "user@test.com",
"gravatar": "eca957c6552e783627a0ced1035e1888"
},
{
"primary": false,
"confirmed": true,
"email": "user@test.net",
"gravatar": "c0e344ddcbabb383f94b1bd3486e55ba"
}
]
}

 

PUT /user

Description

Use to update user name.

  • profile.write: Required
  • profile.read: Required to get the response back from the server
  • profile.email.read: Required to get the .emails[].email and .email attributes in the response back from the server

This request can be used to update the user's name.

The response from this request is the same as the corresponding GET request above, however, the storage attribute will be missing.

Example request'{"first_name":"Test", "last_name":"User"}'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPUT
Payload parameters
optionalidUser identifier
requiredfirst_nameFirst name of user
requiredlast_nameLast name of user
optionaldeveloperDeveloper name
optionalcreated_timeTime user was created
optionalpush_tokenToken identifier
optionalemailEmail of user

Example:

{ 
"first_name": "Test",
"last_name": "User"
}

Example Response

{ 
"id": "1381231",
"first_name": "Test",
"last_name": "User",
"developer": true,
"created_time": 1358175510,
"push_token": "33eda843fbcfed0522bdb0a704984425b553dbe9",
"email": "user@test.com",
"emails": [
{
"primary": true,
"confirmed": true,
"email": "user@test.com",
"gravatar": "eca957c6552e783627a0ced1035e1888"
},
{
"primary": false,
"confirmed": true,
"email": "user@test.net",
"gravatar": "c0e344ddcbabb383f94b1bd3486e55ba"
}
]
}

 

/files (deprecated for most uses)

/meta (new way forward)

GET /meta

Description

Use to read user Copy files.

Note that there are a few different top-level API entry points for fulfilling these tasks. The meta endpoint is used for browsing the user's Copy filesystem. The files endpoint is used for reading file contents, creating and updating files and directories. The thumbs endpoint is used for loading thumbnail versions of image files, eliminating the need for resizing.

File sizes (size attributes) are measured in bytes. If an item displayed in the filesystem is a directory or an otherwise special location which does not represent a file, the size attribute is null.

    • filesystem.read: Required
    • inbox.read: Required for the /inbox child element

The /rest/meta entry point into the API represents the top-most level of the filesystem. This level shows a listing of the real filesystems below it. Think of this location as the My Computer of a Windows environment. You can browse this location but you cannot write to it.

Note: The stub attribute on all nodes represents whether the specified node is incomplete, that is, if not all children have been delivered to you. Basically, they will always be a stub unless you are looking at that item directly.

Example request'{"id":"Copy", "path":"/", "name":"Copy Folder", "type":"copy", "stub":"true" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET
Payload parameters
requiredidCopy folder identifier
requiredpathCopy folder path
requirednameCopy folder name
requiredtypeCopy folder type
requiredstubWhether Copy folder children have been delivered
optionalchildrenCopy folder children

Example:

{ 
"id": "/",
"path": "/",
"name": "Copy",
"type": "root",
"stub": false
}

Example Response

{
"id": "/",
"path": "/",
"name": "Copy",
"type": "root",
"stub": false,
"children": [
{
"id": "/copy",
"path": "/",
"name": "Copy Folder",
"type": "copy",
"stub": true
},
{
"id": "/inbox",
"path": "/",
"name": "Shared With Me",
"type": "inbox",
"stub": true,
"counts": {
"count_new": 7,
"count_viewed": 30,
"count_hidden": 95
}
}
]
}

 

GET /meta/[copy|company-#company_id]

Description

This call represents the first level of the real file system. You can add more levels of depth to the URL in accordance with the user's file system. For example, if you want to read data from the top level directory Applications, the URL would be https://api.copy.com/rest/meta/copy/Applications.

  • filesystem.read: Required
  • links.read: Required for children[].token, children[].links[] attributes to be available

This call may incorrectly return a 404 if the user has no files. However, the resource can still have content added to it.

Example request'{"id":"Copy", "path":"/", "name":"Copy Folder", "type":"copy", "size":"null", "date_last_synched":"null", "stub":"true" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET
Payload parameters

required

idCopy folder identifier
requiredpathCopy folder path
requirednameCopy folder name
requiredtypeCopy folder type
requiredsizeCopy folder size
requireddate_last_syncedLast Copy folder synchronization date
requiredstubWhether Copy folder children have been delivered
optionalchildrenNumber of Copy folder children

Example:

{ 
"id": "/copy",
"path": "/",
"name": "Copy Folder",
"type": "copy",
"size": null,
"date_last_synced": null,
"stub": false
}

Example Response

{
"id": "/copy",
"path": "/",
"name": "Copy Folder",
"type": "copy",
"size": null,
"date_last_synced": null,
"stub": false,
"children": [
{
"id": "/copy/Applications",
"path": "/Applications",
"name": "Applications",
"link_name": "",
"token": "",
"permissions": "",
"public": false,
"type": "dir",
"size": null,
"date_last_synced": 1360079517,
"stub": true,
"counts": [
],
"recipient_confirmed": false,
"object_available": true,
"links": [
{
"id": "hPTBeqqN9Bg9",
"public": true,
"expires": false,
"expired": false,
"url": "https://copy.com/hPTBeqqN9Bg9/Applications",
"url_short": "https://copy.com/hPTBeqqN9Bg9",
"recipients": [
],
"creator_id": "1381231",
"confirmation_required": false
}
],
"url": "https://copy.com/web/Applications",
"thumb": false
},
{
"id": "/copy/text.png",
"path": "/text.png",
"name": "text.png",
"link_name": "",
"token": "",
"permissions": "",
"public": false,
"type": "file",
"size": 164850,
"date_last_synced": 1363573463,
"stub": true,
"counts": [
],
"recipient_confirmed": false,
"object_available": true,
"links": [
],
"url": "https://copy.com/web/text-text.png",
"revision_id": 2897,
"thumb": "https://copy.com/thumbs/text-text.png",
"thumb_original_dimensions": {
"width": 800,
"height": 620
}
}
]
}

 

GET /meta/[copy|company-#company_id]/path/to/file/@activity

currently non-functional

GET /meta/[copy|company-#company_id]/path/to/file/@activity/@time: (revision time in seconds from 1970-01-01 00:00:00)

currently non-functional

GET /meta/[copy|company-#company_id]/path/to/file (deprecated: use download url)

Description

Use this request to get the binary contents of a file.

  • filesystem.read: Required
  • links.read: Required for children[].token, children[].links[] attributes to be available

The path is similar to the /rest/meta/copy requests, except that the copy URL segment is not required. For example, the following two URLs correlate to the same file:

  • https://api.copy.com/rest/meta/copy/subdirectory/file.txt
  • https://api.copy.com/rest/files/subdirectory/file.txt

The 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 must 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.

Note 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.

AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET

 

DELETE /meta/[copy|company-#company_id]/path/to/file (deprecated)

Description

  • filesystem.write: Required

Deletes a file at the provided location. Returns a 204 No Content on success. Returns a 404 File Not Found if the file does not exist.

You can run a delete either on a directory or a file. All files below the directory being deleted are removed.

AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodDELETE

PUT /meta/[copy|company-#company_id]/path/to/FILE.TXT?name=NEWFILE.TXT&overwrite=true (deprecated)

Description

  • filesystem.write: Required

Performs 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.

The overwrite parameter is optional and defaults to true, which causes a file rename to overwrite any existing file named name. when set to false, the filename has some text appended automatically to prevent an overwrite. For example, TPS_Report.pdf is renamed TPS_Report (1).pdf. If an item exists with the same number in parenthesis, the next available number is appended. The resulting filename is returned in the response.

AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPUT

PUT /meta/[copy|company-#company_id]/path/to/FILE.TXT?path=/NEW/PATH/TO/FILE.TXT&overwrite=true (deprecated)

Description

  • filesystem.write: Required

Performs a file move, where the file moves into a new directory. The path variable is an absolute path. Returns a 200 status code on success.

The overwrite parameter is optional and defaults to true, which causes a file move to overwrite any existing file at path. If it is set to false, the filename has some text appended automatically to prevent an overwrite. For example, Docs/TPS_Report.pdf is renamed Docs/TPS_Report (1).pdf. If an item exists with the same number in parenthesis, it is appended with the next available number. The resulting filename is returned in the response.

AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPUT


POST /meta/[copy|company-#company_id]/path/to/FILE?overwrite=true (deprecated)

Description

  • filesystem.write: Required

Create 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 PNG within an existing directory Images located at the root of the users Copy directory, do POST files/Images/PNG with an empty body.

The overwrite flag does not work with directory creation.

Create a File: : If you perform a POST to the URL, provide the name of the existing directory where the file is to reside. The filename is not a part of the URL, but is instead derived from the upload form. For example, to add a file named text.txt to the directory Employees in the root of the user's Copy directory, 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). This is a simple standardized HTTP file upload.

The maximum file size of an upload is 1GB and the maximum time an HTTP request can take is five hours. An API endpoint supporting chunked file uploading is planned for circumventing this limitation.

The  overwrite  parameter is optional and defaults to  true , which causes a new file to overwrite any existing file at the same location. When set to  false , the filename has some text automatically appended to prevent an overwrite. For example,  Docs/TPS_Report.pdf  is renamed  Docs/TPS_Report (1).pdf . If an item exists with the same number in parenthesis, the next available number is appended. The resulting filename is returned in the response. This does not apply to creating a new folder with the same name as an existing folder; in this case the existing folder is returned.

Example request'{"id":"Copy", "path":"/", "name":"Copy Folder", "token":"null", "permissions":"null", "syncing":"false", "public":"true", "type":"1"}'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPOST
Create a Folder Payload parameters

 

idCopy folder identifier
requiredpathCopy folder path identifier
requirednameName of folder
 tokenToken identifier
 permissionsCopy folder permissions
 syncingWhether Copy folder is currently syncing
 publicWhether Copy folder is publicly available
 typeCopy folder directory
 sizeCopy folder size
 date_last_syncedLast Copy folder synchronization date
 stubWhether Copy folder children have been delivered
 recipient_confirmedWhether recipient received link to folder
 counts 

Example:

{ 
"id": "/copy/test/test",
"path": "/test/test",
"name": "test",
"token": null,
"permissions": null,
"syncing": false,
"public": false,
"type": "dir",
"size": null,
"date_last_synced": 1366986969,
"stub": false,
"recipient_confirmed": false
}

Create a Folder Example Response

{ 
"id": "/copy/test/test",
"path": "/test/test",
"name": "test",
"token": null,
"permissions": null,
"syncing": false,
"public": false,
"type": "dir",
"size": null,
"date_last_synced": 1366986969,
"stub": false,
"recipient_confirmed": false,
"counts": [
],
"url": "https://copy.com/web/test/test",
"links": [
],
"thumb": null,
"share": null
}
Create a File Payload parameters

idCopy file identifier
requiredpathCopy file path
requirednameCopy file name
 tokenToken identifier
 permissionsCopy file permissions
 syncingWhether Copy file is currently syncing
 publicWhether Copy file is available publicly
 typeCopy file type
 sizeCopy file size
 date_last_syncedLast Copy file synchronization date

stubWhether Copy folder children have been delivered

recipient_confirmedWhether recipient received link to file
 counts 

 

 

Create a File Example Response
{
"objects": [
{
"id": "/copy/test/test/animation.gif",
"path": "/test/test/animation.gif",
"name": "animation.gif",
"token": null,
"permissions": null,
"syncing": false,
"public": false,
"type": "file",
"size": 456357,
"date_last_synced": 1366987166,
"stub": false, "recipient_confirmed": false,
"counts": [
],
"url": "https://copy.com/web/test/test/animation.gif",
"links": [
],
"revision": 5293,
"thumb": null,
"share": null
}
]
}

GET /thumbs/path/to/FILE?size=SIZE (deprecated: use thumbnail url returned with object details)

Description

Use to read user Copy files.

Note that there are a few different top-level API entry points for fulfilling these tasks. The meta endpoint is used for browsing the user's Copy filesystem. The files endpoint is used for reading file contents, creating and updating files and directories. The thumbs endpoint is used for loading thumbnail versions of image files, eliminating the need for resizing.

File sizes (size attributes) are measured in bytes. If an item displayed in the filesystem is a directory or an otherwise special location which does not represent a file, the size attribute is null.

    • filesystem.read: Required
    • inbox.read: Required for the /inbox child element

The /rest/meta entry point into the API represents the top-most level of the filesystem. This level shows a listing of the real filesystems below it. Think of this location as the My Computer of a Windows environment. You can browse this location but you cannot write to it.

Note: The stub attribute on all nodes represents whether the specified node is incomplete, that is, if not all children have been delivered to you. Basically, they will always be a stub unless you are looking at that item directly.

AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET

Links represent files and directories shared by a user. These links can be either public or private. When they are private, there are potentially multiple recipients with access to the link, as decided by the user. These API calls allow you to read information about said links, as well as create links on behalf of your user.

A link ID, which is also referred to as a token, is a random collection of uppercase and lowercase letters as well as numbers, e.g., hJjXGcSfC20G. This Token is used in URLs when sharing links between people online. For example, view this token by going to https://copy.com/hJjXGcSfC20G.

Link Access Permissions

  • read: This user only has access to read the share information
  • sync: This user can synchronize the files into their Copy folder and edit the files

GET /links/TOKEN

Description

  • links.read: Required

This call retreives information about the identified link.

Example request'{"id":"wFIK8aMIDvh2", "name":"link name", "public":"false", "url":"https:/copy.com.wFIK8aMIDvh2", "creator_id":"110660"}'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET
Payload parameters

 

idLink identification
 nameLink name
 urlFull link URL
 url_shortShort link URL
 creator_idCreator identification
 creator_timeTime link was created
 object_countObject count
 confirmation_requiredWhether receipt of link confirmation required
 statusLink status
 permissionsLink access permissions
 recipientsLink recipient details

Example:

{ 
"id": "wFIK8aMIDvh2",
"name": "Such a cool Link",
"public": false,
"url": "https://copy.com/wFIK8aMIDvh2",
"url_short": "https://copy.com/wFIK8aMIDvh2",
"creator_id": "110660",
"created_time": 1366825349,
"object_count": 1,
"confirmation_required": false,
"status": "viewed",
"permissions": "sync"
}

Example Response

{ 
"id": "wFIK8aMIDvh2",
"name": "Such a cool Link",
"public": false,
"url": "https://copy.com/wFIK8aMIDvh2",
"url_short": "https://copy.com/wFIK8aMIDvh2",
"creator_id": "110660",
"created_time": 1366825349,
"object_count": 1,
"confirmation_required": false,
"status": "viewed",
"permissions": "sync",
"recipients": [
{
"contact_type": "user",
"contact_id": "user-1381231",
"contact_source": "link-3514165",
"user_id": "1381231",
"email": "user@test.com",
"first_name": "Test",
"last_name": "User",
"permissions": "sync",
"emails": [
{
"primary": true,
"confirmed": true,
"email": "user@test.com",
"gravatar": "eca957c6552e783627a0ced1035e1888"
},
{
"primary": false,
"confirmed": true,
"email": "user@test.net",
"gravatar": "c0e344ddcbabb383f94b1bd3486e55ba"
}
]
}
]
}
Example Response
{ 
"error": 1021,
"message": "Cannot find link InVaL1Dt0k3n"
}

 

Description

  • links.read: Required

This call returns 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 is always empty (otherwise the request would be even slower). The name attribute is used when the user chooses to share the link with people via email address and they enter a subject line for the email.

Example request'{"id":"sCxkowlraze1", "name":"Big API Changes", "public":"true", "url":"https:/copy.com.sCxkowlraze1 ", "creator_id":"110660"}'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET
Payload parameters

 

id 

Link identifier 
 name Name of link
  publicWhether the link is public facing 
 url Link URL 
 url_shortLink short URL
 creator_idCreator identifier
 created_timeTime link was created
 object_countNumber of link objects
 confirmation requiredWhether confirmation of receipt is required
 statusLink status
 permissionsLink permissions
 recipientsLink recipients

Example Response

[ 
{
"id": "sCxkowlraze1",
"name": "Big API Changes",
"public": true,
"url": "https://copy.com/sCxkowlraze1",
"url_short": "https://copy.com/sCxkowlraze1",
"creator_id": "1381231",
"created_time": 1366825349,
"object_count": 1,
"confirmation_required": false,
"status": "viewed",
"permissions": "read",
"recipients": [
]
},
{
"id": "f6e4fNxrtwY8",
"name": "to",
"public": true,
"url": "https://copy.com/f6e4fNxrtwY8",
"url_short": "https://copy.com/f6e4fNxrtwY8",
"creator_id": "1381231",
"created_time": 1366817886,
"object_count": 1,
"confirmation_required": false,
"status": "viewed",
"permissions": "read",
"recipients": [
]
},
{
"id": "MBzss3r2GXk4",
"name": "",
"public": true,
"url": "https://copy.com/MBzss3r2GXk4",
"url_short": "https://copy.com/MBzss3r2GXk4",
"creator_id": "1381231",
"created_time": 1366817750,
"object_count": 1,
"confirmation_required": false,
"status": "viewed",
"permissions": "read",
"recipients": [
]
}
]

 

Description
  • links.write: Required

The 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 must all be siblings in the filesystem (e.g., all exist within the same directory). This starts beneath the /copy entry point in the filesystem.

Any provided path attributes which cannot be discovered in the user's filesystem are "added" to the share, however, they appear transparent in the user interface and are not clickable. If a file is created after the link was created at the specified path, it is automatically attached to the link. If any of the files are deleted, they disappear from the link.

The public attribute specifies whether the generated link can be viewed by anyone with the URL. It is optional and defaults to true.

The response for this request is a complete document, as if you had made the GET request above. You may want to parse this response to acquire the new token ID / URL for the link.

Recipients cannot be set during a POST they need to be set later during a PUT.

Example request'{"public":"true", "name":"Shared Files" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPOST
Payload parameters
 publicPublic copy link
requirednameCopy link name
requiredpathsCopy link path

Example:

{ 
"public": true,
"name": "Shared Files",
"paths": [
"/copy/path/to/file.txt"
]
}
Example Response

Currently the status is 200 OK although it should be 201 Created. This may change in the future, so check for a 2XX for success.

{ 
"id": "MBrss3roGDk4",
"name": "Shared Files",
"public": true,
"url": "https://copy.com/MBrss3roGDk4",
"url_short": "https://copy.com/MBrss3roGDk4",
"creator_id": "1381231",
"company_id": null,
"confirmation_required": false,
"status": "viewed",
"permissions": "read"
}

Example Response

{ 
"error": 1303,
"message": "No path(s) specified."
}

 

PUT /links/TOKEN

Description
  • links.write: Required

Performing a PUT against a link allows you to update some of the attributes, as shown below.

Example request'{"public":"true", "name":"New Name" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPUT
Payload parameters
 public Whether the link is public 
 name Link name 
 paths Link contents path

Example:

{ 
"public": true,
"name": "New Name",
"paths": [ "/copy/text-text.png"
]
}

Example Request

{ 
"public": true,
"name": "New Name",
"paths": [
"/copy/text-text.png"
]
}

 

PATCH /links/TOKEN

Description
  • links.write: Required

When performing a PATCH operation on a link, having the recipient attribute set as an array with a recipient object within the array appends that user to the list of recipients.

To remove contacts, set a remove attribute to true within each individual recipient object.

Eventually the functionality of the PUT and PATCH request for this endpoint will be combined.

Example Request'{"recipients":"[]" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodPATCH
Payload Parameters
requiredrecipientsRecipient details

Example:

{ 
"recipients": [
{
"email": "user@test.com",
"permissions": "read"
},
{
"email": "user2@test.com",
"remove": true
}
]
}
Example Request
{ 
"recipients": [
{
"email": "user@test.com",
"permissions": "read"
},
{
"email": "user2@test.com",
"remove": true
}
]
}

 

Delete /links/TOKEN

Description
  • links.write: Required

Use this to delete a link the user owns. A response of 204 No Content signifies a successful delete.

Example Request'{"" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodDELETE

Example Response

{ 
"error": 1021,
"message": "Cannot find link YyvXNbkDgSvI"
}

 

GET /links/TOKEN

Description
  • links.read: Required

This API call returns 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 file system calls.

Example Request'{"id":"//","path":"/","name":"artwork","token":"e6aauE2WodKj","creator_id":"1381231" }'
AuthorizationX-AUTHORIZATION
Acceptapplication/json
HTTP MethodGET
Payload Parameters
 idFile identifier
 pathLink path
 nameName of file
 tokenToken identifying file
 creater_idCreator identification
 permissionsFile permissions
 syncingWhether the file is synchronizing
 publicWhether the file is publicly available
 typeToken type
 sizeFile size
 date_last_syncedDate token last synchronized
 stubWhether Copy folder children have been delivered
 recipient_confirmedWhether recipient has confirmed receipt
 counts 

Example:

{
"id": "/links/e6aauE2WodKj",
"path": "/e6aauE2WodKj",
"name": "Artwork",
"token": "e6aauE2WodKj",
"creator_id": "1381231",
"permissions": "read",
"syncing": false,
"public": true,
"type": "link",
"size": null,
"date_last_synced": null,
"stub": false,
"recipient_confirmed": false
}

Example Response
[Token Root]

{ 
"id": "/links/e6aauE2WodKj",
"path": "/e6aauE2WodKj",
"name": "Artwork",
"token": "e6aauE2WodKj",
"creator_id": "1381231",
"permissions": "read",
"syncing": false,
"public": true,
"type": "link",
"size": null,
"date_last_synced": null,
"stub": false,
"recipient_confirmed": false,
"counts": [
],
"children_count": null,
"mime_type": "",
"url": "http://copy.local/e6aauE2WodKj",
"links": [
],
"thumb": null,
"share": null,
"children": [
{
"id": "/links/e6aauE2WodKj/Artwork",
"path": "/e6aauE2WodKj/Artwork",
"name": "Artwork",
"link_name": null,
"token": null,
"creator_id": null,
"permissions": null,
"public": false,
"type": "dir",
"size": null,
"date_last_synced": null,
"stub": true,
"recipient_confirmed": false,
"object_available": true,
"counts": [
],
"mime_type": "",
"list_index": 0,
"url": "http://copy.local/e6aauE2WodKj/Artwork",
"revision": 0,
"thumb": null,
"links": [
]
}
]
}

Example Response
[Token Subdirectory]

{ 
"id": "/links/e6aauE2WodKj/Artwork",
"path": "/e6aauE2WodKj/Artwork",
"name": "Artwork",
"token": null,
"creator_id": null,
"permissions": null,
"syncing": false,
"public": false,
"type": "dir",
"size": null,
"date_last_synced": null,
"stub": false,
"recipient_confirmed": false,
"counts": [
],
"children_count": null,
"mime_type": "",
"url": "http://copy.local/e6aauE2WodKj/Artwork",
"links": [
],
"thumb": null,
"share": null,
"children": [
{
"id": "/links/e6aauE2WodKj/Artwork/image-name.jpg",
"path": "/e6aauE2WodKj/Artwork/image-name.jpg",
"name": "image-name.jpg",
"link_name": null,
"token": null,
"creator_id": null,
"permissions": null,
"public": false,
"type": "file",
"size": 253839,
"date_last_synced": null,
"stub": true,
"recipient_confirmed": false,
"object_available": true,
"counts": [
],
"mime_type": "image/jpeg",
"list_index": 0,
"url": "http://copy.local/e6aauE2WodKj/Artwork/image-name.jpg",
"revision": 1160,
"thumb": "http://copy.local/thumbs_public/e6aauE2WodKj/Artwork/image-name.jpg",
"thumb_original_dimensions": {
"width": 1262,
"height": 1365
},
"links": [
]
},
{
"id": "/links/e6aauE2WodKj/Artwork/other-image-name.jpg",
"path": "/e6aauE2WodKj/Artwork/other-image-name.jpg",
"name": "other-image-name.jpg",
"link_name": null,
"token": null,
"creator_id": null,
"permissions": null,
"public": false,
"type": "file",
"size": 228618,
"date_last_synced": null,
"stub": true,
"recipient_confirmed": false,
"object_available": true,
"counts": [
],
"mime_type": "image/png",
"list_index": 1,
"url": "http://copy.local/e6aauE2WodKj/Artwork/other-image-name.jpg",
"revision": 1161,
"thumb": "http://copy.local/thumbs_public/e6aauE2WodKj/Artwork/other-image-name.jpg",
"thumb_original_dimensions": {
"width": 1100,
"height": 1164
},
"links": [
]
}
]
}

 

 

 

 

 


Feedback Did you find this article helpful: |

Still need help?

If you have a technical issue with Copy, go to the Copy Support forums or email the Copy Support.