This API checks if the name provided for a target group, target, streak, streak level, and period is unique within an organisation.
Sample request
curl --location 'https://eu.api.capillarytech.com/v3/targetGroups/isValidName' \
--header 'Authorization: Basic bWFka2YQ==' \
--header 'Content-Type: application/json' \
--header 'Cookie: _cfuvid=kYnuHywd2SuhkmuOi2_c7.Ie8_QvI8s1bFiaSPpP.8M-1759827226073-0.0.1.1-604800000' \
--data '{
"type": "targetGroupName",
"value": "uatTargetGroup62"
}'
URI v3/targetGroups/isValidName HTTP Method POST Pagination No Batch support NA Rate limit information NA
Parameter (Parameters marked as * are required) Data Type Description type* String Milestone / target to check the validity for. You can check for active, inactive and user-created challenge related milestones. \n \nSupported values are: targetGroupName
, streakName
, targetName
, streakLevelName
, periodName
value* String Name to be checked for uniqueness. The name is case-insensitive, meaning "Target" and "target" are considered the same.
Name is unique Name is not unique Milestone type is invalid
{
"data": true,
"errors": null,
"warnings": null
}
{
"data": false,
"errors": null,
"warnings": null
}
{
"data": null,
"errors": [
{
"code": 310145,
"message": "Invalid key is passed"
}
],
"warnings": null
}
Parameter Type Description data Boolean The value is true if the name is unique, else it is false. errors Object Errors, if any. warnings Object Warnings, if any.
Error Code Description Reason 310145 Invalid key is passed The milestone / target type is invalid.