surveyDetailsAndTemplates¶
Supported, no replacement yet
This endpoint remains fully supported. No replacement exists in the new API yet, and no action is needed. When a replacement ships you will get 12 months' notice, and this site will be updated.
Reference¶
/rest/assetmgmt/survey/surveyDetailsAndTemplates/{job-ref-list} &excludeTemplateIds={temp-id-list}
There is an optional optimisation that allows the extra parameter excludeTemplateIds to specify a list of templates to be ignored. This allows devices such as mobiles to not download templates again when details are being refreshed.
This method is useful for poor network coverage areas as it does everything in a single call avoiding any issues with details being downloaded without the matching template.
available response representations:
GET
Get details of surveys associated to the specified Job Ref csv list and associated templates.There is an optional optimisation that allows the extra parameter excludeTemplateIds to specify a list of templates to be ignored. This allows devices such as mobiles to not download templates again when details are being refreshed.
This method is useful for poor network coverage areas as it does everything in a single call avoiding any issues with details being downloaded without the matching template.
available response representations:
- 200 - application/json
{ "siteSurveys":[ { "id":"345", "surveyName", //survey table "surveyID":"3", "status":"1", "siteId":"32123", "tableNumColumns":"3", //survey table "jobRef:"J09XNK", "activitySurvey: true, //true if linked to activities otherwise false "performedOn":"23/09/2011", "completionStage":"1", //1 - anytime, 2 - before works starts "appointmentId":"23", //nullable "processId":"2", //nullable
"siteLocations":[ //separate section for this as site locations relate to site, used for lookup { "id":"5433", "name":"kitchen" }, { "id":"5433", "name":"kitchen" } ],
"attributeGroups":[ //combination of SiteTypeAttributeGroups and WorkTypeAttributeGroups, one per page { "id":"1", // unique id generated just for the download
"name":"rob-test", "type":"W", //workttype attribute group or sitetype attribute group "sequence":"1", "attributes":[ { "id":"4334", //sitesurveyattribute id "mandatory":"Y", //sta or wta, "sequence":"1", //sta or wta "defaultValue":"01/01/2009", //sta or wta, field to get this from depends on type "type":"1", //att, normal or lookup "dataType":"1", //att, char, integer, decimal etc. _LookupDataType "name":"Number of Keys Received", //att "minValue":"", //att, min value, field to get this from depends on type "maxValue":"", //att, max value, field to get this from depends on type "lookupValues":[ //from attributelookup table, only populated if type is Lookup { "id":"343", //attlook "sequence":"1", //attlook "value":"1" //attlook }, { "id":"656", "sequence":"2", "value":"2" } ], "value":"1" //ssatt, from appropriate value field (lookup_value if it's a lookup), needs to consider show_values flag on SiteSurvey } ] } ], "siteSurveyAssets" : [ { "id":"4534", //siteSurveyAsset "ref":"ABC-123", //siteSurveyAsset "libraryAssetID":"12", //asset, need to downloade these separately for adding assets, use to derive model, asset type "siteLocationID":"21", //ssa, need to downloade these separately for adding assets (these are per site though!!) "conditionID":"3", //ssa, downloaded separately "status":"2", //sitesurveyasset, "description": "Boiler - Bosch V1", //assetType.name - manufacturer.name libraryAsset.model "attributeGroups":[ //one screen per group
{ "id":"1", //assetyTypeAttrGroup id
"name":"group7", //assettypeattgroup "sequence":"1", //assettypeattgroup "attributes":[ { "id":"4234", //sitesurveyassetattributeid "mandatory":"Y", //ata, "sequence":"1", //ata, dictates order question appears on screen "defaultValue":"01/01/2009", //ata, field to get this from depends on type "type":"1", //att, normal or lookup "dataType":"1", //att, char, integer, decimal etc. _LookupDataType "name":"Valve Type", //att "minValue":"", //att, min value, field to get this from depends on type "maxValue":"", //att, max value, field to get this from depends on type "lookupValues":[ //from attributelookup table, only populated if type is Lookup { "id":"343", //attlook "sequence":"1", //attlook, dictates order value occurs in lookup "value":"1" //attlook }, { "id":"656", "sequence":"2", "value":"2" } ], "value":"1" //ssassetatt, from appropriate value field (lookup_value if it's a lookup), this would also be dependant on show_values flag on SiteSurvey } ] }, ] } ],
"surveyTemplates":[
{ "id":"3", //survey id "name":"Gas Survey", "tabletNumColumns":"3",
"assetTypes":[ {
"id":"85858", //surveyassettype id "name":"Boiler", //assettype
"attributeGroups":[
{"id":"332", // assetTypeAttributeGroup
"name":"group7", // assetTypeAttributeGroup
"sequence":"1", // assetTypeAttributeGroup
"attributes":[ { "id":"424", //assettypeattribute "name":"Valve Type", //attribute "mandatory":"Y", //assettypeattribute "sequence":"1", //assettypeattribute "defaultValue":"7", //assettypeattribute "type":"1", //attribute "dataType":"1", //attribute "minValue":"", //attribute "maxValue":"", //attribute "lookupValues":[ //from attributelookup table, only populated if type is Lookup { "id":"343", //attlook "sequence":"1", //attlook, dictates order value occurs in lookup "value":"1" //attlook } ] } ] } ]
"libraryAssets":[ { "id":"7474", //libraryAssetID "model":"Heater-3000", "manufacturerID":"78" } ] } ],
result:'success', result_msg:''}See the Asset Management API matrix for the full list of endpoints in this category.