Pointerra REST API Reference

This document outlines the general principles of the Pointerra REST API. Detailed reference information on the current API endpoints can be found here.

Introduction

The Pointerra API is designed around the principles of RESTful APIs. The API has resource-oriented URLs, and uses HTTP response codes to indicate API errors. The API supports CORS, so you can use the API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors.

Authentication

All requests to API endpoints must include your secret API authentication token in the Authorization header of the request. You can get your API token from your Profile page. Your API token authenticates your access to resources - do not embed your secret API token in any publicly accessible code (e.g. client-side code). Typically this means you should only make calls to the Pointerra API from your server-side code.

Use "Authorization": "Token <your_token>" in request headers for any API call.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Errors

HTTP response codes are used to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, and invalid pointcloud id was used), and codes in the 5xx range indicate an internal error with the Pointerra service.

For failures, the detail field of the response will contain some information on why the request failed. For example, if credentials are not valid the response will be a 401 and contain -

 

API Request Rate Limits

There is rate limiting on the API requests for the Pointerra service - this is a per-token limit and is currently set at 60 requests per minute. When an application exceeds the rate limit for a given API endpoint, the API will return a 429 "Too Many Requests" error response.

Pagination

All top-level API resources have support for fetches via "list" API methods. For instance a common usage would be to get a list of pointclouds. All list API methods share a common pagination structure, based on page sizes and page numbers.

This pagination style accepts per_page and page values in the request query parameters to control the range of returned values from the collection. The default value for per_page is generally 10. The page parameter defaults to 1. So a request without these parameters would return the first 10 items (or less if there are not 10 items to return).

Example Request:

 

Example Response

 

Note that previous_page_url or next_page_url will be null if the current response is already at the first or last page of the collection. Use response.data to access the array of the objects within the page returned by the request.

For performance reasons, there is no way to guarantee returning of the entire collection. While you can make the per_page parameter large, you must always ensure your code is designed to deal with a paginated response, and hence have to make multiple requests to get the entire collection.

Standard GET Request Query Parameters for Collections

Most GET requests will support the following query parameters in the URL. Each collection may also support additional filtering options that are specific to the collection. These are documented separately with each collection.

ParameterTypeMeaning
fieldslist (comma separated string) Used to limit the fields in a response object; fields not listed will not be returned. Separate multiple fields with commas. Note that by default, if fields is not specified, each collection will return what it thinks is the most useful set of commonly required fields. If you want all available fields to be returned, specify fields=all
omitlist (comma separated string)The opposite of fields. Removes the specified fields from the response object.
searchstringFree text search term used to limit returned values. Which fields in the data are searched will be depended on the collection.
sortstring (field name)Specify which field you want to sort the paginated response on. Use a minus sign to reverse sort order (e.g sort=-name for reverse alpha)

Example Request

 

Full API Reference

Reference information for each top level API collection can be found here. Note that you will only be able to see API endpoints that your login credentials allow when using this page.

Common API Usage Examples

Below are some common examples (with dummy data) of the types of requests that can be made. In real code, you will need to add pagination and filtering/sorting as required.

Get a list of pointclouds

Get a list of pointclouds that the API token has access to, sorted by name.

 

Example Response

 

Get details for a particular pointcloud

Get detailed information for a specified pointcloud (looked up by id). Note that since this is not returning a collection, the response will not be paginated. In this case, the default fields are returned as no fields query parameter was supplied. For performance/bandwidth reasons, you will generally want to limit the returned object to only include the fields you require.

 

Example Response