getDeviceTemplates

POST public/getDeviceTemplates

Returns the names of the device templates you can use to register devices at a location. Device templates belong to the location's company. Use a template name with getDeviceTemplateMatches and registerDevices.

Request syntax

curl https://apiv2.acumera.net/public/getDeviceTemplates \
  --cookie av_session.txt \
  --data-urlencode "location_id=<location_id>"

The username, password, and tfa_token parameters are also accepted, and are required only if the client hasn't already signed in with login. See Getting started with the SC//AcuVigil API.

Request parameters

The request accepts the following parameters in a form-encoded body.

Parameter Type Description Required Default value
location_id Integer The ID of the location. To find location IDs, use getCompanyInfo with include_sites=1. Yes

Response syntax

{
    "success": "string",
    "data": {
        "device_registration_templates": [
            "string"
        ]
    }
}

Response parameters

If the call succeeds, success is "1" and the following data is returned.

Field Description
device_registration_templates The names of the device templates for the location's company.

Errors

If the call fails, success is "0", and returnCode and returnMessage describe the problem. The HTTP status is still 200.

Return code Message Cause
NO_LOCATION_SELECTED No location was selected or the location does not exist. location_id is missing or isn't a number.
LOCATION_NOT_FOUND The location was not found. No location has that ID.
AUTH_FAILED_FUNC_NOT_ALLOWED Authorization failed because you are not permitted to access the requested function. Your account isn't allowed to register devices, or doesn't have access to the location.
SITE_NOT_ACTIVE The location is not active. The location isn't active.
NO_DEVICE_REGISTRATION_TEMPLATES_FOUND No Device Templates were found for this location. The company has no device templates. To have templates set up, contact Scale Computing Support.
INVALID_LOGIN We were unable to log you in. Make sure you entered the correct username, password and 2FA code. You haven't signed in, your session has ended, or the credentials sent with the call are wrong.

Examples

Example: List the device templates for a location

curl https://apiv2.acumera.net/public/getDeviceTemplates \
  --cookie av_session.txt \
  --data-urlencode "location_id=4510"

Response:

{
    "success": "1",
    "data": {
        "device_registration_templates": [
            "Verifone-default-20231128",
            "Verifone-default-20240213"
        ]
    }
}

The template names depend on the templates set up for your company.

Example: The company has no device templates

{
    "success": "0",
    "returnCode": "NO_DEVICE_REGISTRATION_TEMPLATES_FOUND",
    "returnMessage": "No Device Templates were found for this location."
}