Blindata API specification¶
1. Install guide
1.1 Please create a new Blindata Operator (Administration>Users>Add) with any login (for example ‘APIOperator’)
1.2 Go to the Blindata app folder and open Blindata.ini then add APIOperatorLogin and APIOperatorPassword keys with the values from the prev step (APIOperator, pass) to the [Connection] section
1.3 Configure some Blindata customers as 'Online'. To do this, go to Sales Files > Customers > Amend (or create a new one) > Online Settings and set the ‘Allow Online Authentication’ flag on, and enter online login and password.
1.4 Open the Windows command line (cmd) from the Administrator mode (Run as Administrator), then go to the Blindata app folder.
Then type ‘install’ and enter the Service Type as ‘API’ and some company name (Local for example). Make sure that Blindata service has been installed and started OK.
1.5 Open ‘http://localhost:8080’ URL in the internet browser. The page like this should appear:
Blindata Service is installed and ready to provide API functions
2. API actions
To test Blindata API actions please use the Blindata API Client utility.
2.1 Blindata service provides API access via JSON. Third-party applications should send POST JSON or Empty request to http://localhost:8080 URL with the following mandatory HTTP request headers:
APIVersion, APIKey, CustomerLogin, Action
APIVersion: is the current version of API. The actual version is: 10001
APIKey: is value from Blindata>Administration>Parameters>API>Blindata API>Key field
CustomerLogin: is customer online login entered on step 1.3
Action: action list specified below
Blindata Service will return an Error or OK action result in JSON format.
2.2 Action error JSON response has the following format:
{"Error":{"Code":X,"Message":"Y","Details":"Z"}}
Where:
X: Error code, int, mandatory
Y: Error Message, string, mandatory,
Z: Error Details, string, non-mandatory
Example: {"Error":{"Code":12,"Message":"Wrong customer account online login"}}
2.3 API Action list:
You can find actual action list on the Blindata Service Info Page specified on step 1.5 in ‘Registered API Actions’ section, or by using ‘Blindata API Client’ utility.
Action parameters (if required) should be passed as http request headers)
Actual API Action list:
GetBlindTypeList (no parameters, empty request body)
Result Example:
[ { "ID":353, "Description":"127mm Vertical", "Code":"L127" }, { "ID":366, "Description":"15mm Venetian", "Code":"V16" }, { "ID":363, "Description":"89mm Vertical", "Code":"L89" }, { "ID":365, "Description":"Roller", "Code":"ROLLER WITH LONG DES" } ]
GetMeasureList (no parameters, empty request body)
Result Example:
[ { "ID":69, "Name":"Recess", "Code":0 }, { "ID":70, "Name":"Blind Size", "Code":0 }, { "ID":71, "Name":"Fold\/Fold", "Code":0 }, { "ID":72, "Name":"Cloth", "Code":0 }, { "ID":73, "Name":"Tube", "Code":0 }, { "ID":74, "Name":"EBS", "Code":0 }, { "ID":75, "Name":"Fabric", "Code":0 }, { "ID":76, "Name":"Roller", "Code":0 }, { "ID":78, "Name":"Pin Size", "Code":0 }, { "ID":79, "Name":"Blind", "Code":0 }, { "ID":81, "Name":"----------------", "Code":0 } ]
GetFabricList (parameters: [BlindTypeID: Integer], empty request body)
Result Example:
[ { "ID":32899, "Description":"Online", "Code":"ONLINE", "SuppPartNo":"", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, { "ID":32896, "Description":"Roller Fabric", "Code":"RFAB", "SuppPartNo":"", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } } ]
GetModel (parameters: [BlindTypeID: Integer; FabricID: Integer], empty or non-empty request body)
Request Example: (empty for the first call):
[ { "Name":"Measure", "ID":69 }, { "Name":"Width", "Value":800, "Sender":true }, { "Name":"Drop", "Value":0 }, { "Name":"InstallHeight", "Value":2000 } ]
Result Example:
[ { "Name":"Measure", "Title":"Measure To", "Type":"Integer", "Visible":true, "ID":69, "Value":"Recess" }, { "Name":"VeluxCode", "Title":"Velux Code", "Type":"Integer", "Visible":false, "ID":0, "Value":"" }, { "Name":"Width", "Title":"Width", "Type":"Double", "Visible":true, "Value":0 }, { "Name":"Drop", "Title":"Drop", "Type":"Double", "Visible":true, "Value":0 }, { "Name":"LeftReturn", "Title":"Left Return", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"RightReturn", "Title":"Right Return", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"Depth", "Title":"Depth", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"HeadrailSize", "Title":"Headrail Size", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"TopWidth", "Title":"Top Width", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"ValanceWidth", "Title":"Valance Width", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"ReturnLength", "Title":"Return Length", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"InstallHeight", "Title":"Install Height", "Type":"Double", "Visible":true, "Value":2000 }, { "Name":"ChainLength", "Title":"Chain Length", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"SmallDrop", "Title":"Small Drop", "Type":"Double", "Visible":false, "Value":0 }, { "Name":"Vanes", "Title":"Vanes", "Type":"Integer", "Visible":false, "Value":0 }, { "Name":"Panels", "Title":"Panels", "Type":"Integer", "Visible":false, "Value":0 } ]
GetOptionList (parameters: [BlindTypeID: Integer; FabricID: Integer], empty request body)
Result Example:
[ { "ID":27578, "FieldName":{ "ID":144, "Description":"Finish", "AlternativeXMLName":"" }, "Fabric":{ "ID":29163, "Description":"Straight", "Code":"STRAIGHT", "SuppPartNo":"NOFANCYBOTTOM", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27579, "FieldName":{ "ID":134, "Description":"Bottom Bar", "AlternativeXMLName":"" }, "Fabric":{ "ID":29164, "Description":"No Bottom Bar", "Code":"NOBOTTOMBAR", "SuppPartNo":"NOBOTTOMBAR", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27580, "FieldName":{ "ID":139, "Description":"Control Type", "AlternativeXMLName":"" }, "Fabric":{ "ID":29148, "Description":"Left Hand Control", "Code":"LRCONTROLX", "SuppPartNo":"LRCONTROL", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27581, "FieldName":{ "ID":151, "Description":"Pole", "AlternativeXMLName":"" }, "Fabric":{ "ID":29158, "Description":"Pole, WOODEN 2.0mmX16mm Light Oak", "Code":"NET9400", "SuppPartNo":"NET9400", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27582, "FieldName":{ "ID":195, "Description":"Roller Tube", "AlternativeXMLName":"" }, "Fabric":{ "ID":29702, "Description":"28mm Tube", "Code":"TUBE28", "SuppPartNo":"TUBE28", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false } ]
GetOptionChoices (parameters: [
FieldNameID: Integer;
BlindTypeID: Integer;
FabricID: Integer;
Width: Double;
Drop: Double;
], non empty request body)
Request Example:
[ { "FieldNameID":144, "FabricID":29163, "IsHide":false }, { "FieldNameID":134, "FabricID":29164, "IsHide":false }, { "FieldNameID":139, "FabricID":29148, "IsHide":false }, { "FieldNameID":151, "FabricID":29158, "IsHide":false }, { "FieldNameID":195, "FabricID":29702, "IsHide":false } ]
Result Example:
[ { "ID":29148, "Description":"Left Hand Control", "Code":"LRCONTROLX", "SuppPartNo":"", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, { "ID":29149, "Description":"Right Hand Control", "Code":"LRCONTROL", "SuppPartNo":"", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, { "ID":29150, "Description":"Spring Roler Control", "Code":"LRCONTROL", "SuppPartNo":"", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } } ]
ChangeOption (parameters: [
FieldNameID: Integer;
OptionID: Integer;
BlindTypeID: Integer;
FabricID: Integer;
MeasureID: Integer;
Quantity: Integer;
Width: Double;
Drop: Double;
ChainLength: Double
], non empty request body)
Request Example:
[ { "FieldNameID":144, "FabricID":29163, "IsHide":false }, { "FieldNameID":134, "FabricID":29164, "IsHide":false }, { "FieldNameID":139, "FabricID":29148, "IsHide":false }, { "FieldNameID":151, "FabricID":29158, "IsHide":false }, { "FieldNameID":195, "FabricID":29702, "IsHide":false } ]
Result Example:
[ { "ID":27663, "FieldName":{ "ID":144, "Description":"Finish", "AlternativeXMLName":"" }, "Fabric":{ "ID":29163, "Description":"Straight", "Code":"STRAIGHT", "SuppPartNo":"NOFANCYBOTTOM", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27664, "FieldName":{ "ID":134, "Description":"Bottom Bar", "AlternativeXMLName":"" }, "Fabric":{ "ID":29164, "Description":"No Bottom Bar", "Code":"NOBOTTOMBAR", "SuppPartNo":"NOBOTTOMBAR", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27665, "FieldName":{ "ID":139, "Description":"Control Type", "AlternativeXMLName":"" }, "Fabric":{ "ID":29150, "Description":"Spring Roler Control", "Code":"LRCONTROL", "SuppPartNo":"LRCONTROL", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27666, "FieldName":{ "ID":151, "Description":"Pole", "AlternativeXMLName":"" }, "Fabric":{ "ID":29158, "Description":"Pole, WOODEN 2.0mmX16mm Light Oak", "Code":"NET9400", "SuppPartNo":"NET9400", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false }, { "ID":27667, "FieldName":{ "ID":195, "Description":"Roller Tube", "AlternativeXMLName":"" }, "Fabric":{ "ID":29702, "Description":"28mm Tube", "Code":"TUBE28", "SuppPartNo":"TUBE28", "FabricType":"", "FabricGroup":{ "ID":0, "Name":"" } }, "_Price":0, "Price":0, "Margin":0, "IsHideOption":false, "IsShowOnline":true, "IsNull":false } ]
ImportTransaction (No parameters, non empty request body)
Request Example:
{ "Transfer":{ "TEDISenderInformation_Details":{ "TEDIOrderHeader_Details":[ { "TEDIOrderDetails_Details":[ { "BlindTypeCode":"ROLLER WITH LONG DES", "MeasureName":"Recess", "FabricCode":"RFAB", "Quantity":"1", "WidthDisplay":"1000", "DropDisplay":"1200", "CustomerOrderReference":"2", "RequiredDate":"2022-09-22", "DetailCarriageType":"Standard", "OrderCategory":"Standard", "TEDIOptionList_Details":[ { "OptionName":"Bottom Bar", "Choice":"No Bottom Bar", "ChoiceCode":"NOBOTTOMBAR" }, { "OptionName":"Control Type", "Choice":"Left Hand Controlr", "ChoiceCode":"LRCONTROLX" }, { "OptionName":"Finish", "Choice":"Straight", "ChoiceCode":"STRAIGHT" }, { "OptionName":"Pole", "Choice":"Pole, WOODEN 2.0mmX16mm Light Oak", "ChoiceCode":"NET9400" }, { "OptionName":"Roller Tube", "Choice":"28mm Tube", "ChoiceCode":"TUBE28" } ] }, { "BlindTypeCode":"ROLLER WITH LONG DES", "MeasureName":"Recess", "FabricCode":"RFAB", "Quantity":"1", "WidthDisplay":"1000", "DropDisplay":"1200", "CustomerOrderReference":"2", "RequiredDate":"2022-09-22", "DetailCarriageType":"Standard", "OrderCategory":"Standard", "TEDIOptionList_Details":[ { "OptionName":"Bottom Bar", "Choice":"No Bottom Bar", "ChoiceCode":"NOBOTTOMBAR" }, { "OptionName":"Control Type", "Choice":"Left Hand Controlr", "ChoiceCode":"LRCONTROLX" }, { "OptionName":"Finish", "Choice":"Classic", "ChoiceCode":"CLASSIC" }, { "OptionName":"Pole", "Choice":"Pole, WOODEN 2.0mmX16mm Light Oak", "ChoiceCode":"NET9400" }, { "OptionName":"Roller Tube", "Choice":"28mm Tube", "ChoiceCode":"TUBE28" } ] } ] } ] } } }
Result Example:
{ "OK":{ "Code":10000, "Message":"Sales order(s) has been imported", "Details":"Creating Order...\r\n Creating Details with Order ID 1091\r\n Creating Options for Details...\r\n Option # 41039 has been created!\r\n Option # 41040 has been created!\r\n Option # 41041 has been created!\r\n Option # 41042 has been created!\r\n Option # 41043 has been created!\r\n Order Detail # 4107 has been created!\r\n Creating Options for Details...\r\n Option # 41049 has been created!\r\n Option # 41050 has been created!\r\n Option # 41051 has been created!\r\n Option # 41052 has been created!\r\n Option # 41053 has been created!\r\n Order Detail # 4108 has been created!\r\n Creating Receipts with Order ID 1091\r\n No Order Receipts to create!\r\nWarning: The following duplicate Cust Ref (2) has been entered:\r1090, 05\/12\/2022, 2 ROLLER WITH LONG DES.\r\nThe scheduled manufactured date is not specified for this order\r\nCreating order finished!\r\n" }, "Orders":[ 1091 ] }
2.4 Sales order creation example for the data specified above:
2.4.1 Call GetBlindTypeList action and get blind type list. For example, we need to create a sales order for the ‘Roller’ blind.
2.4.2 Call GetMeasureList action and get measure list.
2.4.3 Call GetFabricList action with parameter BlindTypeID=365 (see GetBlindTypeList action result example) and get fabric list. For example, we need to use ‘Roller Fabric’ fabric
2.4.4 Call GetOptionList action with parameter BlindTypeID=365, FabricID= 32896 (see GetFabricList action result example)
2.4.5 Call GetModel action with parameter BlindTypeID=365, FabricID= 32896 and empty request body
All JSON array items with ‘Visible’=true used for this for this blind and can be changed.
2.4.6 For example we need use 1000x1200 blind size.
Call GetModel action with parameter BlindTypeID=365, FabricID= 32896 and the followind request body:
[ { "Name":"Measure", "ID":69 }, { "Name":"Width", "Value":1000, "Sender":true }, { "Name":"Drop", "Value":0 }, { "Name":"InstallHeight", "Value":2000 } ]
Then Call GetModel action with parameter BlindTypeID=365, FabricID= 32896 and the followind request body:
[ { "Name":"Measure", "ID":69 }, { "Name":"Width", "Value":1000 }, { "Name":"Drop", "Value":1200, "Sender":true }, { "Name":"InstallHeight", "Value":2000 } ]
Please note – you need to call GetModel action for the each field that should be changed (twice in this example), and include Sender:true in the changed field JSON, and check each action result. For example, if the max blind width value for the ‘Roller’ blind configured as 900 in the Blindata app, you will get the following result for the first action call: {"Error":{"Code":1,"Message":"Max width for this blind type is 900"}}
2.4.7 For example we need to change ‘Control Type’ option from ‘Left Hand Control’ to ‘Spring Roler Control’. To do this you need to call GetOptionChoices action with parameters FieldNameID= 139(see GetOptionList action result example), BlindTypeID=365, FabricID= 32896, Width=1000, Drop=1200 and request body as GetOptionChoices action request example.
Then you need to call ChangeOption action with parameters FieldNameID= 139, OptionID=29150 (see GetOptionChoices action result), BlindTypeID=365, FabricID= 32896, MeasureID=69(see GetMeasureList action result), Quantity=1, Width=1000, Drop=1200, ChainLength=0 and request body as ChangeOption action request example and you will get actual option configuration.
Please note - in the received configuration of options, not only the ‘Control Type’ option will be changed, but also some other options can be changed automatically.
2.4.8 Call ImportTransaction action with no parameters to create sales order.