Welcome to فورشيرد REST API documentation!
Introduction
- POST - creates or updates a resource
- PUT - updates a resource
- GET - retrieves a resource or list of resources
- DELETE - deletes a resource
There are two main API endpoints:
- https://upload.4sync.com/{api version}/{resource name} - for upload requests
- https://api.4sync.com/{api version}/{resource name} - for all other requests
Formats
Pagination
Parameter | Type | Description | Required |
---|---|---|---|
limit | Integer | The number of records returned. Min value is 1. Default (and max value) is 100. | no |
offset | Integer | The offset of the first record returned. Default is 0. | no |
Global request parameters
Parameter | Description |
---|---|
locale | This parameter is applicable to all requests and the language of error messages. Default is English. List of supported languages: en, pt-Br, es, ar, fr, pl, fa, tr, in, th, de, it, zh, ja, ko, vi, ms, ru. |
addFields | This parameter is applicable for all /files resource queries. See /FILES section. |
Authorization
The authorization endpoints include the following ones:
Request token | https://api.4sync.com/v1_2/oauth/initiate | This endpoint is used for retrieving a Request Token. |
Authorize token | https://api.4sync.com/v1_2/oauth/authorize | This endpoint is used for user authorization. |
Access token | https://api.4sync.com/v1_2/oauth/token | This endpoint is used for retrieving an Access Token. |
Getting a Request Token
The first step in authorization process is to retrieve a Request Token from فورشيرد. This is a temporary token that later will be exchanged for an Access Token.RESOURCE | /oauth/initiate |
DESCRIPTION | The first step of authentication. Allows you to obtain a Request Token used for further stages of authentication process. |
URL | https://api.4sync.com/v1_2/oauth/initiate |
METHOD | POST |
VERSION | v1_2 |
RETURNS | Request Token with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE RESPONSE | oauth_token=8154603a16d4be654a2c9d60b7b068b4 |
User Authorization
The second step is to request user authorization. Upon receipt of a Request Token from فورشيرد the authorization page, where an application could be granted the requested access, is displayed. The only required parameter for this step is the Request Token (oauth_token value) received from the previous step. The endpoint is followed by an oauth_token parameter with the value set to the oauth_token value. After an application is granted the access, a user is redirected to the URL specified in the oauth_callback parameter.RESOURCE | /oauth/authorize |
DESCRIPTION | The second step of authorization. Without user authorization in this step, it is impossible for your application to obtain an Access Token. |
URL | https://api.4sync.com/v1_2/oauth/authorize |
METHOD | GET |
VERSION | v1_2 |
RETURNS | |
ERROR | See Errors section for details. |
EXAMPLE RESPONSE |
Getting an Access Token
This is the final step of the authorization process. After an application is granted the access, it needs to exchange the Request Token for an Access Token. For this step, you will need the Request Token (the oauth_token and oauth_token_secret values) (see previous step).RESOURCE | /oauth/token |
DESCRIPTION | The third step of authorization. Getting an Access Token. |
URL | https://api.4sync.com/v1_2/oauth/token |
METHOD | POST |
VERSION | v1_2 |
RETURNS | An access token and the corresponding access token secret with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE RESPONSE | oauth_token=8155603a16d4be954a2c9d60b7b068b4 |
Resources
/user
User Response
The endpoint is used for managing a user' account.Attributes | Type | Description |
---|---|---|
id | String | Unique user identifier. |
firstName | String | User's First name. |
lastName | String | User's Last name. |
String | Email address, applied by a user to log in. | |
plan | String | User's Membership Plan - Free/Premium. |
freeSpace | Long | The amount of space in bytes that is still available in a user's account. |
totalSpace | Long | The total amount of available space in a user's account, in bytes. |
uploadSizeLimit | Long | The maximum size of one file a user can upload to account, in bytes. |
rootFolderId | String | Unique identifier of a root folder in a user's account. |
profileUrl | String | URL provided by the user in association with their profile. |
status | String | A user's status. Can be "locked", "active", "inactive", "trial" or "null". |
verified | Boolean | Indicates that a user has a verified account. |
timeZone | String | A user's time zone. |
created | Date | The time when a user was created. |
lastLogin | Date | The last time when a user signed in to فورشيرد. |
expiration | Date | Expiration date of a user's plan. |
Example of a user response
{ "id": "tow4q9ki", "firstName": " 1", "lastName": "Petrov", "email": "Ga103@anna.4sync.com", "plan": "FREE", "freeSpace": 10220621999, "totalSpace": 16106127360, "uploadSizeLimit": 2147483648, "rootFolderId": "FA3f-1qd", "profileUrl": "https://www.4sync.com/u/tow4q9ki/Ga103.html", "status": null, "verified": true, "timeZone": "GMT+02:00", "created": "2015-07-22T12:18:43.000Z", "lastLogin": "2016-01-12T13:56:40.000Z", "expiration": "2016-07-10T13:56:40.000Z" }
Get the information about current user (GET /user)
RESOURCE | /user |
DESCRIPTION | User metainfo endpoint. |
URL | https://api.4sync.com/v1_2/user |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | UserResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/user?oauth_params |
EXAMPLE RESPONSE |
{ /*User Response*/ } |
Update user's info (PUT /user)
RESOURCE | /user | ||||||||||||||||||||||||
DESCRIPTION | User metainfo update endpoint. Used to update individual or multiple fields in the user entity, including first name, last name, email, time zone and password. | ||||||||||||||||||||||||
URL | https://api.4sync.com/v1_2/user | ||||||||||||||||||||||||
METHOD | PUT (Content-Type:application/x-www-form-urlencoded) | ||||||||||||||||||||||||
VERSION | v1_2 | ||||||||||||||||||||||||
PARAMETERS |
|
||||||||||||||||||||||||
RETURNS | UserResponse entity with HTTP Status 200. | ||||||||||||||||||||||||
ERROR | See Errors section for details. | ||||||||||||||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/user?oauth_params params: firstName=newValidFirstName |
||||||||||||||||||||||||
EXAMPLE RESPONSE |
{ /*User Response*/ } |
Get an avatar of the specified size of a user (GET /user/picture/{type})
Returns a user's avatar of the specified size. Get more information about {type} in GET /files/{id}/thumbnails/{type}.RESOURCE | /user/picture/{type} |
DESCRIPTION | Retrieves a user's avatar of the specified size. |
URL | https://api.4sync.com/v1_2/user/picture/{type} |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | Avatar image and HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/user/picture/{type}?oauth_params |
EXAMPLE RESPONSE | Avatar (default or custom image). |
Set an avatar picture for a user (PUT /user/picture)
This method is used to upload an image to be set as a user's avatar picture. Maximum file size is 5 Mb.RESOURCE | /user/picture |
DESCRIPTION | Set an avatar picture for a user (only for file format gif, jpg, png and maximum size of file 5 Mb). |
URL | https://upload.4shared.com/v1_2/user/picture |
METHOD | PUT (Content-Type: application/octet-stream) |
VERSION | v1_2 |
REQUEST BODY | Required. The file content itself to be uploaded. |
RETURNS | UserResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://upload.4shared.com/v1_2/user/picture |
EXAMPLE RESPONSE |
{ /*User Response*/ } |
Get list of files in a user's account (GET /user/files)
RESOURCE | /user/files | ||||||||||||||||||||
DESCRIPTION | Retrieves a list of files in a user's account. The files are ordered by the upload date. Use filtering to make the request more specific. | ||||||||||||||||||||
URL | https://api.4sync.com/v1_2/user/files | ||||||||||||||||||||
METHOD | GET | ||||||||||||||||||||
VERSION | v1_2 | ||||||||||||||||||||
PARAMETERS |
|
||||||||||||||||||||
RETURNS | FilesResponse entity with HTTP Status 200. | ||||||||||||||||||||
ERROR | See Errors section for details. | ||||||||||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/user/files?oauth_params | ||||||||||||||||||||
EXAMPLE RESPONSE |
{ files: [ {/*File response*/} ] } |
Get a list of items from trash (GET /user/trash)
RESOURCE | /user/trash |
DESCRIPTION | Retrieves a list of items from a user's recycle bin. |
URL | https://api.4sync.com/v1_2/user/trash |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | List of FileResponse/FolderResponse entities with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/user/trash?oauth_params |
EXAMPLE RESPONSE |
{ folders: [ {/*Folder response*/} ], files: [ {/*File response*/} ] } |
/users
Get information about the requested user's account (GET /users/{id})
RESOURCE | /users/{id} |
DESCRIPTION | Retrieves information about the requested user's account. |
URL | https://api.4sync.com/v1_2/users/{id} |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | UserResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/users/{id}?oauth_params |
EXAMPLE RESPONSE |
{ /*User Response*/ } |
Get an avatar of the specified size of the requested user (GET /users/{id}/picture/{type})
Returns an avatar of the requested user of the specified size. Get more information about {type} in GET /files/{id}/thumbnails/{type}.RESOURCE | /users/{id}/picture/{type} |
DESCRIPTION | Retrieves the user's avatar. |
URL | https://api.4sync.com/v1_2/users/{id}/picture |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | Avatar image and HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/users/{id}/picture/{type}?oauth_params |
EXAMPLE RESPONSE | Avatar (default or custom image). |
/files
File Response
FileResponse entity contains metadata of a file, information about its owner and its download link. Next fields: description, tags, exif, id3 are not returned by default and must be requested via an additional parameter addFields.Attributes | Type | Description |
---|---|---|
id | String | File unique identifier. |
name | String | File name. |
size | Long | File size in bytes. |
modified | Date | Last time the file was modified on فورشيرد. |
description | String | File description. |
tags | List <String> | All user's tags applied to the file. |
path | String | Folders path to the file, starting at the root. |
parentId | String | Unique identifier of the folder containing a requested file. |
downloadPage | String | File download page url. |
ownerId | String | Unique file owner identifier. |
mimeType | String | Mime type of a file. |
exif | See EXIF metainfo section | Metainfo of image files. |
md5 | String | md5 of a file. |
ownerOnly | Boolean | View permissions for other users. |
status | String | Current status of the file. Possible values are: deleted, incomplete, conflicted, trashed, normal. |
virusScanResult | String | Attribute that indicates whether a file contains a virus. |
id3 | See id3 metadata section | Metadata for music files. |
Example of a file response
{ "id": "NxLbjwFIba", "name": "Tugas 1 Luas dan Volume Balok.rar", "size": 302965, "modified": "2016-02-03T15:29:16.968Z", "description": null, "tags": null, "path": "/My 4shared/Tugas 1 Luas dan Volume Balok.rar", "parentId": "5mByVkpQ", "downloadPage": "https://www.4shared.com/file/NxLbjwFIba/Tugas_1_Luas_dan_Volume_Balok.html", "ownerId": "9xoGwv8u", "mimeType": "application/x-rar-compressed", "exif": null, "md5": "af9db6f0a15f802cdb6fe56643ec7c92", "ownerOnly": false, "status": "normal", "virusScanResult": "clean", "id3": null }
Request parameter for file entity
Attributes | Type | Description | Required |
---|---|---|---|
addFields | String | This parameter is applicable for all /files resource queries. May contain the following values:
|
no |
Id3 metadata for music files
Parameter | Type |
---|---|
bitrate | Integer |
year | Integer |
track | Integer |
samplerate | Integer |
length | Integer |
genre | String |
album | String |
artist | String |
title | String |
preciseLength | Float |
Example of a file response with id3 tags
{ "id3": { "bitrate": 192, "samplerate": 44100, "track": 0, "year": 0, "genre": "Sertanejo", "album": "", "artist": "Henrique e Juliano", "title": "Na hora da raiva", "length": 174, "preciseLength": 174.23674 } }
EXIF metainfo of image files
Parameter | Type |
---|---|
model | String |
make | String |
dateTimeOriginal | String |
width | String |
height | String |
latitude | String |
longitude | String |
latitudeRef | String |
longitudeRef | String |
Example of a file response with EXIF
{ "exif": { "model": "iPhone 6", "make": "Apple", "dateTimeOriginal": "2016:02:03 15:22:12", "width": "3264", "height": "2448", "latitude": "40.45783333333333", "longitude": "20.513441666666665", "latitudeRef": "N", "longitudeRef": "E", "empty": false } }
Get information about file (GET /files/{id})
RESOURCE | /files/{id} |
DESCRIPTION | File metainformation endpoint. |
URL | https://api.4sync.com/v1_2/files/{id} |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | FileResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params |
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Upload file (POST /files)
Uploads a file. File size is limited to 150 MB. To upload larger files, use /upload method. The whole body is treated as file binary data and Content-Type should be set to application/octet-stream.RESOURCE | /files | ||||||||||||
DESCRIPTION | Simple upload file endpoint (only for files less than 150 Mb in size). | ||||||||||||
URL | https://upload.4sync.com/v1_2/files | ||||||||||||
METHOD | POST (Content-Type: application/octet-stream) | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
REQUEST BODY | Required. The file content itself to be uploaded. | ||||||||||||
RETURNS | FileResponse entity with HTTP Status 200. | ||||||||||||
ERROR | See Errors section for details. | ||||||||||||
EXAMPLE REQUEST | https://upload.4sync.com/v1_2/files/{id}?oauth_params params: folderId=validFolderId&fileName=nonConflictingName |
||||||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Upload a large file (POST /upload)
This method used to upload files larger than 150MB in size, in multiple chunks.RESOURCE | /upload | ||||||||||||||||||||||||
DESCRIPTION | Uploads large files in multiple chunks. May be used to resume uploads. Starts a new chunk upload process. Returns file entity including the id of the new file, which should be used to upload file's data. |
||||||||||||||||||||||||
URL | https://upload.4sync.com/v1_2/upload | ||||||||||||||||||||||||
METHOD | POST (Content-Type: application/x-www-form-urlencoded) | ||||||||||||||||||||||||
VERSION | v1_2 | ||||||||||||||||||||||||
PARAMETERS |
|
||||||||||||||||||||||||
RETURNS | FileResponse entity with HTTP Status 200 | ||||||||||||||||||||||||
ERROR | See Errors section for details. | ||||||||||||||||||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Upload a large file (POST /upload/{id})
This method used to upload files larger than 150MB in size, in multiple chunks. The whole request body is treated as file binary data and Content-Type should be set to application/octet-stream.RESOURCE | /upload/{id} | ||||||||||||
DESCRIPTION | Uploads a chunk of data. Should be called after retrieving file id (see /upload method). | ||||||||||||
URL | https://upload.4sync.com/v1_2/upload/{id} id - file id, received from the /upload method |
||||||||||||
METHOD | POST (Content-Type: application/octet-stream) | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
REQUEST BODY | Chunk's binary data | ||||||||||||
RETURNS | Returns HTTP Status 201 Created (upon all data chunk upload). | ||||||||||||
ERROR | See Errors section for details. |
Get uploaded file status (GET /upload/{id})
This method is used to check the uploaded file status.RESOURCE | /upload/{id}/status |
DESCRIPTION | Retrieves the number and position of bytes missing in the file. May be used to resume uploads. |
URL | https://upload.4sync.com/v1_2/upload/{id}/status id - file id, received from the /upload method |
METHOD | GET |
VERSION | v1_2 |
RETURNS | Returns HTTP status code 308 Chunked Upload and "Range" header: "{storedChunkfirstByteInclusive}-{storedChunklastByteInclusive}, ..., {sto redChunkfirstByteInclusive}-{storedChunklastByteInclusive}". If the file upload was initialized but no data uploaded, the "Range" header will be absent. If the file upload was completed, returns HTTP status code 201 Created |
ERROR | See Errors section for details. |
Update file (PUT /files/{id})
This method is used to upload a new version of an existing file in a user's account. File size is limited to 150 MB. To upload files of larger size /upload method must be used. The whole body is treated as file binary data and Content-Type should be set to application/octet-stream.RESOURCE | /files/{id} | ||||||||||||
DESCRIPTION | Simple update file endpoint (only for files less than 150 Mb in size). | ||||||||||||
URL | https://upload.4sync.com/v1_2/files/{id} | ||||||||||||
METHOD | PUT (Content-Type: application/octet-stream) | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
REQUEST BODY | Required. The file content itself to be uploaded. | ||||||||||||
RETURNS | FileResponse entity with HTTP Status 200. | ||||||||||||
ERROR | See Errors section for details. | ||||||||||||
EXAMPLE REQUEST | https://upload.4sync.com/v1_2/files/{id}?oauth_params params: folderId=validFolderId&fileName=nonConflictingName |
||||||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Update the file info (PUT /files/{id})
Updates the file info, specified by id. Used to update individual or multiple fields in the file entity, including renaming the file, changing its description and adding/changing tags for the file.RESOURCE | /files/{id} | ||||||||||||||||||||
DESCRIPTION | File metainfo update endpoint. | ||||||||||||||||||||
URL | https://api.4sync.com/v1_2/files/{id} | ||||||||||||||||||||
METHOD | PUT (Content-Type: application/json, application/xml, application/x-www-form-urlencoded) | ||||||||||||||||||||
VERSION | v1_2 | ||||||||||||||||||||
PARAMETERS |
|
||||||||||||||||||||
RETURNS | FileResponse entity with HTTP Status 200. | ||||||||||||||||||||
ERROR | See Errors section for details. | ||||||||||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params params: name=newNonConflictName.jpg |
||||||||||||||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Delete file (DELETE /files/{id})
Deletes a file, specified by id.RESOURCE | /files/{id} |
DESCRIPTION | File deletion endpoint. |
URL | https://api.4sync.com/v1_2/files/{id} |
METHOD | DELETE |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | No content with HTTP Status 204. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params |
EXAMPLE RESPONSE | NO CONTENT |
Move file to Recycle bin (POST /files/{id}/trash)
Used to move a file to the Recycle bin.RESOURCE | /files/{id}/trash |
DESCRIPTION | Moves a file to Recycle bin. |
URL | https://api.4sync.com/v1_2/files/{id}/trash |
METHOD | POST |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | FileResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params |
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Move file from Recycle bin (POST /files/{id}/untrash)
Restores a file, moved to a Recycle bin. Default: restores a file to the previous parent folder, i.e. the folder before deletion. If the parent folder no longer exists, a new folder is created. If a file with the same name exists in the parent folder, some new unique name must be specified in the request.RESOURCE | /files/{id}/untrash | ||||||||
DESCRIPTION | Restores a file from Recycle bin. | ||||||||
URL | https://api.4sync.com/v1_2/files/{id}/untrash | ||||||||
METHOD | POST | ||||||||
VERSION | v1_2 | ||||||||
PARAMETERS |
|
||||||||
RETURNS | FileResponse entity with HTTP Status 200. | ||||||||
ERROR | See Errors section for details. | ||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params params: name=non_conflicting_name.jpg |
||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Copy file (POST /files/{id}/copy)
Used to create a copy of a file.RESOURCE | /files/{id}/copy | ||||||||||||
DESCRIPTION | Creates copy of a file. | ||||||||||||
URL | https://api.4sync.com/v1_2/files/{id}/copy | ||||||||||||
METHOD | POST | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
RETURNS | FileResponse entity with HTTP Status 200. | ||||||||||||
ERROR | See Errors section for details. | ||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params params: folderId=validFolderId&name=newNonCoflictingName.jpg |
||||||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Move file (POST /files/{id}/move)
Used to create a copy of a file in another folder, and further delete the original.RESOURCE | /files/{id}/move | ||||||||||||
DESCRIPTION | Moves file to another folder. | ||||||||||||
URL | https://api.4sync.com/v1_2/files/{id}/move | ||||||||||||
METHOD | POST | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
RETURNS | FileResponse entity with HTTP Status 200. | ||||||||||||
ERROR | See Errors section for details. | ||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/{id}?oauth_params params: folderId=validFolderId&name=newNonCoflictingName.jpg |
||||||||||||
EXAMPLE RESPONSE |
{ /*File Response*/ } |
Get file's preview (GET /files/{id}/preview)
Returns the preview of audio, video files and document with following extension:".doc", ".docx", ".pps", ".ppt", ".pptx", ".rtf", ".xls", ".xlsx". It's public call.
RESOURCE | /files/{id}/preview | ||||||||
DESCRIPTION | For audio/video/document files only. Returns file preview. | ||||||||
URL | https://api.4sync.com/v1_2/files/{id}/preview | ||||||||
METHOD | GET | ||||||||
VERSION | v1_2 | ||||||||
PARAMETERS |
|
||||||||
RETURNS | Preview of an audio/video/document file with HTTP Status 200. | ||||||||
ERROR | See Errors section for details. | ||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/0l34Ufblba/preview?oauth_params | ||||||||
EXAMPLE RESPONSE | Media data |
Get original file (GET /files/{id}/download)
Returns the content (original) of a file to be saved. Its also possible to specify only a range of bytes to be downloaded - using a range header.RESOURCE | /files/{id}/download |
DESCRIPTION | Source file download endpoint. |
URL | https://api.4sync.com/v1_2/files/{id}/download |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | Source file with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/0l34Ufblba/download?oauth_params |
EXAMPLE RESPONSE | Data |
Get thumbnails of the file (GET /files/{id}/thumbnails/{type})
Returns a thumbnail of the specified type for an audio file with cover, video, image or pdf file. Its a public call. Possible values are {type}:- XS: height-72, width-72
- S: height-240, width-320
- SM: height-480, width-854
- M: height-750, width-1334
- L: height-1080, width-1920
- XL:height-1600, width-2560
The returned image may be larger or smaller than the size requested, depending on the size and aspect ratio of the original image. If the requested preview size exceeds the original file, the latter one will be returned.
Note. Thumbnails are not generated for files larger than 20MB.
RESOURCE | /files/{id}/thumbnails/{type} |
DESCRIPTION | File's thumbnail endpoint. |
URL | https://api.4sync.com/v1_2/files/{id}/thumbnails/{type} |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | Thumbnail of the specified size of a file with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/files/UFedfe8Pba/thumbnails?oauth_params |
EXAMPLE RESPONSE | Image |
/folders
Folder Response
FolderResponse entity contains metadata of a folder, information about its owner and items in it, including files and other folders.Attributes | Type | Description |
---|---|---|
id | String | Folder unique identifier. |
name | String | Folder name. |
description | String | Folder description. |
parentId | String | Unique identifier of a folder containing the requested folder. Is NULL for a root folder. |
path | String | Path to the requested folder starting at the root. |
modified | Date | Last time a folder was modified. |
access | String | Access type for a folder. Can be public or private. |
numChildren | Long | Number of folders in the requested folder. |
numFiles | Long | Number of files in the requested folder. |
ownerId | String | Unique folder owner identifier. |
permissions | String | User permissions for a folder (e.g. read, write). |
passwordProtected | Boolean | Indicates whether the folder is protected by a password. |
folderLink | String | URL that can be used to view Simple view page of the requested folder. |
userPermissions | String | Indicates whether a specified user is a folder owner or not. Can be owner, write and read. |
status | String | Indicates whether the item is deleted or not. Can be deleted, trashed and normal. |
hasMembers | Boolean | Indicates whether a folder is shared by other فورشيرد users. |
Example of a folder response
{ "id": "sO0jo6Tf", "name": "Playlists", "description": "", "parentId": "t8xpmoZg", "path": "/My فورشيرد/Playlists", "modified": "2016-01-05T15:54:32.781Z", "access": "private", "numChildren": 0, "numFiles": 4, "ownerId": "0EPPgsNv", "permissions": "write", "passwordProtected": false, "folderLink": "http://www.4sync.com/folder/sO0jo6Tf/Playlists.html", "userPermissions": "owner", "status": "normal", "hasMembers": true }
Get information about a folder (GET /folders/{id})
Returns the full metadata about a folder.RESOURCE | /folder/{id} |
DESCRIPTION | Folder metainformation endpoint. |
URL | https://api.4sync.com/v1_2/folder/{id} |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | FolderResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folder/{id}?oauth_params |
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Get the list of children of a specified folder (GET /folders/{id}/children)
Returns a list of children (immediate subdirectories) of the specified folder.RESOURCE | /folder/{id}/children |
DESCRIPTION | Retrieves a list of children (immediate subdirectories) of the specified folder. |
URL | https://api.4sync.com/v1_2/folder/{id}/children |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | FolderResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folder/{id}/children?oauth_params |
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Get the list of files in folder (GET /folders/{id}/files)
Returns the files in the specified folder.RESOURCE | /folder/{id}/files |
DESCRIPTION | Retrieves a list of files in the specified folder. |
URL | https://api.4sync.com/v1_2/folder/{id}/files |
METHOD | GET |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | FilesResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folder/{id}/files?oauth_params |
EXAMPLE RESPONSE |
{ files: [ {/*File response*/} ] } |
Create folder (POST /folders)
Used to create a new empty folder. The new folder will be created in the specified parent folder. The Content-Type should be set to application/x-www-form-urlencoded.RESOURCE | /folders | ||||||||||||||||
DESCRIPTION | Create new folder. | ||||||||||||||||
URL | https://api.4sync.com/v1_2/folders | ||||||||||||||||
METHOD | POST (Content-Type: application/x-www-form-urlencoded) | ||||||||||||||||
VERSION | v1_2 | ||||||||||||||||
PARAMETERS |
|
||||||||||||||||
RETURNS | FolderResponse entity with HTTP Status 200. | ||||||||||||||||
ERROR | See Errors section for details. | ||||||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}?oauth_params params: parentId=validFolderId&name=nonConflictingName |
||||||||||||||||
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Update folder meta info (PUT /folders/{id})
RESOURCE | /folders/{id} | ||||||||||||||||||||||||
DESCRIPTION | Folder meta info update endpoint. | ||||||||||||||||||||||||
URL | https://api.4sync.com/v1_2/folders/{id} | ||||||||||||||||||||||||
METHOD | PUT (application/x-www-form-urlencoded) | ||||||||||||||||||||||||
VERSION | v1_2 | ||||||||||||||||||||||||
PARAMETERS |
|
||||||||||||||||||||||||
RETURNS | FolderResponse entity with HTTP Status 200. | ||||||||||||||||||||||||
ERROR | See Errors section for details. | ||||||||||||||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}?oauth_params params: name=newNonConflictName&descriotion=newTestDescription |
||||||||||||||||||||||||
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Delete folder (DELETE /folders/{id})
Deletes a folder specified by id.RESOURCE | /folders/{id} |
DESCRIPTION | Folder deletion endpoint. |
URL | https://api.4sync.com/v1_2/folders/{id} |
METHOD | DELETE |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | No content with HTTP Status 204. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}?oauth_params |
EXAMPLE RESPONSE | NO CONTENT |
Copy folder (POST /folders/{id}/copy)
Used to create a copy of a folder.RESOURCE | /folders/{id}/copy | ||||||||||||
DESCRIPTION | Creates a copy of a folder. | ||||||||||||
URL | https://api.4sync.com/v1_2/folders/{id}/copy | ||||||||||||
METHOD | POST | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
RETURNS | FolderResponse entity with HTTP Status 200. | ||||||||||||
ERROR | See Errors section for details. | ||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}/copy?oauth_params params: folderId=validFolderId&name=newNonCoflictingName |
||||||||||||
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Move folder (POST /folders/{id}/move)
Used to create a copy of a folder in another folder and then delete the original.RESOURCE | /folders/{id}/move | ||||||||||||
DESCRIPTION | Change parentId for folder. | ||||||||||||
URL | https://api.4sync.com/v1_2/folders/{id}/move | ||||||||||||
METHOD | POST | ||||||||||||
VERSION | v1_2 | ||||||||||||
PARAMETERS |
|
||||||||||||
RETURNS | FolderResponse entity with HTTP Status 200. | ||||||||||||
ERROR | See Errors section for details. | ||||||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}/move?oauth_params params: folderId=validFolderId&name=newNonCoflictingName |
||||||||||||
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Move folder to Recycle bin (POST /folders/{id}/trash)
Used to move a folder to a Recycle bin.RESOURCE | /folders/{id}/trash |
DESCRIPTION | Moves a folder to Recycle bin. |
URL | https://api.4sync.com/v1_2/folders/{id}/trash |
METHOD | POST |
VERSION | v1_2 |
PARAMETERS | |
RETURNS | FolderResponse entity with HTTP Status 200. |
ERROR | See Errors section for details. |
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}?oauth_params |
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
Move folder from Recycle bin (POST /folders/{id}/untrash)
Restores a folder, moved to Recycle bin. Default: restores a folder to its previous parent folder, i.e. the folder before deletion. If its parent folder no longer exists, a new folder is created. If a folder with the same name exists in the parent folder, some new unique name must be specified in the request.RESOURCE | /folders/{id}/untrash | ||||||||
DESCRIPTION | Restores a folder from Recycle bin. | ||||||||
URL | https://api.4sync.com/v1_2/folders/{id}/untrash | ||||||||
METHOD | POST | ||||||||
VERSION | v1_2 | ||||||||
PARAMETERS |
|
||||||||
RETURNS | FolderResponse entity with HTTP Status 200. | ||||||||
ERROR | See Errors section for details. | ||||||||
EXAMPLE REQUEST | https://api.4sync.com/v1_2/folders/{id}?oauth_params params: name=non_conflicting_name |
||||||||
EXAMPLE RESPONSE |
{ /*Folder Response*/ } |
ERROR HANDLING
Sample error response:
{ "message": "Invalid value for access parameter. The following values are supported: [private, public].", "code": "400.0217", "cause": null, "fieldName": "access" }
Error Attributes
The following attributes are returned as part of an error content.Attributes | Description |
---|---|
message | Human readable message about the error. |
code | The HTTP code of the error response. |
cause | More detailed information about the reasons of error. |
fieldName | An optional attribute which is filled if the error was due to a specific parameter. |
Common Responses
Code | Message |
---|---|
400 | Bad request. |
400.0212 | Request parameter [parameter_name] of type [parameter_type] is missing. |
400.0213 | Invalid value for [parameter_name] parameter. The length of the [parameter_name] value should be between [value_1] and [value_2]. |
400.0215 | Invalid value for [parameter_name] parameter, [parameter_name] may not be empty. |
400.0216 | Invalid value for [parameter_name] parameter. The following values are supported: [supported_values]. |
400.0218 | Invalid value for [parameter_name] parameter. The value of the [parameter_name] should be less than or equal to [value]. |
400.0219 | Invalid value for [parameter_name] parameter. The value of the [parameter_name] should be greater than or equal to [value]. |
400.0220 | E-mail address is incorrect. |
400.0303 | Access denied. The folder is password protected. |
400.0500 | Incorrect parameter type or malformed body. |
401 | Unauthorized. |
401.0300 | Unauthorized. |
401.0301 | Unauthorized. Your token either expired, rejected or does not exist. |
401.0316 | Unauthorized. User either does not exist or refuse your application. |
401.0317 | Unauthorized. Your Premium subscription has expired and your account is currently inaccessible. |
401.0318 | Invalid nonce. You should generate a Nonce value that is unique for all requests with that timestamp. |
401.0319 | Timestamp refused. Difference between server and client timestamp must be no more than [value]. |
401.0600 | Internal server error. |
403 | Forbidden. |
403.0100 | Insufficient storage space. |
403.0101 | User's plan file size limit exceeded. |
403.0102 | Number of files in folder limit exceeded. |
403.0103 | Number of files in account limit exceeded. |
403.0104 | Number of nested folders limit exceeded. |
403.0105 | Number of folders in account limit exceeded. |
403.0200 | Root folder can't be renamed or deleted. |
403.0201 | The file or folder with name [name] already exists. |
403.0206 | File size limit exceeded. To upload files larger than [value] MB, use /upload. |
403.0223 | The action or subresource request is not allowed. The resource is in trash. |
403.0224 | The action is not allowed. The resource is not in trash. |
403.0225 | Incorrect file size. |
403.0228 | The current character set is not supported yet. |
403.0233 | Current file type does not support this action. |
403.0302 | Insufficient permissions to access or modify the resource. |
403.0303 | Access denied. The folder is password protected. |
403.0305 | The resource belongs to a user suspended for violation of the service policy. |
403.0306 | Folder access may only be modified by an owner. |
403.0307 | Folder permissions may only be modified by an owner. |
403.0308 | Folder password may only be modified by an owner. |
403.0313 | User is inactive. |
403.0461 | Error: The file was either moved or deleted. |
404 | Not Found. |
405 | Method Not Allowed. |
405.0211 | HTTP request method [method_name] is not supported by the resource. The following HTTP request methods are supported: [supported_methods]. |
406 | Not Acceptable. |
406.0209 | Requested data format is not supported. The following formats are supported: [supported_formats]. |
415 | Unsupported Media Type. |
415.0210 | Provided media type is not supported. The following media types are supported: [suppoted_media_types]. |
429 | Too Many Requests. |
429.0107 | Rate limit exceeded. Just [max_number_of_calls] per [time_range] for [limit_type] allowed. |
500 | Internal server error. |
500.0600 | Internal server error. |
501 | Not Implemented. |
501.0601 | [custom_error_message] |
501.0602 | Transfer aborted. |