Options
All
  • Public
  • Public/Protected
  • All
Menu

api

Main entry point for the Pointerra Viewer API

Hierarchy

  • ApiBase

Index

Accessors

options

  • Returns the options that were passed into the api at creation time.

    Returns IClientOptions

Methods

fetch

  • fetch(endpoint: string, options?: Dictionary<any>): Promise<any>
  • Fetch a resource from the Pointerra REST API. Automatically attaches required credentials and headers.

    api.fetch(`/pointclouds/${pointcloudId}`)
    .then((data) => {
    
    })

    Parameters

    • endpoint: string

      REST API endpoint to call

    • Default value options: Dictionary<any> = {}

      options that will be passed to native fetch call

    Returns Promise<any>

getAjaxConfig

  • getAjaxConfig(): AjaxCredentials
  • Returns AjaxCredentials

getAjaxCredentials

  • getAjaxCredentials(): "include" | "omit" | "same-origin"
  • Use this to get the credentials string required to call into the Pointerra service if you want to use your own ajax calls, rather than our fetch() method.

    Returns "include" | "omit" | "same-origin"

getAjaxHeaders

  • getAjaxHeaders(): Promise<Dictionary<string>>
  • Use this to get a populated set of headers required to call into the Pointerra service if you want to use your own ajax calls, rather than our fetch() method.

    // Use standard fetch methods to get details of a pointcloud
    const response = await fetch(`${api.getApiBase()}/pointclouds/${pointcloud_id}/`, {
        credentials: api.getAjaxCredentials(),
        headers: api.getAjaxHeaders(),
    })

    Returns Promise<Dictionary<string>>

getApiBase

  • getApiBase(): string
  • Get the URL path to the Pointerra REST API (normally /api)

    Returns string

getServiceProxyBase

  • getServiceProxyBase(): string
  • Returns string

resolveURI

  • resolveURI(uri: string): string