Appearance
Check unique for columns
About 215 wordsLess than 1 minute
apiMetadata
2025-03-13
MethodPOST
Request URL
/plugin/datafor-modeler/api/metadata/checkunique
Authorization
The current user must have read privileges for the specified connection.
Request Example
{
"connection": "foodmart",
"schema": "foodmart",
"table": "time_by_day",
"fields": [
"the_year",
"the_month"
]
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
Accept | header | string | No | None |
body | body | object | No | None |
connection | body | string | Yes | Connection name |
schema | body | string | Yes | Schema name |
table | body | string | Yes | Table name |
fields | body | array[string] | Yes | Column names to check for uniqueness |
Response Examples
✅ Success Response
{
"code": "200",
"data": true,
"success": true
}
❌ Failure Response
{
"code": "400",
"data": false,
"success": false,
"msg": "Duplicate values found in specified columns"
}
HTTP Responses
HTTP Status Code | Meaning | Description |
---|---|---|
200 | OK | Columns checked successfully. |
400 | Bad Request | Invalid input or duplicate values found. |
401 | Unauthorized | Authentication required. |
403 | Forbidden | User lacks required privileges. |
500 | Internal Server Error | Unexpected server error. |
Response Data Schema
Name | Type | Required | Description |
---|---|---|---|
success | boolean | Yes | true if request was successful, false otherwise. |
data | boolean | Yes | true if columns are unique, false if duplicates exist. |
code | string | No | Response status code (200 for success, 400 for failure). |
msg | string | No | Error message (if applicable). |