Add Project

This command is used to add a project to WHMCSPM2

Attributes

name - project name
description - project description
category - category id
priority - priority id
client - client id the project is for (optional)
status - status id
filesok - (boolean) allow client to add files to project
tasksok - (boolean) allow client to add tasks to project
private - (boolean) internal project, client cannot view
admin_email_ok - (boolean) enable admin notifications for project
client_email_ok - (boolean) enable client notifications for project
assigned - comma separated string of admin ids that are assigned to project
startdate - start date of the project, default is today (whmcs date format)
enddate - end date or deadline of the project, default is today (whmcs date format)
creatortype -  (1 for admin,2 for client) default is 1 for admin
creator - client id or admin id
budget - budget of the project in the format of 0.00
sendemail - (boolean) Send Client and Admin email notifications?
customfields - a base64 encoded serialized array of custom field values
**NOTE** For boolean values, use 0 for false and 1 for true;

Example Command

$postfields["action"] = "whmcspm2addproject";
$postfields["name"] = "Sample API created project";
$postfields["description"] = "This is a description";
$postfields["category"] = "1";
$postfields["priority"] = "1";
$postfields["client"] = "2212";
$postfields["status"] = "2";
$postfields["filesok"] = "1";
$postfields["tasksok"] = "1";
$postfields["private"] = "0";
$postfields["admin_email_ok"] = "1";
$postfields["client_email_ok"] = "1";
$postfields["assigned"] = "1,2,5";
$postfields["startdate"] = "2011-11-03";
$postfields["enddate"] = "2012-01-22";
$postfields["creatortype"] = "1";
$postfields["creator"] = "4";
$postfields["budget"] = "250.00";
$postfields["sendemail"] = "0";
$customfields = array("1" => "Some Value","2" => "Some Other Value");
$postfields["customfields"] = base64_encode(serialize($customfields));

Returned Variables

result - error / success
projectid - the project id that was just created
Was this answer helpful? 0 Users Found This Useful (41 Votes)