Register(FREE)   Login

REST LEGO® API - Public API description

Cubiculus > API > Description
Here are described exposed methods. Method are accessible with REST and HTTP requests. In following text you'll find described exposed methods their parameter and meaning. Technical background of API methods described here.
If some information is missing or you have some question contact us.

Quick reference

/building-instructions/{apiKey}get list of available LEGO® building instructions
/building-instructions/{apiKey}/{id}Get information about one LEGO® building instruction.
/user-by-email/{apiKey}/{email}Perform login operation. After authorization provide users account informations.
/lego-set/{apiKey}/{legoSetNo}Get detail informations about LEGO® set.
/lego-category/{apiKey}/Get list of categories in root category.
/lego-category/{apiKey}/${categoryPath}Get list of categories in root category.
/lego-set-category/{apiKey}/get list of categories in root category.
/lego-set-category/{apiKey}/${cateoryPath}get list of categories in root category.
/collection/{apiKey}/{idUser}after authorization get list of user entry in his collection.
/collection/{apiKey}/{idUser}/{idLegoSet}After authorization allows manage content of LEGO® collection.

/building-instructions/{apiKey}

get list of available LEGO® building instructions

Parameters

HTPP method GET

Allows to get full list of available building instructions

Example URL

http://www.cubiculus.com/api-rest/building-instruction

HTTP result code - 200

Data are successfully send.
				
[
   {
      "description" : "137",
      "idInstruction" : 1,
      "name" : "137",
      "shortcutPicture" : "http://www.cubiculus.com/original/0137/TN_01379.JPG",
      "stepGroups" : null
   },
   {
      "description" : "Curved Track",
      "idInstruction" : 2,
      "name" : "151",
      "shortcutPicture" : "http://www.cubiculus.com/original/0151/TN_01511.JPG",
      "stepGroups" : null
   },
   {
      "description" : "London Bus",
      "idInstruction" : 3,
      "name" : "313",
      "shortcutPicture" : "http://www.cubiculus.com/original/0313/TN_031311.JPG",
      "stepGroups" : null
   }]
   
					

/building-instructions/{apiKey}/{id}

Get information about one LEGO® building instruction.

Parameters

id-Identification number of building instruction

HTPP method GET

Get detail informations about one building instruction.

Example URL

http://www.cubiculus.com/api-rest/building-instruction/300

HTTP result code - 200

Data are successfully send.
				
{
   "description" : "Crater Crawler",
   "idInstruction" : 250,
   "name" : "6826",
   "shortcutPicture" : "http://www.cubiculus.com/original/6826/TN_682601.JPG",
   "stepGroups" :
      [
         {
            "fileNames" :
               [
                  "http://www.cubiculus.com/original/6826/682602.JPG",
                  "http://www.cubiculus.com/original/6826/682603.JPG",
                  "http://www.cubiculus.com/original/6826/682604.JPG",
                  "http://www.cubiculus.com/original/6826/682605.JPG",
                  "http://www.cubiculus.com/original/6826/682606.JPG",
                  "http://www.cubiculus.com/original/6826/682607.JPG",
                  "http://www.cubiculus.com/original/6826/682608.JPG"
               ],
            "name" : "Crater Crawler"
         },
         {
            "fileNames" :
               [
                  "http://www.cubiculus.com/original/6826/682610.JPG",
                  "http://www.cubiculus.com/original/6826/682611.JPG",
                  "http://www.cubiculus.com/original/6826/682612.JPG",
                  "http://www.cubiculus.com/original/6826/682613.JPG"
               ],
            "name" : "fly"
         },
         {
            "fileNames" :
               [
               ],
            "name" : "crew"
         }
      ]
}				

					

HTTP result code - 404

There is no such LEGO® building instruction.

/user-by-email/{apiKey}/{email}

Perform login operation. After authorization provide users account informations.

Parameters

email-User identifying email.

HTPP method GET

Get detail informations about one user. Also prove that login name and passwords are correct. Method require BASIC AUTH HTTP authorization system. Please look at the example code. There are detail working example.

Example URL

http://www.cubiculus.com/api-rest/user-by-email/somebody@somewhere.com

HTTP result code - 200

Data are successfully send.
				
{
   "birthDate" : "2006-01-01T01:00:00.000",
   "email" : "somebody@somewhere.com",
   "idBlog" : 304,
   "idImageIcon" : 234,
   "idUser" : 304,
   "lastLogin" : "2009-07-22T09:50:01.000",
   "password" : "l1CEQX",
   "registrationDate" : "2009-07-22T09:50:01.000",
   "userName" : "somebody"
}

					

