Lack of functionality in API queries

We need access to SMART Connect Server data via API.

For this the following documentation was found: SMART Connect API Documentation | SMART Conservation Software Project | Assembla.

The more specific documentation for version 7.5.7 (in development) was found in there:

I checked briefly the API in two ways: via command line curl and via Python code – both work fine.

import subprocess
import requests

# Define URL
server_url = 'https://<my_smart_connect_server_domain>:8443/server'
api_test = '/api/query/custom/waypoint?waypoint_date=2024-01-01:2024-05-10'
query_url = server_url + api_test

# My credentials
username = '...'
password = '...'

print('==== Python code ====')
# Perform GET request with basic authentication
response = requests.get(query_url, auth=(username, password))

if response.status_code == 200: # Check response status
    print("Request successful!")
    print(response.json())  # Print out response content
else:
    print("Error:", response.status_code)

print('==== Command line ====')
result = subprocess.run(
    ['curl', '-u', f'{username}:{password}', query_url],
    capture_output = True, # Python >= 3.7 only
    text = True # Python >= 3.7 only
)
print(result.stdout)

Everything is fine.

Issues

However, we found a lack of functionality in API queries. Though probably we just did not find proper query types.

For example:

  1. It is possible to get records of the SMART Collect Package type. However, in the resulted JSON in the field properties: waypoint: source there is SMARTCOLLECT instead of the email of a user submitted the record. For us it would be better to have the latter.
  2. It is not clear how to get photo or audio attachments from the SMART Connect Server database. Or it would be even sufficient to have a link to the needed media file.
  3. It is said in the documentation that the Custom Query API returns 1000 records maximum. The issue followed immediately – how to get all requested records in case if their number is more than 1000. Of course, it might be done by chunks. For this it should be another type of request telling how many there are requested records. The latter could not be found, at least so far.

We would be grateful for your help, hints, ideas.

My colleagues have recently found interesting discussion regarding other type of SMART API — with ArcGIS (see Integrating SMART with ArcGIS Online).

The discussion happened three years ago. Then, according to Alexander Wyatt @Alex_Wyatt, there was not “a mechanism to directly link ArcGIS online with SMART”.

So, I wonder whether is there any progress in that since then?

Another question: Does SMART for Conservation have a command line interface (CLI) API?

The presence of such an API would make it possible to organize the service by installing SMART Desktop behind the scenes on the server. Unlike the SMART Connect Data API, SMART Desktop is able to export a complete set of data including media files.

Could anyone tell about that?