Create a Track record using the Portal Web API

function createFile() {
    var record = {};
    // Get the name from the form field and escape any special characters
    record.musdyn_name = encodeURIComponent(trackName);
    $('#upload-Audio h1').text('Uploading...');
            type: "POST",
            url: "/_api/musdyn_tracks",
            data: JSON.stringify(record),
            success: function (data, textStatus, xhr) {
                // If record creation succeeds, get the GUID of the newly created record and store in a varibale for easy reuse
                var entityID = xhr.getResponseHeader("entityid");
                // Provide some visual feedback re success of this stage
                $('#upload-Audio h1').text('Track created, uploading audio file');
                // Run the getFileContentsAndMetadata function, passing the GUID of the newly created record
            error: function (xhr, textStatus, errorThrown) {
                // If the creation fails, provide some visual feedback
                $('#upload-Audio h1').text('Uh oh, error creating the track');
Franco Musso