FORMAT: 1A

# Group Vectorapi
Group of all vectorapi-related resources.

## Track

Tracks are associated with a Release. One release can have multiple tracks. There are two types of tracks which are available. One is Audio and other is Film.
Subaccount Dms Restriction resource  is having combinations of 'subaccount' and 'customer_master' (i.e. sub-store) fields.
User is allow to upload their songs or videos related with release. They need to provide detail information of each track.
This resource manages post, put, get, index and delete functionality of track.

## GET [/vectorapi/track/get{?release_id,track_id,access_token}]

Fetch track data by track id

+ Parameters

    + release_id (required, number, `1365936`) 
    + track_id (optional, number, `16681123`) 
    + access_token (required,varchar, `some token`)


### Get [GET]

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)
    + Body
{
  "tracks": [
    {
      "id": 16681123,
      "track_name": "",
      "upc": "888831183143",
      "cd": 1,
      "track_id": 1,
      "orchdmclip": null,
      "sample": "N",
      "dmclips": null,
      "isrc": "",
      "length_minute": 1,
      "length_seconds": 13,
      "writer": null,
      "credit": "orig_comp",
      "mechanical": "no",
      "publisher": null,
      "publish_company": null,
      "dpd_license": "no",
      "explicit_lyrics": "N",
      "version": "",
      "purchasable": "Y",
      "download_price": null,
      "p_line": "2005 gdsafdsf",
      "hidden": null,
      "offer_type": "all",
      "dig_distribution_type": "digital_mobile",
      "third_party_publisher": "N",
      "royalty_collection": "Y",
      "publishing_admin": "N",
      "sync_admin": "Y",
      "additional_id": null,
      "track_type": "music",
      "mp3_url": null,
      "stereo_or_mono": null,
      "bonus": "N",
      "recommended": "N",
      "youtube_matches": "Monetize",
      "youtube_uploads": null,
      "preorder_only": "N",
      "original_file_name": "00A_1.wav",
      "last_updated": "2014-05-27 12:59:19",
      "meta_language": "ENG",
      "preview_start_time": null,
      "closed_caption_exists": null,
      "vendor_track_identifier": null,
      "Releases": {
        "release_id": 1365936,
        "release_status": "label_processing",
        "display_upc": "888831183143"
      },
      "closedCaptionReason": null,
      "TrackVideo": []
    }
  ]
}


+ **Required Parameters**

    + release_id - Primary key of releases table

+ **Optional Parameters**
    + track_id - Primary key of track table.

## POST [/vectorapi/track{?data,access_token}]

Add new track for given release_id

### Post [POST]

+ Parameters

    + data (varchar, `{"release_id":"1365936","tracks":[{"unique_track_id":"KOATRF","track_name":"Test track11","track_id":1,"cd":1,"isrc":"","vendor_track_identifier":"","explicit_lyrics":"N","trackName":"","TrackWriter":["writer a","writer b"],"trackartist":[{"name":"aaa"},{"name":"bbb"}],"p_line":"2010 label11","trackpublisher":["pub aaa","pub bb"],"third_party_publisher":"Y"}]}`)
    + access_token (varchar, `some token`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "tracks_response": {
    "16735638": {
      "track_id": 16735638,
      "unique_id": "KOATRF",
      "cd": "1",
      "trackNumber": "1",
      "original_file_name": null,
      "trackType": "music"
    }
  }
}



+ **Required Parameters**

    + uniqueTrackId // While creating new track unique track id should be consist of 6 alphabets 
    + cd // Volume number of the track.
    + trackId // track number of each volume
    + releaseId - Foreign key to releases table.

+ **Optional Parameters**
    + trackName - While creating new track unique track id should be consist of 6 alphabets
    + vendorTrackIdentifier - Volume number of the track.
    + isrc - track number of each volume
    + sample - Yes or No indicates whether this is a sample track.
    + dmsclips - Demo clip of the track.
    + isrc - ISRC code of the track....etc


## POST [/vectorapi/track{?data,access_token}]

Update track data for provided release.

### Post [POST]

+ Parameters

    + data (varchar, `{"release_id":"1365936","tracks":[{"unique_track_id":"16681124","track_name":"test track222","track_id":1,"cd":1,"isrc":"","vendor_track_identifier":"","explicit_lyrics":"N","trackName":"","TrackWriter":["writer a","writer b"],"trackartist":[{"name":"aaa"},{"name":"bbb"}],"p_line":"2010 label11","trackpublisher":["pub aaa","pub bb"],"third_party_publisher":"Y"}]}`)
    + access_token (varchar, `some token`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "tracks_response": {
    "16681124": {
      "track_id": 16681124,
      "unique_id": "16681124",
      "cd": "1",
      "trackNumber": "1",
      "original_file_name": "00A_2.wav",
      "trackType": "music"
    }
  }
}


+ **Required Parameters**

    + uniqueTrackId // While creating new track unique track id should be consist of 6 alphabets 
    + releaseId - Foreign key to releases table.

+ **Optional Parameters**

    + cd // Volume number of the track.
    + trackId // track number of each volume
    + trackName - While creating new track unique track id should be consist of 6 alphabets
    + vendorTrackIdentifier - Volume number of the track.
    + isrc - track number of each volume
    + sample - Yes or No indicates whether this is a sample track.
    + dmsclips - Demo clip of the track.
    + isrc - ISRC code of the track....etc


## Delete [/vectorapi/track{?id,access_token}]

### Delete [DELETE]

+ Parameters

    + id (required, number, `16735639`)
    + access_token (required ,varchar, `some token`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "response": "success"
}



+ **Required Parameters**

    + id - Primary key of track table.
