# Group Datawarehouse
Group of all datawarehouse-related resources.

## Artists 

The Artist resource is used to return detailed information about all the artists under a vendor.

## Index with sort params [/datawarehouse/artists/index{?label_ids,limit,sort_by,sort_order}]

### Index [GET]

+ Parameters

    + label_ids (required, number, `7123`)
    + limit (optional, number, `5`)
    + sort_by (optional, varchar, `artist_id`)
    + sort_order (optional, varchar, `asc`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "192.168.0.57",
      "httpStatusCode": 200
    },
    "request": "artists/index?params=datawarehouse&artists&index&json&<some_token>&5&7123&artist_id&asc",
    "response": {
      "artists": [
        {
          "artist_id": 39143,
          "artist_name": "Artist 5",
          "label_id": 7123
        },
        {
          "artist_id": 39144,
          "artist_name": "Artist 3",
          "label_id": 7123
        },
        {
          "artist_id": 39145,
          "artist_name": "Sharon Jones",
          "label_id": 7123
        },
        {
          "artist_id": 39146,
          "artist_name": "Nightingale",
          "label_id": 7123
        },
        {
          "artist_id": 52537,
          "artist_name": "Artist 2",
          "label_id": 7123
        }
      ],
      "total_records": "976"
    }
  }
}


## Index with search params [/datawarehouse/artists/index{?label_ids,limit,search_by,search_value}]

### Index [GET]

+ Parameters

    + label_ids(required, number, `7123`)
    + limit (optional, number, `5`)
    + search_by (optional, varchar, `artist_name`)
    + search_value (optional, varchar, `test`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "192.168.0.57",
      "httpStatusCode": 200
    },
    "request": "artists/index?params=datawarehouse&artists&index&json&<some_token>&artist_name&test&7123&5",
    "response": {
      "artists": [
        {
          "artist_id": 603918,
          "artist_name": "000000 DuPre Test",
          "label_id": 7123
        },
        {
          "artist_id": 178508,
          "artist_name": "00artist test 1",
          "label_id": 7123
        },
        {
          "artist_id": 180598,
          "artist_name": "Artist Add Test August 22 2011",
          "label_id": 7123
        },
        {
          "artist_id": 167484,
          "artist_name": "Artist testtest",
          "label_id": 7123
        },
        {
          "artist_id": 656799,
          "artist_name": "CucTest1",
          "label_id": 7123
        }
      ],
      "total_records": "68"
    }
  }
}


+ **Optional Parameters**

    + search_by
    + search_value
    + limit
    + offset
    + sort_by - column to order by 
    + sort_order - direction in which to order the data
