UAPI Functions - DAV::get_calendar_contacts_config

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


 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'
);

 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',
);

 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 %]

 Command Line

uapi --user=username DAV get_calendar_contacts_config user=example

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 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 (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

 Parameter 

Type

Description

Possible values

 Example 

user

 string 

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

Return

Type

Description

Possible values

Example

user

string

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

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

  • A cPanel account user.
  • An email account user.

example2@example.com

ssl

hash

A hash that contains the SSL connections.

This hash includes theis_self_signed, port,server, and full_serverreturns and the contactsand 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.

 

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 urlreturns.

 

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.

 

url

string

The absolute URL to the address book.

This function returns this value in the contacts array.

A valid URL.

 

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 urlreturns.

 

name

string

The name of the calendar.

The function returns this value in the calendarsarray.

A valid string.

Custom 1

description

string

The description of the calendar.

The function returns this value in the calendarsarray.

A valid string.

Custom address book 1.

path

string

The relative URL path to the calendar.

The function returns this value in the calendarsarray.

A valid string.

 

url

string

The absolute URL to the calendar.

The function returns this value in the calendarsarray.

A valid URL.

 

no_ssl

hash

The configuration for non-SSL connections.

The function returns this hash in the ssl hash.

This hash includes the port,server, and full_serverreturns and the contactsand 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.

 

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 urlreturns.

 

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.

 

url

string

The absolute URL to the address book.

The function returns this value in the contacts array.

A valid URL.

 

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 urlreturns.

 

name

string

The name of the calendar.

The function returns this value in the calendarsarray.

A valid string.

Custom 1

description

string

The description of the calendar.

The function returns this value in the calendarsarray.

A valid string.

Custom address book 1.

path

string

The relative URL path to the calendar.

The function returns this value in the calendarsarray.

A valid string.

 

url

string

The absolute URL to the calendar.

The function returns this value in the calendarsarray.

A valid URL.

 

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....