HTTP result code - 401

The request requires user authentication. Please provide correct email and password values.

HTTP result code - 404

There is no such LEGO® building instruction.

/lego-set/{apiKey}/{legoSetNo}

Get detail informations about LEGO® set.

Get detail information about LEGO® set

Parameters

legoSetNo-LEGO® set number that identify each LEGO® set. Please note that this is related to number that appears at each LEGO® box.

HTPP method GET

Provide detail informations about LEGO® set

Example URL

http://www.cubiculus.com/api-rest/lego-set/10187

HTTP result code - 200

Data are successfully send to API user. Service could return more than one LEGO® set descriptions. This happens in case that two distinct LEGO® set have same number.
				
[
   {
      "boxNo" : "10187",
      "description" : "Super car",
      "idLastImageRevision" : null,
      "idLastRevision" : 89,
      "idLegoBox" : 3,
      "idLegoCategory" : 28,
      "idLegoModel" : 1,
      "imageUrl" : "http://www.cubiculus.com/images/320?w=320&h=200",
      "legoModelName" : "Volkswagen Beetle",
      "modelImageUrl" : "http://www.cubiculus.com/images/2?w=320&h=200",
      "name" : "Volkswagen Beetle II",
      "pieces" : 1626,
      "price" : 150,
      "released" : 2008,
      "separator" : null,
      "url" : "10187"
   }
]				
					

HTTP result code - 404

There is no such LEGO® set.

/lego-category/{apiKey}/

Get list of categories in root category.

Can be used for recursive printing LEGO® category tree.

Parameters

HTPP method GET

Example URL

http://www.cubiculus.com/api-rest/lego-category/

HTTP result code - 200

Data are successfully send.
				
{
   "childrenNames" :
      [
         "/system",
         "/legoland",
         "/seasonal",
         "/promotional",
         "/technic",
         "/basic",
         "/non-original"
      ],
   "countBoxes" : 15,
   "countBuildingInstructions" : 422,
   "fullWebPath" : "",
   "idBuildingInstructions" :
      [
      ],
   "idLegoCategory" : 1,
   "idLegoSets" :
      [
      ],
   "name" : "root"
}				
				
					

/lego-category/{apiKey}/${categoryPath}

Get list of categories in root category.

Can be used for recursive printing LEGO® category tree.

Parameters

categoryPath-

HTPP method GET

Example URL

http://www.cubiculus.com/api-rest/lego-category/

HTTP result code - 200

Data are successfully send.
				
{
   "childrenNames" :
      [
         "/system/town",
         "/system/police",
         "/system/space",
         "/system/train",
         "/system/star-wars",
         "/system/sculptures",
         "/system/designer",
         "/system/model-team",
         "/system/creator"
      ],
   "countBoxes" : 15,
   "countBuildingInstructions" : 255,
   "fullWebPath" : "/system",
   "idBuildingInstructions" :
      [
      ],
   "idLegoCategory" : 2,
   "idLegoSets" :
      [
         10
      ],
   "name" : "SYSTEM"
}
				
					

HTTP result code - 404

There is no such LEGO® category.

/lego-set-category/{apiKey}/

get list of categories in root category.

Parameters

-
-

HTPP method GET

Example URL

http://www.cubiculus.com/api-rest/lego-set-category/

HTTP result code - 200

Data are successfully send.
				
[
   {
      "boxNo" : "10187",
      "description" : "Super car",
      "idLastImageRevision" : null,
      "idLastRevision" : 6,
      "idLegoBox" : 3,
      "idLegoCategory" : 28,
      "idLegoModel" : 1,
      "imageUrl" : "http://www.cubiculus.com/images/236?w=320&h=200",
      "legoModelName" : "Volkswagen Beetle",
      "modelImageUrl" : "http://www.cubiculus.com/images/2?w=320&h=200",
      "name" : "Volkswagen Beetle",
      "price" : 120,
      "released" : 2008,
      "separator" : null
   },
   {
      "boxNo" : "6747",
      "description" : "Race Rider",
      "idLastImageRevision" : null,
      "idLastRevision" : 47,
      "idLegoBox" : 13,
      "idLegoCategory" : 43,
      "idLegoModel" : 10,
      "imageUrl" : "http://www.cubiculus.com/images/256?w=320&h=200",
      "legoModelName" : "Race Rider",
      "modelImageUrl" : "http://www.cubiculus.com/images/11?w=320&h=200",
      "name" : "Race Rider",
      "price" : 20,
      "released" : 2008,
      "separator" : null
   },
   {
      "boxNo" : "4994",
      "description" : "Fierce Creatures",
      "idLastImageRevision" : null,
      "idLastRevision" : 63,
      "idLegoBox" : 17,
      "idLegoCategory" : 43,
      "idLegoModel" : 14,
      "imageUrl" : "http://www.cubiculus.com/images/264?w=320&h=200",
      "legoModelName" : "Fierce Creatures",
      "modelImageUrl" : "http://www.cubiculus.com/images/15?w=320&h=200",
      "name" : "Fierce Creatures",
      "price" : 13,
      "released" : 2008,
      "separator" : null
   },
   ...
   }				
				
					

