Skip to main content
Version: Next

Endpoints

Overview

The Endpoints class provides access to both public and authenticated system endpoints, including custom domain endpoints. It simplifies retrieving the necessary endpoint types for secure and public access management across different environments, such as development.

tip

The Endpoints class is a shared singleton, meaning a single instance is globally available without needing manual creation. You can access it directly via the .me property without instantiating a new instance.

Functions and properties

.authenticatedEndpoint() : String    returns the authenticated API endpoint URL specific to the current Qodly environment.
.customDomainAuthenticatedEndpoint() : String    returns the authenticated API endpoint URL for a custom domain if it has been configured.
.customDomainPublicEndpoint() : String    returns the public endpoint URL for a custom domain if it has been configured in the Qodly application.
.me : cs.Qodly.Endpoints    returns the current instance of the Endpoints singleton.
.publicEndpoint() : String    returns the public API endpoint URL for the current Qodly environment, allowing external services to access public resources without authentication.

.authenticatedEndpoint()

.authenticatedEndpoint() : String

ParameterTypeDescription
ResultStringAuthenticated endpoint URL for the current environment.

Description

The .authenticatedEndpoint() function returns the authenticated API endpoint URL specific to the current Qodly environment.

Example

To implement a method that retrieves the authenticated endpoint in a custom class:

var authEndpoint : string
authEndpoint = cs.Qodly.Endpoints.me.authenticatedEndpoint()

.customDomainAuthenticatedEndpoint()

.customDomainAuthenticatedEndpoint() : String

ParameterTypeDescription
ResultStringAuthenticated endpoint URL for a custom domain or null.

Description

The .customDomainAuthenticatedEndpoint() function returns the authenticated API endpoint URL for a custom domain if it has been configured.

Example

To implement a method that retrieves the custom domain authenticated endpoint in a custom class:

var customAuthEndpoint : string
customAuthEndpoint = cs.Qodly.Endpoints.me.customDomainAuthenticatedEndpoint()

.customDomainPublicEndpoint()

.customDomainPublicEndpoint() : String

ParameterTypeDescription
ResultStringPublic endpoint URL for a custom domain or null.

Description

The .customDomainPublicEndpoint() function returns the public endpoint URL for a custom domain if it has been configured in the Qodly application.

Example

To implement a method that retrieves the custom domain public endpoint in a custom class:

var customPublicEndpoint : string
customPublicEndpoint = cs.Qodly.Endpoints.me.customDomainPublicEndpoint()

.me

.me : cs.Qodly.Endpoints

ParameterTypeDescription
Resultcs.Qodly.EndpointsThe Endpoints Singleton Object containing system endpoints.

Description

The .me property returns the current instance of the Endpoints singleton. It provides direct access to the system endpoints.

It must be used when calling functions like publicEndpoint() or authenticatedEndpoint().

Why .me is Required:

If you attempt to call:

var publicEndpoint : string
publicEndpoint = cs.Qodly.Endpoints.publicEndpoint()

You will encounter an error: function call error (is not a function).

The correct way is:

var publicEndpoint : string
publicEndpoint = cs.Qodly.Endpoints.me.publicEndpoint()

The .me ensures the function is being called from the current active instance of the Endpoints singleton.

.publicEndpoint()

.publicEndpoint() : String

ParameterTypeDescription
ResultStringPublic endpoint URL for the current Qodly environment.

Description

The .publicEndpoint() function returns the public API endpoint URL for the current Qodly environment, allowing external services to access public resources without authentication.

Example

To implement a method that retrieves the custom domain authenticated endpoint in a custom class:

var publicEndpoint : string
publicEndpoint = cs.Qodly.Endpoints.me.publicEndpoint()