# Class: Code

## ClearBlade. Code

#### new Code() → {Object}

  creates and returns a Code object that can be used to execute ClearBlade Code Services
  Source:
    - ClearBlade.js, line 1412

  ##### Returns:

  ClearBlade.Code
  Type
    Object

### Methods

#### execute(name, params, callback)

  Executes a ClearBlade Code Service

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | String | name of the ClearBlade service
  `params` | Object | object containing parameters to be used in service
  `callback` | function |

  Source:
    - ClearBlade.js, line 1424

  ##### Example

      cb.Code().execute("ServiceName", {stringParam: "stringVal", numParam: 1, objParam: {"key": "val"}, arrayParam: ["ClearBlade", "is", "awesome"]}, function(err, body) {
         if(err) {
             //handle error
         } else {
             console.log(body);
         }
      })

#### getCompletedServices(callback)

  Retrieves a list of completed services for a system

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | function |

  Source:
    - ClearBlade.js, line 1454

  ##### Example

      cb.Code().getCompletedServices(function(err, body) {
         if(err) {
             //handle error
         } else {
             console.log(body);
         }
      })

#### getFailedServices(callback)

  Retrieves a list of failed services for a system

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | function |

  Source:
    - ClearBlade.js, line 1477

  ##### Example

      cb.Code().getFailedServices(function(err, body) {
         if(err) {
             //handle error
         } else {
             console.log(body);
         }
      })