Check the Validity of Milestone / Target Name

Check the uniqueness of a milestone target name.

This API checks if the name provided for a target group, target, streak, streak level, and period is unique within an organisation.

Prerequisites

  • Authentication: Basic/OAuth authentication
  • Access group: Default access group

Resource Information

URIv3/targetGroups/isValidName
HTTP MethodPOST
PaginationNo
Batch supportNA
Rate limit informationNA

API endpoint example

https://eu.api.capillarytech.com/v3/targetGroups/isValidName

Request body

{
    "type": "targetName",
    "value": "SpendsUpwardsOf10K"
}

Request body parameters

Parameter (Parameters marked as * are required)Data TypeDescription
type*StringMilestone / target to check the validity for. You can check for active, inactive and user-created challenge related milestones.

Supported values are: targetGroupName, streakName, targetName, streakLevelName, periodName
value*StringName to be checked for uniqueness. The name is case-insensitive, meaning "Target" and "target" are considered the same.

Response body

{
    "data": true,
    "errors": null,
    "warnings": null
}
{
    "data": false,
    "errors": null,
    "warnings": null
}
{
    "data": null,
    "errors": [
        {
            "code": 310145,
            "message": "Invalid key is passed"
        }
    ],
    "warnings": null
}

Response body paramters

ParameterTypeDescription
dataBooleanThe value is true if the name is unique, else it is false.
errorsObjectErrors, if any.
warningsObjectWarnings, if any.

API specific errors

Error CodeDescriptionReason
310145Invalid key is passedThe milestone / target type is invalid.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!