Skip to content
Last updated

UpdateProject

Updates a project

Request Parameters

ParameterTypeDescriptionRequired
actionstring"UpdateProject"Required
projectidintThe project ID to update.Required
adminidintThe adminId the project will be associated with.Optional
useridintThe user that the project is for.Optional
statusstringThe status of the project as defined in Project Management Settings.Optional
createdstringThe created date of the project in the Y-m-d format.Optional
duedatestringThe due date of the project in the Y-m-d format.Optional
completedboolWhether the project is completed.Optional
titlestringThe title of the project.Optional
ticketidsstringA comma-separated list of ticket IDs to associate with the project.Optional
invoiceidsstringA comma-separated list of invoice IDs to associate with the project.Optional
notesstringThe notes to associate with the project.Optional

Response Parameters

ParameterTypeDescription
resultstringThe result of the operation: success or error
messagestring'Project Has Been Updated'

Example Request (CURL)

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
    http_build_query(
        array(
            'action' => 'UpdateProject',
            // See https://developers.whmcs.com/api/authentication
            'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
            'password' => 'SECRET_OR_HASHED_PASSWORD',
            'title' => 'This is a Test Project',
            'adminid' => '2',
            'responsetype' => 'json',
        )
    )
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);

Example Request (Local API)

$command = 'UpdateProject';
$postData = array(
    'title' => 'This is a Test Project',
    'adminid' => '2',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later

$results = localAPI($command, $postData, $adminUsername);
print_r($results);

Example Response JSON

{
    "result": "success",
    "message": "Project Has Been Updated"
}

Error Responses

Possible error condition responses include:

  • Project ID Not Set
  • Project ID Not Found
  • Client ID Not Found
  • Admin ID Not Found

Version History

VersionChangelog
1.0Initial Version