AMEE API / Data API / Data Category
Table of Contents
Overview
Data Categories are like folders on your desktop computer and are used to organise other entities within AMEE. Data Categories can contain other Data Categories as well as Data Items. Data Categories are mirrored by Profile Categories within a Profile.
See also: AMEE Concepts, AMEE Data API
Properties
| Property | Definition |
| path | The path of this Data Category. A path forms part of the URL. |
| name | The display name of this Data Category. |
See also: Common Properties
API Operations
View a Data Category
- URL: http://{server}/data[/{subcategory_path}]
- Method: GET
- Response format: application/xml, application/json
- Response code: 200 OK
- Response body: A description of the requested data category
Parameters:
| API Version | Parameter | Definition | Required |
| all | page | If there is more than one page of data, retrieve the specified page. See URL Architecture? for details of paging. | No |
| all | itemsPerPage | Specify the number of items returned in a single page. See URL Architecture? for details of paging. | No |
Example: JSON (containing subcategories)
Request:
GET /data HTTP/1.1
Accept: application/json
Authtoken: {your_authtoken_goes_here}
Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8
{
"dataCategory":{
"uid":"CD310BEBAC52",
"environment":{
"uid":"5F5887BCF726",
"itemsPerFeed":10,
"description":"",
"name":"AMEE",
"owner":"",
"path":"",
"itemsPerPage":10
},
"created":"2007-07-27 09:30:44.0",
"name":"Root",
"path":"",
"modified":"2007-07-27 09:30:44.0"
},
"path":"",
"children":{
"pager":{},
"dataItems":{},
"dataCategories":[
{
"uid":"7E99F5EB43CE",
"name":"Business",
"path":"business"
},
{
"uid":"BBA3AC3E795E",
"name":"Home",
"path":"home"
},
{
"uid":"85A9172C31AF",
"name":"Import",
"path":"import"
},
{
"uid":"9E5362EAB0E7",
"name":"Metadata",
"path":"metadata"
},
{
"uid":"A0CF90F6C0B9",
"name":"Personal",
"path":"personal"
},
{
"uid":"304FBDB2F3B1",
"name":"Planet",
"path":"planet"
},
{
"uid":"6153F468BE05",
"name":"Test",
"path":"test"
},
{
"uid":"263FC0186834",
"name":"Transport",
"path":"transport"
},
{
"uid":"2957AE9B6E6B",
"name":"User",
"path":"user"
}
]
},
"dataItemActions":{
"allowCreate":false,
"allowView":true,
"allowList":false,
"allowModify":false,
"allowDelete":false
},
"actions":{
"allowCreate":false,
"allowView":true,
"allowList":false,
"allowModify":false,
"allowDelete":false
}
}
Example: XML (containing subcategories)
Request:
GET /data HTTP/1.1
Accept: application/xml
Authtoken: {your_authtoken_goes_here}
Response:
HTTP/1.1 200 OK Content-Type: application/xml; charset=UTF-8
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <Resources> <DataCategoryResource> <Path/> <DataCategory created="2007-07-27 09:30:44.0" modified="2007-07-27 09:30:44.0" uid="CD310BEBAC52"> <Name>Root</Name> <Path/> <Environment uid="5F5887BCF726"/> </DataCategory> <Children> <DataCategories> <DataCategory uid="7E99F5EB43CE"> <Name>Business</Name> <Path>business</Path> </DataCategory> <DataCategory uid="BBA3AC3E795E"> <Name>Home</Name> <Path>home</Path> </DataCategory> <DataCategory uid="85A9172C31AF"> <Name>Import</Name> <Path>import</Path> </DataCategory> <DataCategory uid="9E5362EAB0E7"> <Name>Metadata</Name> <Path>metadata</Path> </DataCategory> <DataCategory uid="A0CF90F6C0B9"> <Name>Personal</Name> <Path>personal</Path> </DataCategory> <DataCategory uid="304FBDB2F3B1"> <Name>Planet</Name> <Path>planet</Path> </DataCategory> <DataCategory uid="6153F468BE05"> <Name>Test</Name> <Path>test</Path> </DataCategory> <DataCategory uid="263FC0186834"> <Name>Transport</Name> <Path>transport</Path> </DataCategory> <DataCategory uid="2957AE9B6E6B"> <Name>User</Name> <Path>user</Path> </DataCategory> </DataCategories> </Children> </DataCategoryResource> </Resources>
Example: JSON (containing data items)
Request:
GET /data/transport/plane/generic HTTP/1.1
Accept: application/json
Authtoken: {your_authtoken_goes_here}
Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8
{
"dataCategory":{
"uid":"FBA97B70DBDF",
"dataCategory":{
"uid":"6F3692D81CD9",
"name":"Plane",
"path":"plane"
},
"environment":{
"uid":"5F5887BCF726",
"itemsPerFeed":10,
"description":"",
"name":"AMEE",
"owner":"",
"path":"",
"itemsPerPage":10
},
"created":"2007-08-01 09:00:23.0",
"name":"Generic",
"path":"generic",
"itemDefinition":{
"uid":"441BF4BEA15B",
"environment":{
"uid":"5F5887BCF726"
},
"created":"2007-07-27 09:30:44.0",
"name":"Plane Generic",
"drillDown":"type,size",
"modified":"2007-07-27 09:30:44.0"
},
"modified":"2007-08-01 09:00:23.0"
},
"path":"/transport/plane/generic",
"children":{
"pager":{
"to":10,
"lastPage":2,
"nextPage":2,
"items":11,
"start":0,
"itemsFound":10,
"requestedPage":1,
"currentPage":1,
"from":1,
"itemsPerPage":10,
"previousPage":-1
},
"dataItems":{
"label":"DataItems",
"rows":[
{
"uid":"E98F73AE9B40",
"startDate":"2009-01-27T17:35:37Z",
"kgCO2PerPassengerKm":"-1.",
"source":"N/A",
"created":"2009-01-27 17:35:37.0",
"path":"E98F73AE9B40",
"endDate":"",
"label":"auto,one way",
"kgCO2PerPassengerJourney":"0",
"type":"auto",
"modified":"2009-01-27 17:35:37.0",
"size":"one way"
},
{
"uid":"601248F5F793",
"startDate":"2009-01-27T20:03:26Z",
"kgCO2PerPassengerKm":"-1.",
"source":"N/A",
"created":"2009-01-27 20:03:26.0",
"path":"601248F5F793",
"endDate":"",
"label":"auto,return",
"kgCO2PerPassengerJourney":"0",
"type":"auto",
"modified":"2009-01-27 20:03:26.0",
"size":"return"
},
{
"uid":"AD63A83B4D41",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.1753",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"AD63A83B4D41",
"endDate":"",
"label":"domestic",
"kgCO2PerPassengerJourney":"0.0000",
"type":"domestic",
"modified":"2007-08-01 09:00:41.0",
"size":"-"
},
{
"uid":"FFC7A05D54AD",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.0000",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"FFC7A05D54AD",
"endDate":"",
"label":"domestic,one way",
"kgCO2PerPassengerJourney":"81.2000",
"type":"domestic",
"modified":"2007-08-01 09:00:41.0",
"size":"one way"
},
{
"uid":"F5498AD6FC75",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.0000",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"F5498AD6FC75",
"endDate":"",
"label":"domestic,return",
"kgCO2PerPassengerJourney":"162.0000",
"type":"domestic",
"modified":"2007-08-01 09:00:41.0",
"size":"return"
},
{
"uid":"7D4220DF72F9",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.1106",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"7D4220DF72F9",
"endDate":"",
"label":"long haul",
"kgCO2PerPassengerJourney":"0.0000",
"type":"long haul",
"modified":"2007-08-01 09:00:41.0",
"size":"-"
},
{
"uid":"46117F6C0B7E",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.0000",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"46117F6C0B7E",
"endDate":"",
"label":"long haul,one way",
"kgCO2PerPassengerJourney":"844.0000",
"type":"long haul",
"modified":"2007-08-01 09:00:41.0",
"size":"one way"
},
{
"uid":"96D538B1B246",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.0000",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"96D538B1B246",
"endDate":"",
"label":"long haul,return",
"kgCO2PerPassengerJourney":"1688.0000",
"type":"long haul",
"modified":"2007-08-01 09:00:41.0",
"size":"return"
},
{
"uid":"9DA419052FDF",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.0983",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"9DA419052FDF",
"endDate":"",
"label":"short haul",
"kgCO2PerPassengerJourney":"0.0000",
"type":"short haul",
"modified":"2007-08-01 09:00:41.0",
"size":"-"
},
{
"uid":"84B4A14C7424",
"startDate":"2007-08-01T09:00:41+01:00",
"kgCO2PerPassengerKm":"0.0000",
"source":"defra/amee 2008",
"created":"2007-08-01 09:00:41.0",
"path":"84B4A14C7424",
"endDate":"",
"label":"short haul,one way",
"kgCO2PerPassengerJourney":"129.0000",
"type":"short haul",
"modified":"2007-08-01 09:00:41.0",
"size":"one way"
}
]
},
"dataCategories":[
{
"uid":"01900C469CDB",
"name":"Airports",
"path":"airports"
},
{
"uid":"0D4F2C945AA3",
"name":"Freight",
"path":"freight"
},
{
"uid":"9959AE4168BA",
"name":"Passenger class",
"path":"passengerclass"
}
]
},
"dataItemActions":{
"allowCreate":false,
"allowView":true,
"allowList":false,
"allowModify":false,
"allowDelete":false
},
"actions":{
"allowCreate":false,
"allowView":true,
"allowList":false,
"allowModify":false,
"allowDelete":false
}
}
Example: XML (containing data items)
Request:
GET /data/transport/plane/generic HTTP/1.1
Accept: application/xml
Authtoken: {your_authtoken_goes_here}
Response:
HTTP/1.1 200 OK Content-Type: application/xml; charset=UTF-8
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <Resources> <DataCategoryResource> <Path>/transport/plane/generic</Path> <DataCategory created="2007-08-01 09:00:23.0" modified="2007-08-01 09:00:23.0" uid="FBA97B70DBDF"> <Name>Generic</Name> <Path>generic</Path> <Environment uid="5F5887BCF726"/> <DataCategory uid="6F3692D81CD9"> <Name>Plane</Name> <Path>plane</Path> </DataCategory> <ItemDefinition uid="441BF4BEA15B"/> </DataCategory> <Children> <DataCategories> <DataCategory uid="01900C469CDB"> <Name>Airports</Name> <Path>airports</Path> </DataCategory> <DataCategory uid="0D4F2C945AA3"> <Name>Freight</Name> <Path>freight</Path> </DataCategory> <DataCategory uid="9959AE4168BA"> <Name>Passenger class</Name> <Path>passengerclass</Path> </DataCategory> </DataCategories> <DataItems> <DataItem created="2009-01-27 17:35:37.0" modified="2009-01-27 17:35:37.0" uid="E98F73AE9B40"> <startDate>2009-01-27T17:35:37Z</startDate> <source>N/A</source> <kgCO2PerPassengerKm>-1.</kgCO2PerPassengerKm> <path>E98F73AE9B40</path> <kgCO2PerPassengerJourney>0</kgCO2PerPassengerJourney> <label>auto, one way </label> <type>auto</type> <endDate/> <size>one way</size> </DataItem> <DataItem created="2009-01-27 20:03:26.0" modified="2009-01-27 20:03:26.0" uid="601248F5F793"> <startDate>2009-01-27T20:03:26Z</startDate> <source>N/A</source> <kgCO2PerPassengerKm>-1.</kgCO2PerPassengerKm> <path>601248F5F793</path> <kgCO2PerPassengerJourney>0</kgCO2PerPassengerJourney> <label>auto, return </label> <type>auto</type> <endDate/> <size>return</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="AD63A83B4D41"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.1753</kgCO2PerPassengerKm> <path>AD63A83B4D41</path> <kgCO2PerPassengerJourney>0.0000</kgCO2PerPassengerJourney> <label>domestic</label> <type>domestic</type> <endDate/> <size>-</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="FFC7A05D54AD"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.0000</kgCO2PerPassengerKm> <path>FFC7A05D54AD</path> <kgCO2PerPassengerJourney>81.2000</kgCO2PerPassengerJourney> <label>domestic,one way</label> <type>domestic</type> <endDate/> <size>one way</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="F5498AD6FC75"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.0000</kgCO2PerPassengerKm> <path>F5498AD6FC75</path> <kgCO2PerPassengerJourney>162.0000</kgCO2PerPassengerJourney> <label>domestic,return</label> <type>domestic</type> <endDate/> <size>return</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="7D4220DF72F9"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.1106</kgCO2PerPassengerKm> <path>7D4220DF72F9</path> <kgCO2PerPassengerJourney>0.0000</kgCO2PerPassengerJourney> <label>long haul</label> <type>long haul</type> <endDate/> <size>-</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="46117F6C0B7E"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.0000</kgCO2PerPassengerKm> <path>46117F6C0B7E</path> <kgCO2PerPassengerJourney>844.0000</kgCO2PerPassengerJourney> <label>long haul,one way</label> <type>long haul</type> <endDate/> <size>one way</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="96D538B1B246"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.0000</kgCO2PerPassengerKm> <path>96D538B1B246</path> <kgCO2PerPassengerJourney>1688.0000</kgCO2PerPassengerJourney> <label>long haul,return</label> <type>long haul</type> <endDate/> <size>return</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="9DA419052FDF"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.0983</kgCO2PerPassengerKm> <path>9DA419052FDF</path> <kgCO2PerPassengerJourney>0.0000</kgCO2PerPassengerJourney> <label>short haul</label> <type>short haul</type> <endDate/> <size>-</size> </DataItem> <DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="84B4A14C7424"> <startDate>2007-08-01T09:00:41+01:00</startDate> <source>defra/amee 2008</source> <kgCO2PerPassengerKm>0.0000</kgCO2PerPassengerKm> <path>84B4A14C7424</path> <kgCO2PerPassengerJourney>129.0000</kgCO2PerPassengerJourney> <label>short haul,one way</label> <type>short haul</type> <endDate/> <size>one way</size> </DataItem> </DataItems> <Pager> <Start>0</Start> <From>1</From> <To>10</To> <Items>11</Items> <CurrentPage>1</CurrentPage> <RequestedPage>1</RequestedPage> <NextPage>2</NextPage> <PreviousPage>-1</PreviousPage> <LastPage>2</LastPage> <ItemsPerPage>10</ItemsPerPage> <ItemsFound>10</ItemsFound> </Pager> </Children> </DataCategoryResource> </Resources>
Create a Data Category
NOTE: This function is only accessible to Administrators.
- URL: http://{server}/data[/{subcategory_path}]
- Method: POST
- Response format: application/xml, application/json
- Response code: 201 Created
Parameters:
| API Version | Parameter | Definition | Required |
| all | name | The name of the Data Category | Yes |
| all | path | The path of the Data Category | Yes |
| all | newObjectType | Should be set to "DC" to create a Data Category. | Yes |
| all | itemDefinitionUid | The UID of the Item Definition when creating a Data Category | No |
| all | itemsPerPage | Specify the number of items returned in a single page. See URLArchitecture for details of paging. | No |
Update a Data Category
NOTE: This function is only accessible to Administrators.
- URL: http://{server}/data/{subcategory_path}
- Method: PUT
- Response format: application/xml, application/json
- Response code: 200 OK
Parameters:
| API Version | Parameter | Definition | Required |
| all | name | The name of the Data Category | No |
| all | path | The path of the Data Category | No |
Delete a Data Category
NOTE: This function is only accessible to Administrators.
- URL: http://{server}/data/{subcategory_path}
- Method: DELETE
- Response code: 200 OK

