Methods

Quick reference

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

/building-instructions

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:9876/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/{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:9876/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/{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:9876/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/{idLegoSet}

Get detail informations about LEGO? set.

Get detail information about LEGO? set

Parameters

idLegoSet-LEGO? set number that identify each LEGO? set. Please note that this id is not related to number that appear at each LEGO? box.

HTPP method GET

Provide detail informations about LEGO? set

Example URL

http://www.cubiculus.com:9876/lego-set/34

HTTP result code - 200

Data are successfully send.
				
{
   "boxNo" : "1",
   "description" : "nice car",
   "idLastImageRevision" : 3,
   "idLastRevision" : 5,
   "idLegoBox" : 1,
   "idLegoCategory" : 1,
   "idLegoModel" : 1,
   "imageUrl" : null,
   "legoModelName" : "car",
   "modelImageUrl" : "http://localhost:8080/pictures/null?w=320&h=200",
   "name" : "auticko",
   "price" : null,
   "released" : null,
   "separator" : null
}				
				
					

HTTP result code - 404

There is no such LEGO? set.

/lego-category/

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:9876/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/${cateoryPath}

Get list of categories in root category.

Can be used for recursive printing LEGO? category tree.

Parameters

cateoryPath-

HTPP method GET

Example URL

http://www.cubiculus.com:9876/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/

get list of categories in root category.

Parameters

-
-

HTPP method GET

Example URL

http://www.cubiculus.com:9876/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://localhost:8080/pictures/236?w=320&h=200",
      "legoModelName" : "Volkswagen Beetle",
      "modelImageUrl" : "http://localhost:8080/pictures/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://localhost:8080/pictures/256?w=320&h=200",
      "legoModelName" : "Race Rider",
      "modelImageUrl" : "http://localhost:8080/pictures/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://localhost:8080/pictures/264?w=320&h=200",
      "legoModelName" : "Fierce Creatures",
      "modelImageUrl" : "http://localhost:8080/pictures/15?w=320&h=200",
      "name" : "Fierce Creatures",
      "price" : 13,
      "released" : 2008,
      "separator" : null
   },
   ...
   }				
				
					

/lego-set-category/${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:9876/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://localhost:8080/pictures/236?w=320&h=200",
      "legoModelName" : "Volkswagen Beetle",
      "modelImageUrl" : "http://localhost:8080/pictures/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://localhost:8080/pictures/256?w=320&h=200",
      "legoModelName" : "Race Rider",
      "modelImageUrl" : "http://localhost:8080/pictures/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://localhost:8080/pictures/264?w=320&h=200",
      "legoModelName" : "Fierce Creatures",
      "modelImageUrl" : "http://localhost:8080/pictures/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/{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:9876/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/{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:9876/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:9876/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.