Replace files

Replace files of a draft/template workflow owned by the user’s organization.

Request

POST https://api.cloudplan.biz/api/workflow/replace_files

{
    "cp_id":"5F2D02F31732683AECF2A48C20D32345",
    "files": [
            {
                    "file_replace_cp_id":"5F6C7CE11B61D1A8F6E435806CB361AD",     // id of the file to be replaced
                    "file_new_cp_id":"VGVZDGZPBGUTMTE5",                         // id of the new file
                    "file_new_parent_cp_id":"5F184A7EBD9281BF6B1C0C06E68EF34F"   // id of the folder of the new file
            },
            {
                    "file_replace_cp_id":"5F6C7CE148893681CBDBC9A19C6B34AA",
                    "file_new_cp_id":"VGVZDGZPBGUTNZA",
                    "file_new_parent_cp_id":"5F184A7EBD9281BF6B1C0C06E68EF34F"
            }
    ]
}

Reply

{
    "status": 200,
    "result": true,
    "params": {
        "cp_id": "5F2D02F31732683AECF2A48C20D32345",
        "files": [
            {
                "file_replace_cp_id": "5F6C7CE11B61D1A8F6E435806CB361AD",
                "file_new_cp_id": "VGVZDGZPBGUTMTE5",
                "file_new_parent_cp_id": "5F184A7EBD9281BF6B1C0C06E68EF34F",
                "file_new_name": "Testfile-119Loremipsumdolor.dotm"
            },
            {
                "file_replace_cp_id": "5F6C7CE148893681CBDBC9A19C6B34AA",
                "file_new_cp_id": "VGVZDGZPBGUTNZA",
                "file_new_parent_cp_id": "5F184A7EBD9281BF6B1C0C06E68EF34F",
                "file_new_name": "Testfile-70Loremipsumdolorsitametconsectetueradipis.odp"
            }
        ]
    },
    "data": {
        "project_name": "alex template",
        "project_description": "nothing",
        "project_deadline": "",
        "project_message_signer": "lalalala",
        "project_runtime": 604800,
        "project_remind_freq": 86400,
        "cp_id": "5F2D02F31732683AECF2A48C20D32345",
        "project_type": "contract",
        "created": 1596785395,
        "status": "template",
        "creator_cp_id": "5DF20CE3DD3DBE0EE1397A5977E781A8",
        "start_time": "",
        "starter_cp_id": "",
        "starter_email": "",
        "signing_steps": [
            [
                {
                    "user_cp_id": "5DF20CE3DD3DBE0EE1397A5977E781A8",
                    "email": "user1@cloudplan.net",
                    "token": "5F6C7CE1C9C60645B4C975AC6317BE7F",
                    "name": "",
                    "rule": "must_sign"
                }
            ],
            [
                {
                    "user_cp_id": "5DF20CE3DD3DBE0EE1397A5977E781A8",
                    "email": "user1@cloudplan.net",
                    "token": "5F6C7CE1FA0B12CAFB79D929AEA71253",
                    "name": "",
                    "rule": "must_sign"
                },
                {
                    "user_cp_id": "",
                    "email": "placeholder-2-1@cloudplan.net",
                    "token": "5F6C7CE1BDDC32493A6F41CB7DC3A297",
                    "name": "Placeholder 2-1",
                    "rule": "must_sign"
                }
            ]
        ],
        "documents": [
            {
                "file_cp_id": "VGVZDGZPBGUTMTE5",
                "file_name": "Testfile-119Loremipsumdolor.dotm",
                "folder_cp_id": "5F184A7EBD9281BF6B1C0C06E68EF34F",
                "file_options": []
            },
            {
                "file_cp_id": "VGVZDGZPBGUTNZA",
                "file_name": "Testfile-70Loremipsumdolorsitametconsectetueradipis.odp",
                "folder_cp_id": "5F184A7EBD9281BF6B1C0C06E68EF34F",
                "file_options": []
            }
        ],
        "target_folder_cp_id": "5ECE77176D70DAF6EFA685DBDA719957"
    }
}

Error Codes

no_replace_files_provided
no_folder_rights
parent_folder_not_found
new_file_not_found
invalid_file_parameter
invalid_cp_id