Check-out File

Prev Next

This tutorial demonstrates how to check out a file via the RESTful API.

The steps include:

  • Check out a file using the file ID

Additional API documentation

To get a list of most of the API requests available, with the 12d Synergy server running, browse http://synergy.myserver.com/api-docs/ui/index.

(Replace synergy.myserver.com with the external server address and update the port numbers if necessary.)

1.1. Getting the Personal Access Token to access API

The tutorial for getting the PAT is here: Generate PAT in Web client.

1.2. Getting a file using the file ID

This request can be found in the API documentation under Files marked 'Check out a file'.

Sample Request

curl --location 'http://{your-server-here}/api/v1/files/{file-id-here}/checkout' \

--header 'Authorization: Bearer <token-here>' \

--header 'Content-Type: application/json'

Below is a sample response of a file name b2.txt.

Click in the line below to see the code.

Sample Response

{
    "Success": true,
    "File": {
        "ID": {
            "_id": 170158,
            "_server_id": 1,
            "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
            "IDString": "170158_1"
        },
        "FileName": "random file.txt",
        "DisplayName": null,
        "FolderID": {
            "_id": 60008,
            "_server_id": 1,
            "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
            "IDString": "60008_1"
        },
        "State": "None",
        "LastChangeType": 2,
        "LastChangedBy": "",
        "LastChangedTime": "2025-04-13T23:15:00.987",
        "IsCheckedOut": true,
        "LastModified": "2024-10-15T04:36:56.023",
        "CreatedOn": "2024-10-15T04:36:40.493",
        "Path": "Test/random file.txt",
        "LatestVersion": 13,
        "SizeReadable": "12B",
        "Size": 12,
        "ActiveCheckout": {
            "checkout_user_name": "",
            "checkout_user_id": {
                "_id": 1,
                "_server_id": 1,
                "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
                "IDString": "1_1"
            },
            "checkout_time": "2025-04-29T23:15:31.85",
            "machine_id": "Restful API Client                                                                                                                                                                                                                                             "
        },
        "ActiveFolderCheckout": null,
        "FileType": "TXT File",
        "FileIcon": "",
        "HasReferences": false,
        "IsLinked": false,
        "LinkedPath": "",
        "Attributes": [
            {
                "auto_increment_start": 1,
                "description": "",
                "enum_items": null,
                "input_mask": "",
                "is_auto_increment": false,
                "is_visible": true,
                "optional": false,
                "order": 0,
                "read_only": false,
                "reprompt_on_change": false,
                "type": 3,
                "value": {
                    "_value": "2025-04-11T01:19:40",
                    "enum_id": null,
                    "value_id": {
                        "_id": 180054,
                        "_server_id": 1,
                        "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
                        "IDString": "180054_1"
                    }
                },
                "visibility_constraint": null,
                "workflow_id": null,
                "attribute_id": {
                    "_id": 5,
                    "_server_id": 1,
                    "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
                    "IDString": "5_1"
                },
                "name": "Sent Date",
                "display_name": "Sent Date",
                "id": {
                    "_id": 5,
                    "_server_id": 1,
                    "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
                    "IDString": "5_1"
                }
            }
        ],
        "ChangeAttributes": null,
        "EntityObject": null,
        "ActiveMs365Session": null
    }
}