# Group Vector API
Group of all vectorapi-related resources.
## Channel

Channel resource is responsible for retrieving the channels list.

###INDEX 

+ **Request** 
    
    + Headers

            Accept: application/json

	+ Body
	 
			INDEX /channel?access_token=<some_token>
			

+ **Response**

    + Headers

            X-My-Message-Header: 42

    + Body

			{
			    "envelope": {
					"header": {
					    "apiVersion": "1.0",
						"baseUrl": "http://vectorapi.theorchard.com/vectorapi",
						"httpStatusCode": 200
					},
					"request": {},
					"response": {
						"channels": [
							{
			                    "transactionTypeId": "1",
								"transactionTypeAbbr": "S",
								"transactionTypeDesc": "Streams"
							},
			
			                {
			                    "transactionTypeId": "2",
								"transactionTypeAbbr": "SR",
								"transactionTypeDesc": "Sync Revenue"
							},
			
			                {
			                    "transactionTypeId": "3",
			                    "transactionTypeAbbr": "RC",
			                    "transactionTypeDesc": "Royalty Collection"
			                }
			               
			            ],
						"totalRecords": 25
			        }
			    }
			}


+ **Optional Parameters**

	+ transactionTypeId // integer
	+ transactionTypeIds // string ( comma separated ) 
	+ searchBy     // transactionTypeAbbr, transactionTypeDesc
	+ searchValue // string
	+ limit         // integer
	+ offset       // integer
	+ sortBy     // "transactionTypeId", "transactionTypeAbbr", "transactionTypeDesc"
	+ sortOrder // "asc", "desc"
	+ fields //  transactionTypeId,transactionTypeAbbr,transactionTypeDesc  string(comma separated values).
	
	In response a user gets default fields(transactionTypeId ,transactionTypeAbbr,transactionTypeDesc) but a user can request specific fields instead of getting all the fields by passing 'fields' parameter in request. If the filed parameter is not sent through request, the resource will return default fields( transactionTypeId,transactionTypeAbbr,transactionTypeDesc).

###Examples with optional parameters
**1) Fields parameter**

+ **Request**
    
    + Headers

            Accept: application/json
	+ Body
	
			INDEX /channel?access_token=<some_token>&&offset=0&limit=5&fields=transactionTypeId,transactionTypeAbbr

	

+ **Response**

    + Headers

            X-My-Message-Header: 42

    + Body

			{
			    "envelope": {
					"header": {
						"apiVersion": "1.0",
						"baseUrl": "http:\/\/vectorapi.theorchard.com\/vectorapi",
						"httpStatusCode": 200
			        },
			
			        "request": {},
					"response": {
						"channels": [{
							"transactionTypeId": "1",
							"transactionTypeAbbr": "S"
						}, {
							"transactionTypeId": "2",
							"transactionTypeAbbr": "SR"
						}, {
							"transactionTypeId": "3",
							"transactionTypeAbbr": "RC"
						}],
						"totalRecords": "26"
			        }
			    }
			}


**2) Search parameter**

+ **Request**
    
    + Headers

            Accept: application/json
	+ Body
	
			INDEX /channel?access_token=<some_token>&searchBy=transactionTypeDesc&searchValue=Downloaded

+ **Response** 

    + Headers

            X-My-Message-Header: 42

    + Body

			{
				"envelope": {
					"header": {
						"apiVersion": "1.0",
						"baseUrl": "http:\/\/vectorapi.theorchard.com\/vectorapi",
						"httpStatusCode": 200
					},
					"request": {},
					"response": {
						 "channels": [{
							"transactionTypeId": "4",
							"transactionTypeAbbr": "DR",
							"transactionTypeDesc": "Downloaded Ringtone"
						}],
						"totalRecords": "1"
			         }           
			     }
			}
