Replace participants

Replace users of a draft workflow owned by the user’s organization.

Request

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

{
    "cp_id": "5F2D02F31732683AECF2A48C20D32345",
    "users": [
            {
                    "user_replace_email": "user2@cloudplan.net",                 // email to be replaced
                    "user_replace_new_email": "placeholder-2-1@cloudplan.net",   // new email
                    "step_index" : 2                                             // (optional) index of the step (starting from 1) where to replace the user. If not provided, the user will be replaced in all steps.
            },
            {
                    "user_replace_email": "user2@cloudplan.net",
                    "user_replace_new_email": "user1@cloudplan.net"
            }
    ]
}

Reply

{
    "status": 200,
    "result": true,
    "params": {
        "cp_id": "5F2D02F31732683AECF2A48C20D32345",
        "users": [
            {
                "user_replace_email": "user2@cloudplan.net",
                "user_replace_new_email": "placeholder-2-1@cloudplan.net",
                "step_index": 2
            },
            {
                "user_replace_email": "user2@cloudplan.net",
                "user_replace_new_email": "user1@cloudplan.net"
            }
        ]
    },
    "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": "",
                    "email": "user1@cloudplan.net",
                    "token": "5F6C7CE1C9C60645B4C975AC6317BE7F",
                    "name": "",
                    "rule": "must_sign"
                }
            ],
            [
                {
                    "user_cp_id": "",
                    "email": "placeholder-2-1@cloudplan.net",
                    "token": "5F6C7CE1FA0B12CAFB79D929AEA71253",
                    "name": "",
                    "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"
    }
}

Can also send Group cp id instead of emails.

Replace an user with a group

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

{
    "cp_id": "5F2D02F31732683AECF2A48C20D32345",
    "users": [
            {
                    "user_replace_email": "user2@cloudplan.net",
                    "user_replace_new_email": "5AABB027CF9FDACEDF9553194C32A911",
            }
    ]
}

Replace a group with an user

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

{
    "cp_id": "5F2D02F31732683AECF2A48C20D32345",
    "users": [
            {
                    "user_replace_email": "5AABB027CF9FDACEDF9553194C32A911",
                    "user_replace_new_email": "user1@cloudplan.net"
            }
    ]
}

Replace a group with another group

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

{
    "cp_id": "5F2D02F31732683AECF2A48C20D32345",
    "users": [
            {
                    "user_replace_email": "5AABB027CF9FDACEDF9553194C32A911",
                    "user_replace_new_email": "6124B9A090B0B2A78AEC8BEC5436566D"
            }
    ]
}

Error Codes

no_replace_users_provided
invalid_user_parameter
invalid_cp_id