Content Service REST Endpoints
GET FILE
GET /api/repo/<connectorid>/file?id=<id>
Description:
- Returns an input stream that contains the document's content.
Path Parameters:
connectorid: The connector id of your content service connector
Query Parameters:
id: Source repository id. Differs depending on repository.
With CURL
curl -u admin:admin -X GET "localhost:8081/simflofy-admin/api/repo/box/file?id=384896487495" | json_pp
GET OBJECT ID BY PATH
GET /api/repo/<connectorid>/idbypath?fileName=<fileName>&folderPath=<folderPath>
Description:
- Searches for a file and returns its unique id
Path Parameters:
connectorid: The connector id of your content service connector
Query Parameters:
fileName: Name of the file to find
folderPath: Parent folder path of the file
Returns:
{
"results": {
"id": "38489648749"
},
"success": true
}
With CURL
curl -u admin:admin -X GET "localhost:8081/simflofy-admin/api/repo/box/idbypath?fileName=testFolder&folderPath=/TestFolder/ | json_pp
POST FILE
POST /api/repo/<connectorid>/file?fileName=<fileName>&folderId=<folderId>&type=<type>
Description:
- Uploads a file to the target repository. Must be a multipart /form-data request with the file as a body. Multipart form boundaries will need to be set. See the Postman tutorial for correct settings.
Body Parameters:
file: Attach your multipart file as the file parameter
Path Parameters:
connectorid: The connector id of your content service connector
Query Parameters:
fileName: The name of the file.
folderId: The repository id of the folder where the file with live.
type: The document type. Varies greatly depending on repository. Use types endpoint.
Returns:
{
"results": {
"id": "629425696136"
},
"success": true
}
With CURL
curl -u admin:admin -Ffile=@/Users/simflofy/CaterpillarDEUAjax.pdf"
localhost:8081/simflofy-admin/api/repo/box/file?fileName=Caterpillar%20DEU%20Ajax.pdf&folderId=105965269305&type=document" | json_pp
UPDATE FILE
PUT /api/repo/<connectorid>/update?
fileId=<fileId>&folderId=<folderId>&fileName=<fileName>&type=<type>&property1=<value1>&property2=...
Description:
- Uploads a file's content or properties to the target repository as an update.Content can be attached as a binary body to the request. If no content is supplied, Simflofy will try update properties instead.
Path Parameters:
connectorid:The connector id of your content service connector
Query Parameters:
fileId:The ID of the file you wish to update, from the repository.
fileName:The name of the file. Use if supplying folder ID.
folderId:The repository id of the folder where the file you are updating lives. Use if supplying fileName.
type:The document type. Varies greatly depending on repository. Use types endpoint.
property(n): Properties that you wish to update with this call can be appended to the query
Returns:
{
"results": {
"id": "629425696136"
},
"success": true
}
With CURL
curl -u admin:admin -Ffile=@/Users/simflofy/CaterpillarDEUAjax.pdf"
localhost:8081/simflofy-admin/api/repo/box/update?fileName=Caterpillar%20DEU%20Ajax.pdf&folderId=105965269305&type=document"
| json_pp
UPDATE FILE CONTENT
PUT /api/repo/<connectorid>/updateContent?fileId=<fileId>
Description:
- Will update the content of the file using the supplied request body
Path Parameters:
connectorid:The connector id of your content service connector
Query Parameters:
fileId:The ID of the file you wish to update, from the repository.
Returns:
{
"results": {
"id": "804939960448"
},
"success": true
}
With CURL
curl -X PUT -u admin:admin --data-binary '@/Users/simflofy/CaterpillarDEUAjax-newversion.pdf'
'localhost:8081/simflofy-admin/api/repo/box/updateContent?fileId=804939960448'
| json_pp
UPDATE FILE PROPERTIES
PUT /api/repo/<connectorid>/updateProperties?fileId=<fileId>&<param1>=<value1>&<param2>=<value2>
Description:
- Will update the properties of the file using the supplied parameters
Path Parameters:
connectorid:The connector id of your content service connector
Query Parameters:
fileId:The ID of the file you wish to update, from the repository.
paramX:Name of the parameter to update
valueX:New value of the parameter
Returns:
{
"results": {
"id": "804939960448"
},
"success": true
}
With CURL
curl -X PUT -u admin:admin
'localhost:8081/simflofy-admin/api/repo/box/updateProperties?fileId=804939960448&textfield=newvalue'
| json_pp
CHECKIN FILE
POST /api/repo/<connectorid>/checkin?id=<id>&comment=<comment>
Description:
- Checks in the target file with the specified comment
Path Parameters:
connectorid: The connector id of your content service connector
Query Parameters:
id: Source repository id of the file
comment: Optional:The checkin message.
POST /api/repo/cmis/checkin?id=5dba1525-44a6-45ed-a42e-4a155a3f0539&comment=Spacing%20Fix
Returns:
{
"results": {
"id": "5dba1525-44a6-45ed-a42e-4a155a3f0539"
},
"success": true
}
With CURL
curl -u admin:admin -X POST "localhost:8081/simflofy-admin/api/repo/cmis/checkin?
id=5dba1525-44a6-45ed-a42e-4a155a3f0539&comment=Spacing%20Fix" | json_pp
CHECK OUT FILE
POST /api/repo/<connectorid>/checkout?id=<id>
Description:
- Checks out the target file
Path Parameters:
connectorid: The connector id of your content service connector
Query Parameters:
id: Source repository id of the file
POST /api/repo/cmis/checkout?id=5dba1525-44a6-45ed-a42e-4a155a3f0539
Returns:
{
"results": {
"id": "5dba1525-44a6-45ed-a42e-4a155a3f0539"
},
"success": true
}
With CURL
curl -u admin:admin -X POST "localhost:8081/simflofy-admin/api/repo/cmis/checkout?
id=5dba1525-44a6-45ed-a42e-4a155a3f0539" | json_pp
GET FILE BATCH (3.1.1 and older)
GET /api/repo/__BATCH__/file?id[x]=<idx>&conn[x]=<connx>&fname[x]=<fnamex>
Description:
- Retrieves the requested files and returns them as a zip file.
Query Parameters:
[x]
equals an integer
idx: ID of the file to retrieve
connx: Connector id of the file
fname: The name to give the file when zipped.
GET /api/repo/__BATCH__/file?
id0=/home/user/simflofy/test.txt&conn0=localFS&fname0=test.txt&id1=629425696136&conn1=box&fname1=Caterpillar%20DEU%20Ajax.pdf
With CURL
curl -u admin:admin -X "localhost:8081/simflofy-admin/api/repo/__BATCH__/file?
id0=/home/user/simflofy/test.txt&conn0=localFS&fname0=test.txt&id1=629425696136&conn1=box&fname1=Caterpillar%20DEU%20Ajax.pdf"
GET FILE BATCH (3.1.2+)
POST /api/repo/batch
Description:
- Batches files into a zip file and returns a download link item, whose
id
can be used with the File Service. Any errors will be reported in the fileerrors.txt
, included with the export.
Body Parameters:
A JSON Object in the following format:
{
"batch":[
{
"fileName": "myfile.txt"
connId: "fs"
"id": "/Users/user/Documents/myfiles.txt"
},
{
"fileName": "boxfile.txt"
connId: "box"
"id": "635846060210"
}
]
}
Returns:
{
"success": true,
"results": {
"internal": true,
"expires": 1646759571044,
"fileName": "BATCH_1646757913.zip",
"createdBy": "admin",
"connectorId": "Simflofy Admin",
"docId": "6213e0f0f7558f0cc7458e5e",
"created": 0,
"id": "$2a$04$3vXhjvIAX7lQZY4OSUa8L.tY6263QBw61eye9OYaEiAGp9enNX.lW",
"used": 0
}
}
GET FILE VERSIONS
GET /api/repo/<connectorid>/listversions?id=<id>
Description:
- Returns a JSON Object listing the versions of an object.
Path Parameters:
connectorid : The connector id of your content service connector
Query Parameters:
id : Source repository id. Differs depending on repository.
GET /api/repo/cmis/listversions?id=5dba1525-44a6-45ed-a42e-4a155a3f0539
Returns:
{
"results": [
{
"docId": "5dba1525-44a6-45ed-a42e-4a155a3f0539;1.0",
"lastModified": 1583870808000,
"name": null,
"versionLabel": "1.0",
"versionLength": 409303,
"versionSeriesId": "512"
},
{
"docId": "5dba1525-44a6-45ed-a42e-4a155a3f0539;2.0",
"lastModified": 1583870809000,
"name": null,
"versionLabel": "2.0",
"versionLength": 409303,
"versionSeriesId": "1024"
}
],
"success": true
}
With CURL
curl -u admin:admin -X GET "localhost:8081/simflofy-admin/api/repo/spo/listversions?
id=5dba1525-44a6-45ed-a42e-4a155a3f0539" | json_pp
DELETE FILE OR FOLDER
Delete Requests:
Description:
- Deletes a file based on source id.
DELETE /api/repo/<connectorid>/delete?id=<id>&allversions=<allversions>
Description:
- Deletes a folder based on path.
DELETE /api/repo/<connectorid>/delete?path=<path> //Only for Filesystem
Path Parameters:
connectorid : The connector id of your content service connector
Query Parameters:
id: The source repository id of the file.
allversions: Delete all versions of the file, if any exist. Defaults is true
path: The path of the folder to delete.
DELETE /api/repo/box/delete?id=629425696136&allversions=false
Returns:
{
"results": {
"id": "629425696136"
},
"success": true
}
With CURL (remember to encode spaces and quotes)
curl -u admin:admin -X DELETE "localhost:8081/simflofy-admin/api/repo/box/delete?
id=629425696136&allversions=false" | json_pp
GET FOLDER ITEMS
Request:
GET /api/repo/<connectorid>/folderitems?id=<id>
Description:
- Returns a JSON Object listing the folders content.
Path Parameters:
connectorid :The connector id of your content service connector
Query Parameters:
id: Source repository id. Differs depending on repository.
GET /api/repo/box/folderitems?id=384896487495
Returns:
{
"results": {
"/All Files/Simflofy/credentials.csv": {
"BaseType": "document",
"CheckedOut": "false",
"CheckinComment": null,
"ContentLength": "201",
"CreatedBy": "",
"CreatedDate": "1573473832000",
"Description": "",
"Id": "556063296648",
"ItemPath": "/All Files/Simflofy/credentials.csv",
"MimeType": "text/csv",
"ModifiedBy": "",
"ModifiedDate": "1573473832000",
"Name": "credentials.csv",
"SimflofyType": "document",
"SitePath": "",
"Type": "file",
"VersionCount": "-1",
"VersionLabel": null,
"VersionSeriesId": ""
},
"/All Files/Simflofy/test copy 24.txt": {
"BaseType": "document",
"CheckedOut": "false",
"CheckinComment": null,
"ContentLength": "40",
"CreatedBy": "",
"CreatedDate": "1573473831000",
"Description": "",
"Id": "556069315644",
"ItemPath": "/All Files/Simflofy/test copy 24.txt",
"MimeType": "text/plain",
"ModifiedBy": "",
"ModifiedDate": "1573473831000",
"Name": "test copy 24.txt",
"SimflofyType": "document",
"SitePath": "",
"Type": "file",
"VersionCount": "-1",
"VersionLabel": null,
"VersionSeriesId": ""
},
"/All Files/Simflofy/test copy.txt": {
"BaseType": "document",
"CheckedOut": "false",
"CheckinComment": null,
"ContentLength": "40",
"CreatedBy": "",
"CreatedDate": "1573473831000",
"Description": "",
"Id": "556069266751",
"ItemPath": "/All Files/Simflofy/test copy.txt",
"MimeType": "text/plain",
"ModifiedBy": "",
"ModifiedDate": "1573473831000",
"Name": "test copy.txt",
"SimflofyType": "document",
"SitePath": "",
"Type": "file",
"VersionCount": "-1",
"VersionLabel": null,
"VersionSeriesId": ""
}
},
"success": true
}
With CURL
curl -u admin:admin -X GET "localhost:8081/simflofy-admin/api/repo/box/folderitems?id=384896487495" | json_pp
CREATE FOLDER
POST /api/repo/(connectorid)/folder?path=<path>
Description: Creates a folder at the specified location.
Path Parameters: connectorid : The connector id of your content service connector
Query Parameters: path: Absolute path of the folder to create.
POST /api/repo/box/folder?path=/Simflofy/testfolder
Returns:
{
"results": {
"id": "109374560508"
},
"success": true
}
With CURL
curl -u admin:admin -X POST"localhost:8081/simflofy-admin/api/repo/box/folder?path=Simflofy/testfolder" | json_pp
GET ITEM PROPERTIES
GET /api/repo/<connectorid>/properties?id=<id>
Description:
- Returns a JSON Object listing the objects properties
Path Parameters:
connectorid : The connector id of your content service connector
Query Parameters:
id: Source repository id. Differs depending on repository.
GET /api/repo/box/properties?id=384896487495
Returns:
{
"results": {
"simflofy_created": {
"DisplayName": "[2019-11-11T07:03:46]",
"QueryName": "Created"
},
"simflofy_last_modified": {
"DisplayName": "[2019-11-15T18:46:31]",
"QueryName": "Last Modified"
},
"simflofy_filename": {
"DisplayName": "[Simflofy]",
"QueryName": "File Name"
},
"simflofy_content_type": {
"DisplayName": "[application/octet-stream]",
"QueryName": "Mime Type"
},
"simflofy_length": {
"DisplayName": "[16249882]",
"QueryName": "Content Length"
}
},
"success": true
}
With CURL
curl -u admin:admin -X GET "localhost:8081/simflofy-admin/api/repo/box/properties?id=384896487495" | json_pp