Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Your command line should include a number of key components and specifically:

  • User Credentials - your security details (API key, etc)

  • your target dataset

  • your data payload

...

An example of the initial connection elements, that defines data provided to uSmart live data writer and the necessary credentials, are illustrated as follows:

curl -X POST https://livedatawriter.usmart.io/liveData:write -H "Content-Type: application/json" -H "Accept: application/json" -H "api-key-id:c5zz5965-4374-4b94-b444-06544b9eba8e" -H "api-key-secret:05901843c371273b12c732280d91ce0e39392786017c8ddfe435ac6b3a25cba8" -d "

...

Specifically, the code to determine the dataset correctly can be written as follows:

{"organisationGUID":"69210836-6c2b-4a26-a0a0-b903bde0dc46","datasetGUID":"fcd44037-4ba7-406f-8227-251bab530a99",

...

You will notice that the data payload code is within one open brace { already. Data is then added in the following manner. :

"data": {"Bedrooms": "3", "Date_survey": "2020-09-08", "Elec_currentuse": "1200", "Existing_Cooking": "1", "Existing_Fires": "0", "Floor_Height": "2.6", "Floor_Type": "Suspended", "Gas_currentuse": "10200", "Glazed_Type": "Double", "Habitable_Rooms": "4", "Heat_Primary_Source": "Gas Boiler - Combi", "Heat_Secondary_Source": "None", "Heated_rooms": "4", "House_Age": "1722", "House_Env": "Urban", "House_Form": "Semi-Detached", "House_ID": "1", "House_SAP": "50", "House_Type": "House", "Main_Fuel": "Gas", "Mains_Gas_Flag": "Yes", "Multi_Glaze_Proportion": "80-100%", "Name_Survey": "urbantide", "No_Adults": "2", "No_Child": "0", "No_Occupants": "4", "No_Storeys": "2", "No_Underfloor": "0", "Outside_Access": "No", "Outside_Space": "No", "Postcode_1": "ZW12", "Roof_Type": "Pitched", "TS_Existing": "None", "TS_Existing_Size": "", "Total_Floor_Area": "80.34", "Wall_Type": "Cavity_Insulated"}}"

...

Finally here is the full script from the above example:

curl -X POST https://livedatawriter.usmart.io/liveData:write -H "Content-Type: application/json" -H "Accept: application/json" -H "api-key-id:cc5zz5965-4374-4b94-b444-06544b9eba8e" -H "api-key-secret:05901843c371273b12c732280d91ce0e39392786017c8ddfe435ac6b3a25cba8" -d "{"organisationGUID":"69210836-6c2b-4a26-a0a0-b903bde0dc46","datasetGUID":"fcd44037-4ba7-406f-8227-251bab530a99","data": {"Bedrooms": "3", "Date_survey": "2020-09-08", "Elec_currentuse": "1200", "Existing_Cooking": "1", "Existing_Fires": "0", "Floor_Height": "2.6", "Floor_Type": "Suspended", "Gas_currentuse": "10200", "Glazed_Type": "Double", "Habitable_Rooms": "4", "Heat_Primary_Source": "Gas Boiler - Combi", "Heat_Secondary_Source": "None", "Heated_rooms": "4", "House_Age": "1722", "House_Env": "Urban", "House_Form": "Semi-Detached", "House_ID": "1", "House_SAP": "50", "House_Type": "House", "Main_Fuel": "Gas", "Mains_Gas_Flag": "Yes", "Multi_Glaze_Proportion": "80-100%", "Name_Survey": "urbantide", "No_Adults": "2", "No_Child": "0", "No_Occupants": "4", "No_Storeys": "2", "No_Underfloor": "0", "Outside_Access": "No", "Outside_Space": "No", "Postcode_1": "ZW12", "Roof_Type": "Pitched", "TS_Existing": "None", "TS_Existing_Size": "", "Total_Floor_Area": "80.34", "Wall_Type": "Cavity_Insulated"}}""

...