Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function returns the connection information to set up the CalDAV and CardDAV clients.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/DAV/get_calendar_contacts_config?user=example
https://hostname.example.com:2083/cpsess##########/execute/DAV/get_calendar_contacts_config?user=example2@example.com

 

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
  $cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List the account's CalDAV and CardDAV connection information.
$get_calendar_contacts_config = $cpanel->uapi(
    'DAV', 'get_calendar_contacts_config'
);

Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List the account's CalDAV and CardDAV connection information.
my $get_calendar_contacts_config = $cpliveapi->uapi(
    'DAV', 'get_calendar_contacts_config',
);

Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
 <!-- List the account's CalDAV and CardDAV connection information. -->
[% data = execute( 'DAV', 'get_calendar_contacts_config' ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username DAV get_calendar_contacts_config user=example

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 

 Output (JSON)
 {
    "messages": null,
    "errors": null,
    "status": 1,
    "metadata": {},
    "data": {
        "ssl": {
            "contacts": [
                {
                    "url": "https://example.com:2080/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6",
                    "name": "Address book of example",
                    "path": "/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6",
                    "description": null
                },
                {
                    "url": "https://example.com:2080/addressbooks/example/contacts:pn7DhZKYPeqebgmOdUCw7g7",
                    "name": "Custom 1",
                    "path": "/addressbooks/example/contacts:pn7DhZKYPeqebgmOdUCw7g7",
                    "description": "Custom address book 1"
                },
                {
                    "url": "https://example.com:2080/addressbooks/example/contacts:qxmwxgVfJ7jqrDLwrvdmYA1",
                    "name": "Custom 2",
                    "path": "/addressbooks/example/contacts:qxmwxgVfJ7jqrDLwrvdmYA1",
                    "description": "Custom address book 2."
                }
            ],
            "calendars": [
                {
                    "url": "https://example.com:2080/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1",
                    "name": "Calendar of example",
                    "path": "/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1",
                    "description": null
                },
                {
                    "url": "https://example.com:2080/calendars/example/calendar:hb1Gz0wgSmJxIsOklcw42g1",
                    "name": "Custom 1",
                    "path": "/calendars/example/calendar:hb1Gz0wgSmJxIsOklcw42g1",
                    "description": "Custom calendar 1"
                },
                {
                    "url": "https://example.com:2080/calendars/example/calendar:vxdY4ACROc-1tx4TgrTb4Q3",
                    "name": "Custom 2",
                    "path": "/calendars/example/calendar:vxdY4ACROc-1tx4TgrTb4Q3",
                    "description": "Custom calendar 2."
                }
            ],
            "is_self_signed": 1,
            "full_server": "https://server.example.com:2080/rpc/principals/example",
            "server": "https://server.example.com:2080",
            "port": "2080"
        },
        "user": "example",
        "no_ssl": {
            "contacts": [
                {
                    "url": "http://example.com:2079/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6",
                    "name": "Address book of example",
                    "path": "/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6",
                    "description": null
                },
                {
                    "url": "http://example.com:2079/addressbooks/example/contacts:pn7DhZKYPeqebgmOdUCw7g7",
                    "name": "Custom 1",
                    "path": "/addressbooks/example/contacts:pn7DhZKYPeqebgmOdUCw7g7",
                    "description": "Custom address book 1"
                },
                {
                    "url": "http://example.com:2079/addressbooks/example/contacts:qxmwxgVfJ7jqrDLwrvdmYA1",
                    "name": "Custom 2",
                    "path": "/addressbooks/example/contacts:qxmwxgVfJ7jqrDLwrvdmYA1",
                    "description": "Custom address book 2."
                }
            ],
            "calendars": [
                {
                    "url": "http://example.com:2079/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1",
                    "name": "Calendar of example",
                    "path": "/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1",
                    "description": null
                },
                {
                    "url": "http://example.com:2079/calendars/example/calendar:hb1Gz0wgSmJxIsOklcw42g1",
                    "name": "Custom 1",
                    "path": "/calendars/example/calendar:hb1Gz0wgSmJxIsOklcw42g1",
                    "description": "Custom calendar 1"
                },
                {
                    "url": "http://example.com:2079/calendars/example/calendar:vxdY4ACROc-1tx4TgrTb4Q3",
                    "name": "Custom 2",
                    "path": "/calendars/example/calendar:vxdY4ACROc-1tx4TgrTb4Q3",
                    "description": "Custom calendar 2."
                }
            ],
            "full_server": "http://example.com:2079/rpc/principals/example",
            "server": "http://example.com:2079",
            "port": "2079"
        }
    }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

The cPanel account.

If you do not include this parameter, the function defaults to the current authenticated user.

  • A valid cPanel account user.
  • A valid email account user.
example

Returns

ReturnTypeDescriptionPossible valuesExample
userstring

The specified cPanel user or email account user to whom the returned connection information pertains.

If you do not specify a user value, this function returns the authenticated cPanel user.

  • A cPanel account user.
  • An email account user.
example2@example.com
sslhashA hash that contains the SSL connections.This hash includes the is_self_signed, port, server, and full_server returns and the contacts and calendars arrays. 

is_self_signed

Boolean

Whether the server uses a self-signed certificate.

The function returns this value in the ssl hash.

  • 1 — Self-signed.
  • 0 — Not self-signed.

 

1

port

integer

The port number that the system uses for SSL connection.

The function returns this value in the ssl hash.

A positive integer.2080

server

string

The short server connection string.

The function returns this value in the ssl hash.

Note:

This value is useful for clients that support Autodiscovery.

A domain name and port that uses the HTTP protocol.

https://server.example.com:2080

full_server

string

The absolute URL path to the user's CalDAV and CardDAV connection.

The function returns this value in the ssl hash.

Note:

This information is useful for clients that do not support Autodiscovery.

A domain name and port with the absolute path that uses the HTTP protocol.
 Click to view...

https://server.example.com:2080/rpc/principal/example

contacts

array

The list of address books for the user.

The function returns this array in the ssl hash.

This array contains the name, description, path, and url returns. 

name

string

The name of the address book.

The function returns this value in the contacts array.

A valid string.Custom 1

description

string

The description of the address book.

The function returns this value in the contacts array.

A valid string.Custom address book 1.

path

string

The relative URL to the address book.

The function returns this value in the contacts array.

A valid string.
 Click to view...

/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6

url

string

The absolute URL to the address book.

This function returns this value in the contacts array.

A valid URL.
 Click to view...

https://example.com:2080/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6

calendars

array

The list of address books for the user.

The function returns this array in the ssl hash.

This array contains the name, description, path, and url returns. 

name

string

The name of the calendar.

The function returns this value in the calendars array.

A valid string.Custom 1

description

string

The description of the calendar.

The function returns this value in the calendars array.

A valid string.Custom address book 1.

path

string

The relative URL path to the calendar.

The function returns this value in the calendars array.

A valid string.
 Click to view...

/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1

url

string

The absolute URL to the calendar.

The function returns this value in the calendars array.

A valid URL.
 Click to view...

https://example.com:2080/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1

no_sslhash

The configuration for non-SSL connections.

The function returns this hash in the ssl hash.

This hash includes the port, server, and full_server returns and the contacts and calendars arrays. 

port

integer

The port number that the system uses for non-SSL connections.

The function returns this value in the no_ssl hash.

A positive integer.

2079

server

string

The short server connection string.

The function returns this value in the no_ssl hash.

 

A domain name and port that uses the HTTP protocol.

http://example.com:2079

full_server

string

The absolute URL path to the user's CalDAV and CardDAV connection information.

The function returns this value in the no_ssl hash.

Note:

This information is useful for clients that do not support Autodiscovery.

A domain name and port with the absolute path that uses the HTTP protocol.
 Click to view...

http://example.com:2079/rpc/principal/example

contacts

array

The list of address books for the user.

The function returns this array in the no_ssl hash.

This array contains the name, description, path, and url returns. 

name

string

The name of the address book.

The function returns this value in the contacts array.

A valid string.Custom 1

description

string

The description of the address book.

The function returns this value in the contacts array.

A valid string.Custom address book 1.

path

string

The relative URL to the address book.

The function returns this value in the contacts array.

A valid string.
 Click to view...

/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6

url

string

The absolute URL to the address book.

The function returns this value in the contacts array.

A valid URL.
 Click to view...

https://example.com:2080/addressbooks/example/contacts:E-KKA5uQZyQJbTBKcGP3OQ6

calendars

array

The list of address books for the user.

The function returns this array in the no_ssl hash.

This array contains the name, description, path, and url returns. 

name

string

The name of the calendar.

The function returns this value in the calendars array.

A valid string.Custom 1

description

string

The description of the calendar.

The function returns this value in the calendars array.

A valid string.Custom address book 1.

path

string

The relative URL path to the calendar.

The function returns this value in the calendars array.

A valid string.
 Click to view...

/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1

url

string

The absolute URL to the calendar.

The function returns this value in the calendars array.

A valid URL.
 Click to view...

http://example.com:2079/calendars/example/calendar:ZcG9JBH68WXxfMVUgvSrUw1