LassoReference REST API v1.0

This API returns JSON formatted results from the Lasso 9 Reference Library for use in your own applications.

The Lasso Reference REST API v1.0 spec is read only.

Categories

Categories are the classifications that Types, Methods and Traits are assigned to.

Resource Description
/categories/list Returns a list of the categories in the Lasso Reference and the number of types, methods and traits assigned to that category.
/categories/search Returns a list of types, methods or traits that are assigned to that category.

Objects

Objects are the Lasso 9 Types, Methods and Traits in the Reference Database.

Resource Description
/search Returns a list of objects matching the supplied query.
/get Returns the full detail for the requested object.

API node /categories/list

Returns a list of the categories in the Lasso Reference and the number of types, methods and traits assigned to that category.

Resource URL

http://api.lassoref.com/lasso9/LassoReferenceApi/categories/list.xhr

Parameters

Parameter Description Possible Values Default
sort
string, optional
Defines the column upon which the sort order is applied to for the returned results. name, id, counter name
order
string, optional
Defines the order applied to the column sort. asc, desc asc

Response

Node Description

error
string

Provides detail of the error returned. Node contains "No Error" if no error generated.

categories
array of types category

Contains an ordered array of categories. See "category" type specification.

Subtypes Referenced

category

id
integer

The id of the category

name
string

The name of the category

counter
integer

The number of active entries in that category

Example

http://api.lassoref.com/lasso9/LassoReferenceApi/categories/list.xhr

Sample output


{
   "categories":[
      {
         "counter":11,
         "id":5,
         "name":"Admin"
      },
      {
         "counter":9,
         "id":74,
         "name":"Any"
      }
   ],
   "error":"No Error"
}

  

API node /categories/search

Returns a list of types, methods or traits that are assigned to that category.

Resource URL

http://api.lassoref.com/lasso9/LassoReferenceApi/categories/search.xhr

Parameters

Parameter Description

q
integer, required

The id of the category to return assigned objects.

Response

Node Description

error
string

Provides detail of the error returned. Node contains "No Error" if no error generated.

cat
string

The name of the currently requested category.

results
array of types shortObject

A list of types, methods and traits that are assigned to the category.

Subtypes Referenced

shortObject

id
integer

The id of the category

parentis
string

The object‘s parent name. For example "date"

name
string

The name of the object. i.e "add"

fullname
string

The full name of the object. For example "date->add"

category
integer

The category id of the current object

categoryname
integer

The name of the category assigned to the object

datatype
string

Reference to method or type/trait. Possible values are "m" or "tt"

datatypeext
string

Full text of object classification. Possible values "Type", "trait" or "Method"

description
string

Short description of object. Retrieve the full object using /get?id to obtain full object description.

Example

http://api.lassoref.com/lasso9/LassoReferenceApi/categories/search.xhr?q=47

Sample Output


{
   "cat":"Loop",
   "error":"No Error",
   "results":[
      {
         "category":4994,
         "categoryname":"Loop",
         "datatype":"m",
         "datatypeext":"Method",
         "description":"The [Iterate] method loops through each element...",
         "fullname":"iterate",
         "id":4994,
         "name":"iterate",
         "parentis":""
      },
      {
         "category":980,
         "categoryname":"Loop",
         "datatype":"m",
         "datatypeext":"Method",
         "description":"[loop] executes the provided body of code a...",
         "fullname":"loop",
         "id":980,
         "name":"loop",
         "parentis":""
      }
   ]
}


  

API node /search

Returns a list of types, methods or traits that are match a specified search query.

Resource URL

http://api.lassoref.com/lasso9/LassoReferenceApi/search.xhr

Parameters

Parameter Description

q
string, required

The search query.

notrack
boolean, optional

If true the most recent 10 successful queries for the requesting client is returned. This is based upon a session maintained via client side cookie, and is effectively ignored for server-side implementations.

Default value: false

Response

Node Description

error
string

Provides detail of the error returned. Node contains "No Error" if no error generated.

queries
array

The most recent 10 successful query strings from this client. The array size will only ever be a maximum of 10 and abides by "FIFO" rules. Suppressed if the "notrack" parameter of true has been supplied in the request.

results
array of types shortObject

A list of types, methods and traits that are returned as a result of the query.

Subtypes Referenced

shortObject

id
integer

The id of the category