/lego-set-category/{apiKey}/${cateoryPath}

get list of categories in root category.

Parameters

cateoryPath-Category path that identify some LEGO® category

HTPP method GET

Example URL

http://www.cubiculus.com/api-rest/lego-set-category/

HTTP result code - 200

Data are successfully send.
				
[
   {
      "boxNo" : "10187",
      "description" : "Super car",
      "idLastImageRevision" : null,
      "idLastRevision" : 6,
      "idLegoBox" : 3,
      "idLegoCategory" : 28,
      "idLegoModel" : 1,
      "imageUrl" : "http://www.cubiculus.com/images/236?w=320&h=200",
      "legoModelName" : "Volkswagen Beetle",
      "modelImageUrl" : "http://www.cubiculus.com/images/2?w=320&h=200",
      "name" : "Volkswagen Beetle",
      "price" : 120,
      "released" : 2008,
      "separator" : null
   },
   {
      "boxNo" : "6747",
      "description" : "Race Rider",
      "idLastImageRevision" : null,
      "idLastRevision" : 47,
      "idLegoBox" : 13,
      "idLegoCategory" : 43,
      "idLegoModel" : 10,
      "imageUrl" : "http://www.cubiculus.com/images/256?w=320&h=200",
      "legoModelName" : "Race Rider",
      "modelImageUrl" : "http://www.cubiculus.com/images/11?w=320&h=200",
      "name" : "Race Rider",
      "price" : 20,
      "released" : 2008,
      "separator" : null
   },
   {
      "boxNo" : "4994",
      "description" : "Fierce Creatures",
      "idLastImageRevision" : null,
      "idLastRevision" : 63,
      "idLegoBox" : 17,
      "idLegoCategory" : 43,
      "idLegoModel" : 14,
      "imageUrl" : "http://www.cubiculus.com/images/264?w=320&h=200",
      "legoModelName" : "Fierce Creatures",
      "modelImageUrl" : "http://www.cubiculus.com/images/15?w=320&h=200",
      "name" : "Fierce Creatures",
      "price" : 13,
      "released" : 2008,
      "separator" : null
   },
   ...
   }				
				
					

HTTP result code - 404

There is no such LEGO® set category.

/collection/{apiKey}/{idUser}

after authorization get list of user entry in his collection.

Parameters

idUser-User identification number, can be get from user-by-email resource

HTPP method GET

Require authorization.

Example URL

http://www.cubiculus.com/api-rest/collection/9/

HTTP result code - 200

Data are successfully send.
				
{
   "items" :
      [
         {
            "comment" : null,
            "idLegoSet" : 5,
            "quantity" : 1
         }
      ]
}				
				
					

HTTP result code - 404

There is no such user.

/collection/{apiKey}/{idUser}/{idLegoSet}

After authorization allows manage content of LEGO® collection.

Parameters

idUser-User identification number, can be get from user-by-email resource
idLegoSet-identification number of LEGO® set.

HTPP method GET

Get information about one collections item. It also confirm that some LEGO® set is in collection.

Example URL

http://www.cubiculus.com/api-rest/collection/1/1

HTTP result code - 200

Data are successfully send.
				
{
   "comment" : null,
   "idLegoSet" : 1,
   "quantity" : 8
}
				
					

HTTP result code - 404

There is no such user or item in LEGO® set collection.

HTPP method POST

Allows store new collection item into collection or update number of owned items.

Example URL

http://www.cubiculus.com/api-rest/collection/1/1

HTTP result code - 200

LEGO® set was successfully updated.

HTTP result code - 404

There is no such user or item in LEGO® set collection.
LEGO® is a trademark of the LEGO® Group, which does not sponsor, authorize or endorse this web site.
© cubiculus.com, All rights reserved.