Using cURL with Spatial Studio REST APIs

cURL is a powerful command line tool available on many platforms for sending and receiving URL requests to a remote server.

When accessing or invoking a REST endpoint, the curl command follows a specific format.

For example, consider the following request to retrieve the Spatial Studio version:

HTTP GET Request

curl -k https://localhost:4040/spatialstudio/oauth/v1/softwareVersion \
 --header "Authorization: Bearer <MY_TOKEN>"

The options used in the preceding request are explained as follows:

Note that the URL in the request uses oauth/v1 as path segments. If you accidentally use api/v1, then the response returns the web application login page in HTML.

The following sections explain with a few examples on how to invoke a REST API endpoint using cURL: