CCAWebAPI: creating a sample list
To create a list using external data source you can send the json object below using POST to the /Lists controller.
The code below contains the necessary properties you need to create a list using an external data source.
{
"ExternalDataDSN": "KDW_SampleData;UID=sa;PWD=sa",
"ExternalDataPath": "",
"ExternalDataTable": "KDW_LIST1",
"ExternalDataType": 2,
"Fields": [
{
"Dynamic": false,
"Exported": false,
"ListFieldRoles": [],
"Name": "gender",
"Size": 50,
"Type": 10
},
{
"Dynamic": false,
"Exported": false,
"ListFieldRoles": [
{
"Param": -1,
"Role": 1
}
],
"Name": "id",
"Size": 0,
"Type": 4
},
{
"Dynamic": false,
"Exported": false,
"ListFieldRoles": [],
"Name": "language",
"Size": 50,
"Type": 10
},
{
"Dynamic": false,
"Exported": false,
"ListFieldRoles": [
{
"Param": -1,
"Role": 2
}
],
"Name": "telephonenr",
"Size": 50,
"Type": 10
}
],
"HasEmailAddressField": false,
"HasExternalUniqueIdField": true,
"HasPhoneNumberField": true,
"ListOrderType": 2,
"Description": "",
"Name": "KDW_LIST1"
}
More information
- "ExternalDataType": 2 > 2 is for ODBC.
- "Fields":
- “Type” : data type of the field.
- "ListFieldRoles":
- "Param": -1 is used to define the order of this role, eg. multiple phone numbers may be available in the external data source.
- "Role": defines the role of the field, eg. phone number, external Id, email address and so on.
Response:
"Request": {
"Method": "POST",
"Url": "http://127.0.0.1/ccawebapi/Lists"
},
"Version": "5.6.1.0",
"StatusCode": 200,
"Response": {
"NewId": 1016
}
}