Skip to content

Commit

Permalink
API Doc updates for WHMCS 7.5 + sample code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpugh committed Feb 21, 2018
1 parent 29c9d7f commit 5662101
Show file tree
Hide file tree
Showing 141 changed files with 170 additions and 7 deletions.
1 change: 1 addition & 0 deletions api-reference/acceptorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/acceptquote.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/activatemodule.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addannouncement.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addbannedip.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addbillableitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addcancelrequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
2 changes: 2 additions & 0 deletions api-reference/addclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Adds a client.
| language | string | Default language setting. Provide full name: 'english', 'french', etc... | Optional |
| clientip | string | IP address of the user | Optional |
| notes | string | Admin only notes | Optional |
| marketingoptin | bool | Set true to opt client in to marketing emails | Optional |
| noemail | bool | Pass as true to skip sending welcome email | Optional |
| skipvalidation | bool | Pass as true to ignore required fields validation | Optional |

Expand Down Expand Up @@ -77,6 +78,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addclientnote.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addcontact.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addcredit.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addinvoicepayment.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addproduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addprojectmessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/addprojecttask.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
6 changes: 6 additions & 0 deletions api-reference/addticketnote.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Add a note to a ticket by Ticket ID or Ticket Number.
| ticketnum | string | The Client Ticket Number ID to apply the note to | Optional |
| ticketid | int | The id of the ticket in the database. Either $ticketnum or $ticketid is required | Optional |
| markdown | bool | Should markdown be used on the ticket note output | Optional |
| attachments | array | Optional base64 json encoded array of file attachments. Can be the direct output of a multipart-form-data form submission ($_FILES superglobal in PHP) or an array of arrays consisting of both a filename and data keys (see example below). | Optional |

### Response Parameters

Expand All @@ -38,10 +39,12 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
'ticketid' => '1',
'message' => 'This is a sample ticket note',
'markdown' => true,
'attachments' => base64_encode(json_encode([['name' => 'sample_text_file.txt', 'data' => base64_encode('This is a sample text file contents')]])),
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand All @@ -55,6 +58,7 @@ $postData = array(
'ticketid' => '1',
'message' => 'This is a sample ticket note',
'markdown' => true,
'attachments' => base64_encode(json_encode([['name' => 'sample_text_file.txt', 'data' => base64_encode('This is a sample text file contents')]])),
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
Expand All @@ -77,10 +81,12 @@ print_r($results);
Possible error condition responses include:

* Ticket ID not found
* Message is required


### Version History

| Version | Changelog |
| ------- | --------- |
| 1.0 | Initial Version |
| 7.5 | Added support for attachments |
5 changes: 5 additions & 0 deletions api-reference/addticketreply.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Add a reply to a ticket by Ticket ID.
| status | string | The status to set on the ticket after the reply is made if the default status on admin/client response is not required. See GetSupportStatuses API command | Optional |
| noemail | bool | Set to true to stop the ticket reply email being sent | Optional |
| customfields | string | A base64 encoded array of the custom fields to update | Optional |
| attachments | array | Optional base64 json encoded array of file attachments. Can be the direct output of a multipart-form-data form submission ($_FILES superglobal in PHP) or an array of arrays consisting of both a filename and data keys (see example below). | Optional |

### Response Parameters

Expand All @@ -47,10 +48,12 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
'clientid' => '1',
'customfields' => base64_encode(serialize(array("1"=>"Google"))),
'useMarkdown' => true,
'attachments' => base64_encode(json_encode([['name' => 'sample_text_file.txt', 'data' => base64_encode('This is a sample text file contents')]])),
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand All @@ -66,6 +69,7 @@ $postData = array(
'clientid' => '1',
'customfields' => base64_encode(serialize(array("1"=>"Google"))),
'useMarkdown' => true,
'attachments' => base64_encode(json_encode([['name' => 'sample_text_file.txt', 'data' => base64_encode('This is a sample text file contents')]])),
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
Expand Down Expand Up @@ -99,3 +103,4 @@ Possible error condition responses include:
| Version | Changelog |
| ------- | --------- |
| 1.0 | Initial Version |
| 7.5 | Added support for attachments |
1 change: 1 addition & 0 deletions api-reference/addtransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/affiliateactivate.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/applycredit.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/cancelorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/capturepayment.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/closeclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/createinvoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/createoauthcredential.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/createproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/createquote.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deactivatemodule.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/decryptpassword.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteannouncement.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deletecontact.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteoauthcredential.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteprojecttask.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deletequote.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteticket.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/deleteticketnote.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/domaingetlockingstatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
1 change: 1 addition & 0 deletions api-reference/domaingetnameservers.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS,
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
```
Expand Down
Loading

0 comments on commit 5662101

Please sign in to comment.