openapi: 3.2.0 info: contact: email: cs@cpanel.net name: WebPros International, LLC url: https://cpanel.net/support/ description: UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings. license: name: cPanel License url: https://cpanel.net/legal-notices/ termsOfService: https://cpanel.net/legal-notices/ title: cPanel U Box Trapper API version: 11.137.9999.106 x-api-evangelist-provenance: 'Harvested verbatim from cPanel''s developer portal on 2026-09-05 via the MCP tool get-full-api-description at https://api.docs.cpanel.net/mcp. ONE mechanical change was made before storage: example values containing PEM private-key or certificate blocks, and AWS-access-key-shaped example strings, were replaced with REDACTED_* placeholders so the file can be stored in a public git repository without tripping secret scanning. No path, operation, parameter, schema or description was altered, added or removed.' servers: - description: A server running cPanel. url: https://{host}:{port}/execute variables: host: default: cpanel-server.tld description: The hostname of a server running cPanel. port: default: '2083' description: The cPanel port. security: - BasicAuth: [] tags: - description: The BoxTrapper module for UAPI. name: BoxTrapper paths: /BoxTrapper/blacklist_messages: get: x-readonly: false x-rollback: none description: 'This function blacklists email message senders. **Important:** When you disable the Receive Mail role, the system disables this function.' operationId: BoxTrapper-blacklist_messages parameters: - description: 'The email address for which to blacklist messages. **Warning:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated user.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: The filename of the email message to blacklist. examples: multiple: summary: Blacklist multiple filenames. value: queuefile=file1&queuefile=file2 single: summary: Blacklist one filename. value: file1 in: query name: queuefile required: true schema: example: example.msg type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: blacklist_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: An array of objects of blacklisted email information. items: properties: email: description: The email address that sent the blacklisted message. example: user@example.com format: email type: string failed: description: "Whether the system failed to blacklist the message.\n\n**Note:**\n\n The function only returns this value if it doesn't blacklist the message." enum: - 1 example: 1 type: integer matches: description: An array of messages that the system deleted. items: example: example.msg type: string type: array operator: description: The action that the function performed. enum: - blacklist example: blacklist type: string reason: description: "A message about the failure or the warning.\n\n**Note:**\n\n The function only returns this value if it doesn't delete the message or experiences issues when it deletes the message." example: This is a failure message. type: string warning: description: "Whether the system experienced issues when it blacklisted the message.\n\n**Note:**\n\n The function only returns this value if it doesn't blacklist the message." enum: - 1 example: 1 type: integer type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '- 1 - Success. - 0 - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Add email address to BoxTrapper blocked senders tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n blacklist_messages \\\n email='user@example.com' \\\n queuefile='file1'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/blacklist_messages?email=user%40example.com&queuefile=file1 - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_blacklist_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_blacklist_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/blacklist_messages/,\n {\n 'email' => 'user@example.com',\n 'queuefile' => 'file1',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_blacklist_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_blacklist_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'blacklist_messages',\n array (\n 'email' => 'user@example.com',\n 'queuefile' => 'file1',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/delete_messages: get: x-readonly: false x-rollback: none description: 'This function deletes messages in the BoxTrapper queue. **Important:** When you disable the Receive Mail role, the system disables this function.' operationId: BoxTrapper-delete_messages parameters: - description: 'The account''s email address. **Warning:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: "The filename of the email message who's sender to delete.\n\n **Warning:**\n\n To delete multiple email message senders, duplicate the parameter name." examples: multiple: summary: Delete multiple filenames. value: queuefile=file1.msg&queuefile=file2.msg single: summary: Delete a single filename. value: file1.msg in: query name: queuefile required: true schema: example: example.msg type: string - description: 'Whether to delete all messages that resemble the `queuefile` parameter''s value. * `1` - Delete all messages resembling the `queuefile` parameter. * `0` - Do **not** delete all messages resembling the `queuefile` parameter.' in: query name: all_like required: false schema: default: 0 enum: - 1 - 0 example: 1 type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: delete_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: An array of objects that contain information about the messages that matched the requested pattern. items: properties: email: description: The deleted email message's sender. example: user@example.com format: email type: string failed: description: 'Whether the system failed to delete the messages. **Note:** The function only returns this value if it doesn''t delete the message.' enum: - 1 example: 1 type: integer matches: description: An array of messages that the system deleted. items: example: example.msg type: string type: array operator: description: The operation that the system performed. enum: - delete example: delete type: string reason: description: 'A message about the failure or the warning. **Note:** The function only returns this value if it doesn''t delete the message or experiences issues when it deletes the message.' example: '(XID d9myfd) The system failed to locate the requested message:' type: string warning: description: 'Whether the system experienced issues when it deleted the message. **Note:** The function only returns this value if it experiences issues when it deletes the message.' enum: - 1 example: 1 type: integer type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 1 - 0 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Delete messages in the BoxTrapper queue tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n delete_messages \\\n email='user@example.com' \\\n queuefile='file1.msg'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/delete_messages?email=user%40example.com&queuefile=file1.msg - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_delete_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_delete_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/delete_messages/,\n {\n 'email' => 'user@example.com',\n 'queuefile' => 'file1.msg',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_delete_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_delete_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'delete_messages',\n array (\n 'email' => 'user@example.com',\n 'queuefile' => 'file1.msg',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/deliver_messages: get: x-readonly: false x-rollback: none description: 'This function delivers messages in the BoxTrapper queue. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-deliver_messages parameters: - description: 'The sender''s cPanel account email address for which to deliver email messages. **Warning:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'The filename of the email messages to deliver. **Note:** To deliver multiple email messages, pass this parameter multiple times.' examples: multiple: summary: Deliver multiple email messages. value: queuefile=example.msg&queuefile=example1.msg&queuefile=example2.msg single: summary: Deliver a single email message. value: example.msg in: query name: queuefile required: true schema: type: string - description: 'Whether to deliver all messages that resemble the `queuefile` parameter''s value. * `1` - Deliver all similar messages. * `0` - Don''t deliver all similar messages.' in: query name: all_like required: false schema: default: 0 enum: - 0 - 1 example: 1 type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: deliver_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: The delivered email message information. items: properties: email: description: The delivered email message's sender. example: user@example.com format: email type: string failed: description: "Whether the system could not deliver the message.\n\n**Note:**\n\n * The function only returns this value if it doesn't deliver the message.\n * `1` is the only possible value." enum: - 1 example: 1 type: integer matches: description: A list of delivered email messages. items: example: example.msg type: string type: array operator: description: 'The action that the function performed. * `deliver` * `deliverall`' enum: - deliver - deliverall example: deliverall type: string reason: description: 'A message about the failure or the warning. **Note:** The function only returns this value if it doesn''t delete the message or experiences issues when it deletes the message.' example: This is a failure message. type: string warning: description: "Whether the system experienced issues when it delivered the message.\n\n**Note:**\n\n * The function only returns this value if it experiences issues when it delivers the message.\n * `1` is the only possible value." enum: - 1 example: 1 type: integer type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Send messages in the BoxTrapper queue tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n deliver_messages \\\n email='user@example.com' \\\n queuefile='example.msg'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/deliver_messages?email=user%40example.com&queuefile=example.msg - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_deliver_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_deliver_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/deliver_messages/,\n {\n 'email' => 'user@example.com',\n 'queuefile' => 'example.msg',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_deliver_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_deliver_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'deliver_messages',\n array (\n 'email' => 'user@example.com',\n 'queuefile' => 'example.msg',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/get_allowlist: get: x-readonly: true description: 'This function retrieves a list of BoxTrapper allowlist configuration rules. BoxTrapper will deliver emails that match these rules. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-get_allowlist parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_allowlist type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: The allowlist configuration rules. items: description: One allowlist rule. example: from allowlisted-email\@domain\.com type: string type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return account BoxTrapper allowlist rules tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_allowlist \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_allowlist?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_allowlist.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_allowlist.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_allowlist/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_allowlist.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_allowlist.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_allowlist',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /BoxTrapper/get_blocklist: get: x-readonly: true description: 'This function retrieves a list of BoxTrapper blocklist configuration rules. BoxTrapper will delete messages that match these rules and send a notification to the sender. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-get_blocklist parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_blocklist type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: The blocklist configuration rules. items: description: One blocklist rule. example: from blocklisted-email\@domain\.com type: string type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return account BoxTrapper blocklist rules tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_blocklist \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_blocklist?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_blocklist.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_blocklist.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_blocklist/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_blocklist.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_blocklist.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_blocklist',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /BoxTrapper/get_configuration: get: x-readonly: true description: 'This function retrieves an account''s BoxTrapper configuration. **Important:** When you disable the Receive Mail role, the system disables this function.' operationId: BoxTrapper-get_configuration parameters: - description: 'The account''s email address. **Warning:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_configuration type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: properties: enable_auto_whitelist: description: 'Whether whitelisting is enabled. * 1 - Enabled. * 0 - Disabled.' enum: - 0 - 1 example: 1 type: integer from_addresses: description: The email addresses that send emails from the account. A comma-separated list of email addresses. example: user@example.com,user2@example.com type: string from_name: description: The name of the person who owns the email account. example: User type: string queue_days: description: The number of days that the system retains log files and queued messages. example: 14 minimum: 0 type: integer spam_score: description: The account's [Apache SpamAssassin](https://go.cpanel.net/cpaneldocsSpamFilters) threshold score. example: 2.5 type: number whitelist_by_association: description: Whether the system whitelisted the email addresses in a message's `To` and `From` sections, including carbon-copied (CC) recipients. enum: - 0 - 1 example: 1 type: integer type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return email account's BoxTrapper configuration tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_configuration \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_configuration?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_configuration.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_configuration.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_configuration/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_configuration.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_configuration.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_configuration',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/get_email_template: get: x-readonly: false x-rollback: none description: 'This function retrieves a BoxTrapper email message template. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-get_email_template parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'The message template. * `blacklist` * `returnverify` * `verifyreleased` * `verify` **Note:** For more information on each template, read our [BoxTrapper](https://go.cpanel.net/cpaneldocsBoxTrapper) documentation.' in: query name: template required: true schema: enum: - blacklist - returnverify - verifyreleased - verify example: verify type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_email_template type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: The template file's contents. example: 'To: %email%\nSubject: Re: %subject%\n\nThe user %acct% does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%headers%\n",' type: string errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return specified BoxTrapper email template tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_email_template \\\n email='user@example.com' \\\n template='verify'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_email_template?email=user%40example.com&template=verify - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_email_template.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_email_template.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_email_template/,\n {\n 'email' => 'user@example.com',\n 'template' => 'verify',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_email_template.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_email_template.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_email_template',\n array (\n 'email' => 'user@example.com',\n 'template' => 'verify',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 84 /BoxTrapper/get_forwarders: get: x-readonly: true description: 'This function retrieves a list of email addresses to which BoxTrapper forwards email messages. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-get_forwarders parameters: - description: 'The account''s email address. **Important:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_forwarders type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: The email addresses to which BoxTrapper forwards email. items: example: user1@example.com, user2@example.com, user3@example.com type: string type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return all BoxTrapper forwarders tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_forwarders \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_forwarders?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_forwarders.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_forwarders.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_forwarders/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_forwarders.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_forwarders.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_forwarders',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 86 /BoxTrapper/get_ignorelist: get: x-readonly: true description: 'This function retrieves a list of BoxTrapper ignorelist configuration rules. BoxTrapper will delete messages that match these rules without sending a notification to the sender. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-get_ignorelist parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_ignorelist type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: The ignorelist configuration rules. items: description: One ignorelist rule. example: from ignored-email\@domain\.com type: string type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return account BoxTrapper ignorelist rules tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_ignorelist \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_ignorelist?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_ignorelist.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_ignorelist.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_ignorelist/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_ignorelist.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_ignorelist.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_ignorelist',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /BoxTrapper/get_log: get: x-readonly: true description: 'This function returns the account''s BoxTrapper log file and its contents. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-get_log parameters: - description: 'The account''s email address. **Important:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'The date for which to return the log file and its contents. **Note:** This parameter defaults to the current date.' in: query name: date required: false schema: example: 1556812881 format: unix_timestamp type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_log type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: properties: date: description: The date for which the system returned the log. example: 1556812881 format: unix_timestamp type: integer lines: description: An array of lines from the log file. If the log file doesn't exist or if no log lines exist in the file, the function returns an empty array. items: example: Processing email with trusted transport method. type: string type: array path: description: The log file's filepath. If the log file doesn't exist, the function returns an empty string. example: /home/user/etc/example.com/user/boxtrapper/log/05-02-2019.log type: string type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* 1 — Success. * 0 — Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return BoxTrapper log file and contents tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_log \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_log?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_log.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_log.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_log/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_log.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_log.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_log',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/get_message: get: x-readonly: true description: 'This function returns the first 200 lines of an email in the BoxTrapper queue. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-get_message parameters: - description: "The account’s name, either an email address or the cPanel user’s username.\n\n**Important:**\n\n If you call this function in Webmail, the system ignores this parameter." example: user@example.com in: query name: email required: true schema: anyOf: - example: user@example.com format: email type: string - example: exampleuser format: username type: string - description: The message's filename. in: query name: queuefile required: true schema: example: example.msg type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_message type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: properties: content: description: The email message's contents. Up to the first 200 lines of an email message. example: "From user@example.com Tue May 07 08:30:36 2019\nReceived: from user by example.com with local (Exim 4.92) (envelope-from )\n id 1hO0B1-0003Ev-Md for user2@example.com; Tue, 07 May 2019 08:30:36 -0500\nFrom: user3@example.com\nSubject: Message\nMessage-Id: \nDate: Tue, 07 May 2019 08:30:35 -0500\n\nThis is an email message" type: string contents: {} queuefile: description: The message's filename. example: example.msg type: string type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '- 1 - Success - 0 - Failed: Check the errors field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return message's top 200 lines in BoxTrapper queue tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_message \\\n email='user@example.com' \\\n queuefile='example.msg'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_message?email=user%40example.com&queuefile=example.msg - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_message.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_message.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_message/,\n {\n 'email' => 'user@example.com',\n 'queuefile' => 'example.msg',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_message.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_message.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_message',\n array (\n 'email' => 'user@example.com',\n 'queuefile' => 'example.msg',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/get_status: get: x-readonly: true description: 'This function checks whether BoxTrapper is enabled for an email account. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-get_status parameters: - description: 'The account''s email address. **Important:** If you call this function in Webmail, the system ignores this parameter.' in: query name: email required: true schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_status type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: 'Whether BoxTrapper is enabled for the email account. * `1` — Enabled. * `0` — Disabled.' enum: - 0 - 1 example: 0 type: integer errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* 1 — Success. * 0 — Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return whether email account uses BoxTrapper tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n get_status \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_status?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_get_status.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_get_status.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/get_status/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_get_status.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_get_status.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'get_status',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/ignore_messages: get: x-readonly: false x-rollback: none description: 'This function marks email message senders for Exim to ignore. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-ignore_messages parameters: - description: "The cPanel email account from which to ignore messages.\n\n**Warning:** \n\nIf you call this function in Webmail, the system ignores this parameter and defaults\nto the currently-authenticated email address." in: query name: email required: true schema: example: user@example.com format: email type: string - description: "The filename of the email message to ignore.\n\n**Note:**\n\n To ignore multiple email messages, duplicate this parameter." examples: multiple: summary: Ignore multiple email messages. value: queuefile-1=example1.msg queuefile-2=example2.msg queuefile-3=example3.msg single: summary: Ignore a single email message. value: example.msg in: query name: queuefile required: true schema: type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: ignore_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: An array of objects containing ignored email message information. example: - email: user@example.com matches: - example.msg operator: ignore items: properties: email: description: The ignored email message's sender. example: user@example.com format: email type: string failed: description: "Whether the system failed to ignore the messages.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n* `1` - Failed to ignore the message.\n\n**Note:**\n\n The function only returns this value if it experiences issues when it ignores the message." enum: - 1 example: 1 type: integer matches: description: An array containing ignored message files. items: example: example.msg type: string type: array operator: description: 'The operation that the system performed. * `ignore` — The system ignored this email message.' enum: - ignore example: ignore type: string reason: description: "A message that describes the failure or the warning.\n\n**Note:**\n\n The function only returns this value if it doesn't ignore the message or experiences issues when it ignores the message. " example: This is a failure message. type: string warning: description: "Whether the system experienced issues when it ignored the message.\n\n* `1` — The system encountered a problem.\n\n**Note:**\n\n The function only returns this value if it experiences issues when it ignores the message." enum: - 1 example: 1 type: integer type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '- `1` - Success. - `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Add email account to Exim ignore list tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n ignore_messages \\\n email='user@example.com' \\\n queuefile='example.msg'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/ignore_messages?email=user%40example.com&queuefile=example.msg - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_ignore_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_ignore_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/ignore_messages/,\n {\n 'email' => 'user@example.com',\n 'queuefile' => 'example.msg',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_ignore_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_ignore_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'ignore_messages',\n array (\n 'email' => 'user@example.com',\n 'queuefile' => 'example.msg',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/list_email_templates: get: x-readonly: true description: 'This function lists the BoxTrapper email templates. **Important:** When you **disable** the Receive Mail role, the system disables this function.' operationId: BoxTrapper-list_email_templates parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: list_email_templates type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: 'An array of strings representing BoxTrapper message templates. * `blacklist` - BoxTrapper responds with this message when a blacklisted address sends an email. * `verify` - BoxTrapper responds with this message when an address that does not exist on the whitelist or blacklist sends an email. This message requests a response to confirm that the sender is legitimate. * `verifyreleased` - BoxTrapper responds with this message when a person responds to the verify message with an email or a click on the verification link. * `returnverify` - BoxTrapper responds with this message when the verification process fails.' example: - blacklist - returnverify - verify - verifyreleased items: enum: - blacklist - verify - verifyreleased - returnverify example: verify type: string type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return BoxTrapper email templates tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n list_email_templates\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/list_email_templates - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_list_email_templates.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_list_email_templates.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/list_email_templates/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_list_email_templates.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_list_email_templates.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'list_email_templates'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 84 /BoxTrapper/list_queued_messages: get: x-readonly: true description: 'This function returns a list of messages in the account''s BoxTrapper queue. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-list_queued_messages parameters: - description: 'The email account for which to retrieve queued messages. **Important:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: The date for which to return queued messages. in: query name: date required: false schema: example: 1556812881 format: unix_timestamp type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: list_queued_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: Information about each queued message. items: properties: from: description: The sender's email address. example: user@example.com format: email type: string queuefile: description: The message's unique ID. example: example.msg type: string subject: description: The message's subject. example: Email Message Subject type: string time: description: The message's creation time. example: 1556812881 format: unix_timestamp type: integer type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return email account's BoxTrapper queued messages tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n list_queued_messages \\\n email='user@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/list_queued_messages?email=user%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_list_queued_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_list_queued_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/list_queued_messages/,\n {\n 'email' => 'user@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_list_queued_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_list_queued_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'list_queued_messages',\n array (\n 'email' => 'user@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/process_messages: get: x-readonly: false x-rollback: none description: 'This function performs a specified action on messages in the BoxTrapper queue. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-process_messages parameters: - description: 'The action to perform on the email message file. To perform multiple actions on the specified email messages, pass this parameter multiple times. * `deliver` — Deliver a specific message. * `deliverall` — Deliver all messages from a sender. * `delete` — Delete a message. * `deleteall` — Delete all messages from a sender. * `blacklist` — Blacklist the sender of an email message. * `whitelist` — Whitelist the sender of an email message. * `ignore` — Ignore email messages from a sender. **Note:** The function performs the actions on the email messages files in the order that you pass each action.' examples: multiple: summary: Perform multiple actions. value: action=blacklist action=deleteall single: summary: Perform a single action. value: blacklist in: query name: action required: true schema: enum: - deliver - deliverall - delete - deleteall - blacklist - whitelist - ignore example: blacklist type: string - description: The filename of the email message to process. To process multiple email messages, pass this parameter multiple times. examples: multiple: summary: Process multiple email messages. value: email=example.msg email=example1.msg email=example2.msg single: summary: Process a single email message. value: example.msg in: query name: queuefile required: true schema: example: example.msg type: string - description: 'The account''s email address. **Warning:** * The `email` parameter is required when this function is called **outside** of Webmail. * If you call this function in Webmail, the `email` parameter is **not** required, and the system overrides this parameter with the current authenticated user''s email address.' in: query name: email schema: example: user@example.com format: email type: string responses: '200': content: application/json: examples: function-fail: summary: The function failed. value: apiversion: 3 module: BoxTrapper result: data: - email: null failed: 1 matches: - example reason: '(XID 2ymu8k) The system failed to locate the requested message: example.msg' errors: null messages: null metadata: transformed: 1 status: 1 warnings: - One or more of the operations failed. function-success: summary: The function succeeded. value: apiversion: 3 data: - email: user@example.com matches: - example operator: blacklist - email: user@example.com matches: - example operator: deleteall errors: null messages: null metadata: transformed: 1 module: BoxTrapper status: 1 warnings: null schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: process_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: An array of objects containing processed email message information. items: properties: email: description: 'The email address for which the system processed an email message.' format: email type: - string - 'null' failed: description: 'Whether the system failed to process the message. * `1` - The function failed to process the message. This is the only possible value. **Note:** The function only returns this value if it fails to process the message.' enum: - 1 example: 1 type: integer matches: description: An array of email messages that the system processed. items: type: string type: array operator: description: 'The operation that the system performed. * `deliver` - Delivered a specific message. * `deliverall` - Delivered all messages from a sender. * `delete` - Deleted a message. * `deleteall` - Deleted all messages from a sender. * `blacklist` - Blacklisted the sender of an email message. * `whitelist` - Whitelisted the sender of an email message. * `ignore` - Ignored email messages from a sender. **Note:** The function only returns this value if it successfully processes the message.' enum: - deliver - deliverall - delete - deleteall - blacklist - whitelist - ignore example: delete type: string reason: description: 'A message about the failure or the warning. **Note:** The function only returns this value if it fails to processes the message or experiences issues when it processes the message.' type: string type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success * `0` - Failed. Check the errors field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object description: HTTP Request was successful. summary: Run a specific BoxTrapper action for a message tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n process_messages \\\n queuefile='example.msg' \\\n action='blacklist'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/process_messages?queuefile=example.msg&action=blacklist - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_process_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_process_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/process_messages/,\n {\n 'queuefile' => 'example.msg',\n 'action' => 'blacklist',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_process_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_process_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'process_messages',\n array (\n 'queuefile' => 'example.msg',\n 'action' => 'blacklist',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/reset_email_template: get: x-readonly: false x-rollback: clean description: 'This function restores the BoxTrapper email message templates to the system default setting. **Important:** When you **disable** the Receive Mail role, the system disables this function.' operationId: BoxTrapper-reset_email_template parameters: - description: 'The message template. Possible values: * `blacklist` - BoxTrapper responds with this message when a blacklisted address sends an email. * `verify` - BoxTrapper responds with this message when an address that does not exist on the whitelist or blacklist sends an email. This message requests a response to confirm that the sender is legitimate. * `verifyreleased` - BoxTrapper responds with this message when a person responds to the verify message with an email or a click on the verification link. * `returnverify` - BoxTrapper responds with this message when the verification process fails.' in: query name: template required: true schema: enum: - blacklist - verify - verifyreleased - returnverify example: verify type: string - description: 'The account''s email address. **Warning:** The `email` parameter is required when this function is called outside of webmail. If you call this function in Webmail, the `email` parameter is not required, and the system overrides this parameter with the current authenticated user''s email address.' in: query name: email schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: reset_email_template type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API. example: null items: type: string type: - array - 'null' type: object description: HTTP Request was successful. summary: Restore default BoxTrapper email message template tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n reset_email_template \\\n template='verify'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/reset_email_template?template=verify - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_reset_email_template.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_reset_email_template.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/reset_email_template/,\n {\n 'template' => 'verify',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_reset_email_template.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_reset_email_template.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'reset_email_template',\n array (\n 'template' => 'verify',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 84 /BoxTrapper/save_configuration: get: x-readonly: false x-rollback: clean description: 'This function modifies an account''s BoxTrapper configuration. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-save_configuration parameters: - description: 'The account''s email address. **Warning:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'Whether to enable automatic whitelisting for the account. * `1` - Enable. * `0` - Disable.' in: query name: enable_auto_whitelist required: true schema: enum: - 0 - 1 example: 1 type: integer - description: A comma-separated list of email addresses that the system uses when it sends messages back to the original message senders. in: query name: from_addresses required: true schema: example: sender1@test.com,sender2@test.com format: email-csv type: string - description: The number of days to retain log files and queued messages. in: query name: queue_days required: true schema: example: 14 minimum: 1 type: integer - description: 'Whether to whitelist the email addresses in a message''s *To* and *From* sections, including carbon-copied (CC) recipients. * `1` - Whitelist. * `0` - Do **not** whitelist.' in: query name: whitelist_by_association required: true schema: enum: - 0 - 1 example: 1 type: integer - description: The name of the person who owns the email account. in: query name: from_name required: false schema: example: User type: string - description: 'The account''s Apache SpamAssassin™ threshold score. For more information about Apache SpamAssassin threshold scores, read our [Spam Filters](https://go.cpanel.net/cpaneldocsSpamFilters) documentation. **Note:** This parameter defaults to the account''s current configuration.' in: query name: spam_score required: false schema: example: 2.5 type: number responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: save_configuration type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '- `1` - Success. - `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object description: HTTP Request was successful. summary: Update email account's BoxTrapper configuration tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n save_configuration \\\n email='user@example.com' \\\n from_addresses='sender1@test.com,sender2@test.com' \\\n queue_days='14' \\\n enable_auto_whitelist='1' \\\n whitelist_by_association='1'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/save_configuration?email=user%40example.com&from_addresses=sender1%40test.com%2csender2%40test.com&queue_days=14&enable_auto_whitelist=1&whitelist_by_association=1 - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_save_configuration.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_save_configuration.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/save_configuration/,\n {\n 'email' => 'user@example.com',\n 'from_addresses' => 'sender1@test.com,sender2@test.com',\n 'queue_days' => '14',\n 'enable_auto_whitelist' => '1',\n 'whitelist_by_association' => '1',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_save_configuration.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_save_configuration.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'save_configuration',\n array (\n 'email' => 'user@example.com',\n 'from_addresses' => 'sender1@test.com,sender2@test.com',\n 'queue_days' => '14',\n 'enable_auto_whitelist' => '1',\n 'whitelist_by_association' => '1',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/save_email_template: get: x-readonly: false x-rollback: clean description: 'This function saves the contents of a BoxTrapper message template. **Important:** When you disable the _Receive Mail_ role, the system **disables** this function.' operationId: BoxTrapper-save_email_template parameters: - description: 'The template file''s contents. You can use [variables](https://go.cpanel.net/cpaneldocsBoxTrapper) in the template to include details about the original message. **Important:** * You **must** include `To: %email%` in this parameter''s value. * If you use the `verify` template, you **must** include `Subject: verify#%msgid%` in this parameter''s value. * This value cannot exceed four kilobytes (KB). * You **must** URI-encode this parameter''s value when using the CLI.' in: query name: contents required: true schema: example: 'To: %email% Subject: Re: %subject% The user %acct% does not accept mail from your address. The headers of the message sent from your address are shown below: %headers%' type: string - description: 'The account''s email address. **Warning:** If you call this function in Webmail, the system overrides this parameter. **Note:** This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'The message template. * `blacklist` * `returnverify` * `verifyreleased` * `verify` **Important:** If you use the `verify` template, you **must** include `Subject: verify#%msgid%` in this parameter''s value. **Note:** For more information about each template, read our [BoxTrapper documentation](https://go.cpanel.net/cpaneldocsBoxTrapper).' in: query name: template required: true schema: enum: - blacklist - returnverify - verifyreleased - verify example: blacklist type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: save_email_template type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '- 1 - Success - 0 - Failed: Check the errors field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object description: HTTP Request was successful. summary: Save BoxTrapper message template contents tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n save_email_template \\\n email='user@example.com' \\\n template='blacklist' \\\n contents='To: %25email%25\nSubject: Re: %25subject%25\n\nThe user %25acct%25 does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%25headers%25'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/save_email_template?email=user%40example.com&template=blacklist&contents=To%3a%20%25email%25%0aSubject%3a%20Re%3a%20%25subject%25%0a%0aThe%20user%20%25acct%25%20does%20not%20accept%20mail%20from%20your%20address.%0a%0aThe%20headers%20of%20the%20message%20sent%20from%20your%20address%20are%20shown%20below%3a%0a%0a%25headers%25 - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_save_email_template.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_save_email_template.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/save_email_template/,\n {\n 'email' => 'user@example.com',\n 'template' => 'blacklist',\n 'contents' => 'To: %email%\nSubject: Re: %subject%\n\nThe user %acct% does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%headers%',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_save_email_template.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_save_email_template.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'save_email_template',\n array (\n 'email' => 'user@example.com',\n 'template' => 'blacklist',\n 'contents' => 'To: %email%\nSubject: Re: %subject%\n\nThe user %acct% does not accept mail from your address.\n\nThe headers of the message sent from your address are shown below:\n\n%headers%',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 84 /BoxTrapper/set_allowlist: get: x-readonly: false x-rollback: clean description: 'This function sets the BoxTrapper allowlist configuration rules. BoxTrapper will deliver emails that match these rules. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-set_allowlist parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'An array of allowlist rules. **Note:** You can set multiple allowlist rules, duplicate or increment the parameter name. For example, `rules-1`, `rules-2`, and `rules-3`.' examples: multiple: summary: Set multiple rules. value: rules-1='allowlisted-email\@domain\.com' rules-2='from allowlisted-email2\@domain\.com' rules-3='to domain2\.com' multiple-alternative: summary: Set multiple rules. value: rules='allowlisted-email\@domain\.com' rules='from allowlisted-email2\@domain\.com' rules='to domain2\.com' single: summary: Set a single rule. value: allowlisted-email\@domain\.com in: query name: rules required: true schema: items: type: string type: array responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: set_allowlist type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Update account BoxTrapper allowlist tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: uapi --output=jsonpretty --user=username BoxTrapper set_allowlist email='user@example.com' rules-1='allowlisted-email\@domain\.com' rules-2='from allowlisted-email2\@domain\.com' rules-3='to domain2\.com' - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_allowlist?email=user%40example.com&rules=allowlisted-email%5c%40domain%5c.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_allowlist.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_set_allowlist.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/set_allowlist/,\n {\n 'email' => 'user@example.com',\n 'rules' => 'allowlisted-email\\@domain\\.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_allowlist.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_set_allowlist.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'set_allowlist',\n array (\n 'email' => 'user@example.com',\n 'rules' => 'allowlisted-email\\@domain\\.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /BoxTrapper/set_blocklist: get: x-readonly: false x-rollback: clean description: 'This function sets the BoxTrapper blocklist configuration rules. BoxTrapper will delete messages that match these rules and send a notification to the sender. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-set_blocklist parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'An array of blocklist rules. **Note:** You can set multiple block rules, duplicate or increment the parameter name. For example, `rules-1`, `rules-2`, and `rules-3`.' examples: multiple: summary: Set multiple rules. value: rules-1='blocklisted-email\@domain\.com' rules-2='from blocklisted-email2\@domain\.com' rules-3='to domain2\.com' multiple-alternative: summary: Set multiple rules. value: rules='blocklisted-email\@domain\.com' rules='from blocklisted-email2\@domain\.com' rules='to domain2\.com' single: summary: Set a single rule. value: blocklisted-email\@domain\.com in: query name: rules required: true schema: items: type: string type: array responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: set_blocklist type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Update account BoxTrapper blocklist tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: uapi --output=jsonpretty --user=username BoxTrapper set_blocklist email='user@example.com' rules-1='blocklisted-email\@domain\.com' rules-2='from blocklisted-email2\@domain\.com' rules-3='to domain2\.com' - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_blocklist?email=user%40example.com&rules=blocklisted-email%5c%40domain%5c.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_blocklist.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_set_blocklist.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/set_blocklist/,\n {\n 'email' => 'user@example.com',\n 'rules' => 'blocklisted-email\\@domain\\.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_blocklist.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_set_blocklist.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'set_blocklist',\n array (\n 'email' => 'user@example.com',\n 'rules' => 'blocklisted-email\\@domain\\.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /BoxTrapper/set_forwarders: get: x-readonly: false x-rollback: clean description: 'This function adds a list of email addresses to which BoxTrapper forwards email messages. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-set_forwarders parameters: - description: 'The account''s email address. **Warning:** If you call this function in Webmail, the system ignores this parameter and uses the currently-authenticated email address.' in: query name: email required: true schema: example: user@example.com type: string - description: The email addresses to which to forward email messages. example: - user1@example.com in: query name: forwarder required: true schema: items: example: user1@example.com format: email type: array responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: set_forwarders type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '- 1 - Success - 0 - Failed: Check the errors field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object description: HTTP Request was successful. summary: Add email address to BoxTrapper forwarders tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n set_forwarders \\\n email='user@example.com' \\\n forwarder='user1@example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_forwarders?email=user%40example.com&forwarder=user1%40example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_forwarders.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_set_forwarders.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/set_forwarders/,\n {\n 'email' => 'user@example.com',\n 'forwarder' => 'user1@example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_forwarders.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_set_forwarders.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'set_forwarders',\n array (\n 'email' => 'user@example.com',\n 'forwarder' => 'user1@example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 86 /BoxTrapper/set_ignorelist: get: x-readonly: false x-rollback: clean description: 'This function sets the BoxTrapper ignorelist configuration rules. BoxTrapper will delete messages that match these rules without sending a notification to the sender. **Important:** When you disable the *Receive Mail* role, the system **disables** this function.' operationId: BoxTrapper-set_ignorelist parameters: - description: 'A valid email address on the cPanel account. **Warning:** If you call this function in Webmail, the system overrides this parameter. This parameter defaults to the current email address.' in: query name: email required: true schema: example: user@example.com format: email type: string - description: 'An array of ignorelist rules. **Note:** You can set multiple ignore rules, duplicate or increment the parameter name. For example, `rules-1`, `rules-2`, and `rules-3`.' examples: multiple: summary: Set multiple rules. value: rules-1='ignored-email\@domain\.com' rules-2='from ignored-email2\@domain\.com' rules-3='to domain2\.com' multiple-alternative: summary: Set multiple rules. value: rules='ignored-email\@domain\.com' rules='from ignored-email2\@domain\.com' rules='to domain2\.com' single: summary: Set a single rule. value: ignored-email\@domain\.com in: query name: rules required: true schema: items: type: string type: array responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: set_ignorelist type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Update account BoxTrapper ignorelist tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: uapi --output=jsonpretty --user=username BoxTrapper set_ignorelist email='user@example.com' rules-1='ignored-email\@domain\.com' rules-2='from ignored-email2\@domain\.com' rules-3='to domain2\.com' - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_ignorelist?email=user%40example.com&rules=ignored-email%5c%40domain%5c.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_ignorelist.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_set_ignorelist.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/set_ignorelist/,\n {\n 'email' => 'user@example.com',\n 'rules' => 'ignored-email\\@domain\\.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_ignorelist.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_set_ignorelist.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'set_ignorelist',\n array (\n 'email' => 'user@example.com',\n 'rules' => 'ignored-email\\@domain\\.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 94 /BoxTrapper/set_status: get: x-readonly: false x-rollback: none description: 'This function enables or disables BoxTrapper for an email account. **Important:** When you disable the Receive Mail role, the system **disables** this function.' operationId: BoxTrapper-set_status parameters: - description: 'The account''s name. This can be an email address or the cPanel user’s username. **Warning:** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' example: user@example.com in: query name: email required: true schema: oneOf: - example: user@example.com format: email type: string - example: exampleuser format: username type: string - description: 'Whether to enable or disable BoxTrapper for the email account. * `1` - Enable BoxTrapper. * `0` - **Disable** BoxTrapper.' in: query name: enabled required: true schema: enum: - 0 - 1 example: 1 type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: set_status type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: default: null type: - object - 'null' errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '- 1 - Success - 0 - Failed: Check the errors field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object description: HTTP Request was successful. summary: Enable or disable BoxTrapper for email account tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n set_status \\\n email='user@example.com' \\\n enabled='1'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/set_status?email=user%40example.com&enabled=1 - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_set_status.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_set_status.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/set_status/,\n {\n 'email' => 'user@example.com',\n 'enabled' => '1',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_set_status.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_set_status.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'set_status',\n array (\n 'email' => 'user@example.com',\n 'enabled' => '1',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /BoxTrapper/whitelist_messages: get: x-readonly: false x-rollback: none description: 'This function whitelists email messages. **Important:** When you disable the Receive Mail role, the system **disables** this function. **Note:** To retrieve email messages in the BoxTrapper queue from senders that you did not previously whitelist, use the UAPI `BoxTrapper::deliver_messages` function.' operationId: BoxTrapper-whitelist_messages parameters: - description: 'The filename of the email message to whitelist. **Note:** To get a list of filenames in an account''s BoxTrapper queue, use the UAPI `BoxTrapper::list_queued_messages` function. **Note:** To whitelist multiple email messages, duplicate this parameter.' examples: multiple: summary: Whitelist multiple messages. value: queuefile=ex1.msg&queuefile=ex2.msg&queuefile=ex3.msg single: summary: Whitelist a single message. value: example.msg in: query name: queuefile required: true schema: example: example.msg type: string - description: 'The cPanel account email address for which to whitelist messages. **Warning** If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.' in: query name: email required: false schema: example: user@example.com format: email type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: whitelist_messages type: string module: description: The name of the module called. example: BoxTrapper type: string result: properties: data: description: An array of one or more objects, depending on how many queuefiles were passed as parameters. Each object contains information about the whitelisted email message. example: - email: user@example.com matches: - example.msg operator: whitelist items: properties: email: description: A whitelisted email address. example: user@example.com format: email type: string failed: default: '1' description: 'The system failed to whitelist the message. * `1` — The function failed to whitelist the message. This is the only possible value. **Note:** The function only returns this property if it failed to whitelist the message.' enum: - '1' example: '1' type: string matches: description: 'An array of message files that the system whitelisted. **Note:** The function **only** returns this value if it whitelists the message.' items: example: example.msg type: string type: array operator: default: whitelist description: The action that the system performed. enum: - whitelist example: whitelist type: string reason: description: The reason the function skipped the message during whitelisting. The `reason` property is returned only if the function failed to whitelist the message. example: The cPanel user, "user" does not own the requested account "user@example.com." type: string warning: default: 1 description: 'Whether the system experienced issues when it whitelisted the message. * `1` — There was an issue whitelisting the message. This is the only possible value. **Note:** The function only returns this property if it failed to whitelist the message.' enum: - 1 example: 1 type: integer type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Add email address to BoxTrapper allowed senders tags: - BoxTrapper x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n BoxTrapper \\\n whitelist_messages \\\n queuefile='example.msg'\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/whitelist_messages?queuefile=example.msg - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file BoxTrapper_whitelist_messages.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/BoxTrapper_whitelist_messages.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/BoxTrapper/,\n q/whitelist_messages/,\n {\n 'queuefile' => 'example.msg',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file BoxTrapper_whitelist_messages.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/BoxTrapper_whitelist_messages.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'BoxTrapper',\n 'whitelist_messages',\n array (\n 'queuefile' => 'example.msg',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 components: securitySchemes: BasicAuth: scheme: basic type: http externalDocs: url: https://cpanel.net/developers/ x-tagGroups: - name: API Development Tools tags: - API Token Management - Batch - SSE Task Management - URL Parsing - name: Authentication tags: - External Authentication - Two-Factor Settings - name: Backup Information tags: - BackupInfo - BackupInfo Status - name: Block Ip Addresses tags: - Block IP - name: Commerce Integration tags: - Market Integration - SSL Certificates - name: Contact Information tags: - Contact Information - name: cPanel Account tags: - Account Enhancements - Account Information - Account Management - AuditLog - Contact Information - cPanel Features - Disk Quotas - DomainRecommendations - Personalization - Resource Usage and Statistics - Subaccount Management - Team Roles - Team Users - name: cPanel Account Backups tags: - Backup - File Restoration - name: cPanel Plugin Framework tags: - Formbricks - Plugins - name: cPanel Theme Management tags: - Application Information - Brand Management - Branding Files - Browser Cache Management - Language - Theme Settings - name: Directory Management tags: - Directory Indexes - Directory Privacy - Directory Protection - name: DNS tags: - DNS - DNS Information - DNS Security - Dynamic DNS - Email DNS Settings - ZoneEdit - name: Domain tags: - Domain - name: Domain Management tags: - AddonDomain - Direct Link Protection (Hotlink) - Domain - Domain Information - Domain Redirection - DomainLookup - Park - SubDomain - Virtual Host Information - name: Domains tags: - Subdomains - name: Email tags: - Email Accounts - Email Filtering - Email Forwarding - Email Server Information - Email Suspensions - Mail Server Information - Mailbox Management - Mailing Lists - Signing and Encryption (GnuPG Keys) - Spam Filtering (Greylisting) - Spam Management - Spam Prevention (BoxTrapper) - Webmail Applications - Webmail Sessions - name: Extract Information tags: - ExtractInfo - ExtractInfo Status - name: File Manager tags: - Trash - name: Files tags: - FTP Accounts - FTP Server Settings - Image Tools - Jodit - Manage Files - Manage Files - WebDisk Settings - name: GIT Management tags: - Deployment Settings - Repository Management - name: InProductSurvey tags: - InProductSurvey - name: MySQL and MariaDB tags: - Database Information - Database Management - Remote Databases - User Management - name: Notifications tags: - Pushbullet - name: Optional Applications tags: - Antivirus Protection (ClamAV) - Calendar and Contacts (DAV) - Calendar and Contacts Server - WordPress Manager Backups - name: PostgreSQL tags: - PostgreSQL Database Management - PostgreSQL User Management - name: Retrieve bandwidth information tags: - Bandwidth - name: Security tags: - Known SSH Hosts Management - Login Information - name: Server Information tags: - cPanel Server Information - Notifications - Password Strength - SSH - WebPros MCP - WebProsMCP - name: ServiceProxy tags: - ServiceProxy - name: Site Quality Monitoring tags: - SiteQuality - name: SSL Certificates tags: - Auto-generated SSL Certificates - cPanel Account SSL Management - SNI Email Settings - SSL Certificate Management - Verify Domain Ownership - name: Statistics tags: - Domain Statistics - Weblog Settings - name: UserData tags: - UserData - name: Web Server Configuration tags: - EA4 - EasyApache Settings - PHP - name: Web Server Management tags: - Application Manager - ModSecurity - NginxCaching - PHP Settings - Web Apps - name: Website Configuration tags: - Handler Management - Logs - Mime Type Management - Nova - Site Information - Site Installation - Sitejet - WPX