parentis
string

The object's parent name. For example "date"

name
string

The name of the object. i.e "add"

fullname
string

The full name of the object. For example "date->add"

category
integer

The category id of the current object

categoryname
integer

The name of the category assigned to the object

datatype
string

Reference to method or type/trait. Possible values are "m" or "tt"

datatypeext
string

Full text of object classification. Possible values "Type", "trait" or "Method"

description
string

Short description of object. Retrieve the full object using /get?id to obtain full object description.

Example

http://api.lassoref.com/lasso9/LassoReferenceApi/search.xhr?q=findposition

Sample Output


{
   "error":"No Error",
   "queries":[
      "findposition"
   ],
   "results":[
      {
         "category":29,
         "categoryname":"Array",
         "datatype":"m",
         "datatypeext":"Method",
         "description":"The [array->findposition] method searches the...",
         "fullname":"array->findposition",
         "id":2580,
         "name":"findposition",
         "parentis":"array"
      },
      {
         "category":29,
         "categoryname":"Array",
         "datatype":"m",
         "datatypeext":"Method",
         "description":"The [staticarray->findposition] method...",
         "fullname":"staticarray->findposition",
         "id":2478,
         "name":"findposition",
         "parentis":"staticarray"
      },
      {
         "category":23,
         "categoryname":"Trait",
         "datatype":"m",
         "datatypeext":"Method",
         "description":"No description available.",
         "fullname":"trait_positionallySearchable->findposition",
         "id":1919,
         "name":"findposition",
         "parentis":"trait_positionallySearchable"
      },
      {
         "category":1,
         "categoryname":"String",
         "datatype":"m",
         "datatypeext":"Method",
         "description":"[String_FindPosition] takes two parameters: a...",
         "fullname":"String_FindPosition",
         "id":1459,
         "name":"String_FindPosition",
         "parentis":""
      }
   ]
}

API node /get           

Returns the full detail for the requested object.

Resource URL

http://api.lassoref.com/lasso9/LassoReferenceApi/get.xhr

Parameters

Parameter Description

id
string, required

The id of the object to be returned

datatype
string, optional

Represents a specific restriction for fetching the object based on datatype classification. Without this parameter it is assumed to be a Method retrieve command.

Default value: m
Possible Values: m, tt
"m" = "Method"
"tt" = "Type or Trait"

 

Response

Node Description

error
string

Provides detail of the error returned. Node contains "No Error" if no error generated.

id
integer

The id of the category

parentis
string

The object's parent name. For example "date"

name
string

The name of the object. i.e "add"

fullname
string

The full name of the object. For example "date->add"

category
integer

The category id of the current object

categoryname
integer

The name of the category assigned to the object

datatype
string

Reference to method or type/trait. Possible values are "m" or "tt"

datatypeext
string

Full text of object classification. Possible values "Type", "trait" or "Method"

description
string

Full description of the object.

syntax
string

Syntax for object use

examples
array

An array of usage examples for the object.

memberMethods
array

An array of member methods associated with a type. Empty if datatype is not "type"
traits
array
An array of traits associated with the type. Empty if datatype is not "type"
articles
array
An array of articles associated with this object. The array contains nodes "description" and "href".

tips
array

An array of tips associated with this object.

Subtypes Referenced

Examples

body
string

The introduction and detailed description about the example.

code
string

The code required to execute the example.

result
string

The result of the example code.

Example

http://api.lassoref.com/lasso9/LassoReferenceApi/get.xhr?id=2580&datatype=m

Sample Output


{
   "category":2580,
   "categoryname":"Array",
   "datatype":"m",
   "datatypeext":"Method",
   "description":"<p>The [array->findposition] method searches the array for the parameter and returns an array of positions for those elements which match. Accepts a single parameter of any data type including matchers. Optionally accepts a integer which is the offset position to begin searching the array at.<br /><br />If the array contains any pair values, only the first part of the pair is compared with the parameter of the [array->findposition] method.</p><p>If no elements in the array match the parameter to the [array->findposition] method, or the offset parameter is outside of the size of the array, then an empty array is returned.</p>",
   "error":"No Error",
   "examples":[

   ],
   "fullname":"array->findposition",
   "id":2580,
   "name":"findposition",
   "parentis":"array",
   "syntax":"array->findposition('search_term')array->findposition('search_term', offset)"
}