Duplicate Keys¶
/api/repositories/{repository}/entities/{entity}/rows/duplicatekeys
Parameter | Type | Purpose |
---|---|---|
repository | string | the name of the Repository |
entity | int | The ID of the entity to view |
-
POST
/api/repositories/
(string: repository)/entities/
(int: entity)/rows/duplicatekeys
¶ Lists duplicate keys in a real Entity
JSON Parameters: - body – The request body
POST /api/repositories/jupiter/entities/1/rows/duplicatekeys HTTP/1.1
Content-Type: application/json
{
"command": "get",
"attribute": ["Key", "Data1"],
"values": ["333", "CCC"]
}
Response Code | Reason |
---|---|
200 | No error |
400 | Invalid data passed with request |
500 | Server error |
The request requires a Standard Request packet.
The request packet must contain the attribute
and values
elements.
attribute
element should contain an array of all the attribute names for the duplicate keys.
The values
field should contain an array of values corresponding to each duplicate key.
The response will be a Standard Response, with a list of duplicate rows in the corresponding Entity that matches the parameters passed.
The columns
array will contain the list of columns for each data row. The first element is :row ID:. The remaining elements are the Attributes of the entity.
data row will contain the list of permanent duplicate keys of the corresponding Entity:
"rows": [
{
"dataRow": [
"4",
"333",
"CCC"
],
"metadata": {
"url": "/api/repositories/jupiter/entities/24/rows/4/details"
}
},
{
"dataRow": [
"5",
"333",
"CCC"
],
"metadata": {
"url": "/api/repositories/jupiter/entities/24/rows/5/details"
}
},
{
"dataRow": [
"6",
"333",
"CCC"
],
"metadata": {
"url": "/api/repositories/jupiter/entities/24/rows/6/details"
}
}
]
If there are no permanent duplicate keys in the Entity, rows
will be an empty string.
Export¶
Some or all of the rows may be exported as a scheduled task.
POST /api/repositories/jupiter/entities/1/rows/duplicatekeys HTTP/1.1
Content-Type: application/json
{
"command": "export",
"attribute": ["Key", "Data1"],
"values": ["333", "CCC"],
"data": {
"filename": "filename.csv",
"filetype": "csv",
"encoding": "utf-8"
},
"options": {
"where": "Row = 21"
}
}
Response Code | Reason |
---|---|
200 | No error |
400 | Invalid data passed with request |
500 | Server error |
The request packet must contain the command
and data
elements. The options
element is not required, but may specify the columns to export, and/or the rows to filter.
The following table shows which fields are required in the data
element:
Field | Required |
---|---|
filename | Y |
filetype | N |
encoding | N |
If filetype
is not specified, it defaults to csv. If encoding
is not specified, it defaults to the server native encoding.
The response will contain the URL of the scheduled task and the link to download the exported file.
{
"job": "/api/repositories/jupiter/scheduler/1",
"file": "/api/repositories/jupiter/download/filename.csv"
}