Dubber-API

 view release on metacpan or  search on metacpan

lib/Dubber/API.pm  view on Meta::CPAN

# ------------------------------------------------------------------------
has json_coder => (
    is         => 'ro',
    isa        => 'Cpanel::JSON::XS',
    lazy_build => 1,
);

method _build_json_coder () { return Cpanel::JSON::XS->new->utf8; }

# ------------------------------------------------------------------------
has endpoints => (
    is      => 'ro',
    default => sub {
        {   root => { path => '/' },

            # Group Methods (Group Authentication Required)
            get_group_details                 => { path => 'groups/:group_id' },
            get_group_accounts                => { path => 'groups/:group_id/accounts' },
            create_child_group                => { path => 'groups/:group_id/groups', method => 'POST' },
            create_account                    => { path => 'accounts', method => 'POST' },
            get_group_unidentified_recordings => { path => 'groups/:group_id/unidentified_recordings' },

lib/Dubber/API.pm  view on Meta::CPAN

                mandatory => [qw(external_type service_provider external_group external_identifier)]
            },

            # OAuth 2 Methods
            revoke_access_token => { path => 'revoke', method => 'POST' },

        };
    },
);

method commands () { return $self->endpoints; }

# ------------------------------------------------------------------------
method upload_recording_mp3_file ($account_id, $call_metadata, $mp3_file_or_data) {
    my @data_parts = $self->_split_recording_data($mp3_file_or_data);

    # create the recording object
    my $res = $self->create_recording( account_id => $account_id, %{$call_metadata} );
    if ( $res->{code} eq '201' ) {
        my $recording_id = $res->{content}{id};
        my $return_status;



( run in 0.341 second using v1.01-cache-2.11-cpan-2b1a40005be )